# HG changeset patch # User Franck Deroche # Date 1237808662 -3600 # Node ID 8ced981c0dc0fc1009d821be59dd902377a2df34 # Parent ab667e3dc8ba7f489422d6a129d613bf2a6a2dbe# Parent 571a89603e2b3b8ea70b01f75d6d50362e6782ea Merge de la 1.0 diff -r ab667e3dc8ba -r 8ced981c0dc0 popups_reference.module --- a/popups_reference.module Mon Mar 23 12:44:10 2009 +0100 +++ b/popups_reference.module Mon Mar 23 12:44:22 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'] = '
'; - $form[$key]['#suffix'] = '
Add New: ' . implode(', ', $links) .'
'; + $form[$key]['#popups_reference_prefix'] = '
'; + $form[$key]['#popups_reference_suffix'] = '
Add New: ' . implode(', ', $links) .'
'; + $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 @@ -114,7 +121,7 @@ // Target the wrapper for replacing. popups_add_popups(array('a.'.$wrapper_id=>array('targetSelectors'=>array('#'.$wrapper_id)))); } - else if ($widget_type == 'nodereference_autocomplete') { + else if ($widget_type == 'nodereference_autocomplete' || $widget_type == 'noderef_view_autocomplete') { // Don't replace the autocomplete when done. popups_add_popups(array('a.'.$wrapper_id=>array('noUpdate'=>TRUE))); }