Mercurial > defr > drupal > popups_reference
changeset 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 (current diff) 9d5826d3028d (diff) |
children | 571a89603e2b |
files | popups_reference.js popups_reference.module |
diffstat | 1 files changed, 9 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/popups_reference.module Thu Mar 19 11:34:01 2009 +0100 +++ b/popups_reference.module Thu Mar 19 11:39:17 2009 +0100 @@ -93,12 +93,19 @@ if ($links) { // Put the nodereference widget and links in an wrapper. // Makes it easy to find for Ahah targeting, and popups_reference behavior selecting. - $form[$key]['#prefix'] = '<div id="'. $wrapper_id .'">'; - $form[$key]['#suffix'] = '<div>Add New: ' . implode(', ', $links) .'</div></div>'; + $form[$key]['#popups_reference_prefix'] = '<div id="'. $wrapper_id .'">'; + $form[$key]['#popups_reference_suffix'] = '<div>Add New: ' . implode(', ', $links) .'</div></div>'; + $form[$key]['#after_build'][] = 'popups_reference_after_build'; } } } +function popups_reference_after_build($form_element) { + $form_element['#prefix'] = $form_element['#popups_reference_prefix'] . $form_element['#prefix']; + $form_element['#suffix'] .= $form_element['#popups_reference_suffix']; + return $form_element; +} + /** * Generates 'Add new...' link * for each allowed content type