Mercurial > defr > drupal > popups_reference
comparison popups_reference.module @ 6:990f71344a66
Merge des modifications avec la version 1.3
author | Franck Deroche <franck@defr.org> |
---|---|
date | Thu, 19 Mar 2009 11:39:17 +0100 |
parents | e1318a313b1d 9d5826d3028d |
children | 571a89603e2b |
comparison
equal
deleted
inserted
replaced
5:e1318a313b1d | 6:990f71344a66 |
---|---|
91 $wrapper_id = 'popups-reference-' . _popups_reference_counter(); | 91 $wrapper_id = 'popups-reference-' . _popups_reference_counter(); |
92 $links = _popups_reference_links($field, $type, $wrapper_id, $field['widget']['type']); | 92 $links = _popups_reference_links($field, $type, $wrapper_id, $field['widget']['type']); |
93 if ($links) { | 93 if ($links) { |
94 // Put the nodereference widget and links in an wrapper. | 94 // Put the nodereference widget and links in an wrapper. |
95 // Makes it easy to find for Ahah targeting, and popups_reference behavior selecting. | 95 // Makes it easy to find for Ahah targeting, and popups_reference behavior selecting. |
96 $form[$key]['#prefix'] = '<div id="'. $wrapper_id .'">'; | 96 $form[$key]['#popups_reference_prefix'] = '<div id="'. $wrapper_id .'">'; |
97 $form[$key]['#suffix'] = '<div>Add New: ' . implode(', ', $links) .'</div></div>'; | 97 $form[$key]['#popups_reference_suffix'] = '<div>Add New: ' . implode(', ', $links) .'</div></div>'; |
98 $form[$key]['#after_build'][] = 'popups_reference_after_build'; | |
98 } | 99 } |
99 } | 100 } |
101 } | |
102 | |
103 function popups_reference_after_build($form_element) { | |
104 $form_element['#prefix'] = $form_element['#popups_reference_prefix'] . $form_element['#prefix']; | |
105 $form_element['#suffix'] .= $form_element['#popups_reference_suffix']; | |
106 return $form_element; | |
100 } | 107 } |
101 | 108 |
102 /** | 109 /** |
103 * Generates 'Add new...' link | 110 * Generates 'Add new...' link |
104 * for each allowed content type | 111 * for each allowed content type |