Mercurial > defr > drupal > popups_reference
comparison popups_reference.module @ 3:98642e828c60
Don't take over #prefix / #suffix if previously defined.
This broke the "Add more" fonctionnality of CCK. Being E_STRICT compliant
makes the code quite verbose though :-/
| author | Franck Deroche <franck@defr.org> |
|---|---|
| date | Wed, 21 Jan 2009 14:39:42 +0100 |
| parents | ece8e4be4d6f |
| children | 9d5826d3028d |
comparison
equal
deleted
inserted
replaced
| 2:92ed2a629336 | 3:98642e828c60 |
|---|---|
| 90 $wrapper_id = 'popups-reference-' . _popups_reference_counter(); | 90 $wrapper_id = 'popups-reference-' . _popups_reference_counter(); |
| 91 $links = _popups_reference_links($field, $type, $wrapper_id, $field['widget']['type']); | 91 $links = _popups_reference_links($field, $type, $wrapper_id, $field['widget']['type']); |
| 92 if ($links) { | 92 if ($links) { |
| 93 // Put the nodereference widget and links in an wrapper. | 93 // Put the nodereference widget and links in an wrapper. |
| 94 // Makes it easy to find for Ahah targeting, and popups_reference behavior selecting. | 94 // Makes it easy to find for Ahah targeting, and popups_reference behavior selecting. |
| 95 $form[$key]['#prefix'] = '<div id="'. $wrapper_id .'">'; | 95 $prefix = '<div id="'. $wrapper_id .'">'; |
| 96 $form[$key]['#suffix'] = '<div>Add New: ' . implode(', ', $links) .'</div></div>'; | 96 if (isset($form[$key]['#prefix'])) { |
| 97 $form[$key]['#prefix'] .= $prefix; | |
| 98 } | |
| 99 else { | |
| 100 $form[$key]['#prefix'] = $prefix; | |
| 101 } | |
| 102 $suffix = '<div>Add New: ' . implode(', ', $links) .'</div></div>'; | |
| 103 if (isset($form[$key]['#suffix'])) { | |
| 104 $form[$key]['#suffix'] = $suffix . $form[$key]['#suffix']; | |
| 105 } | |
| 106 else { | |
| 107 $form[$key]['#suffix'] = $suffix; | |
| 108 } | |
| 97 } | 109 } |
| 98 } | 110 } |
| 99 } | 111 } |
| 100 | 112 |
| 101 /** | 113 /** |
