Mercurial > defr > drupal > noderef_view
comparison noderef_view.module @ 5:4fc2f22efcdf
Better name for the attribute to prevent collision, add to #after_build
#link was probably overly too broad, so I've renamed the attribute to include
the module name.
The code previously also fully took over #after_build, which killed other
modules registrations. Now the module's a good citizen and only add its
handler leaving the others as is.
author | Franck Deroche <franck@defr.org> |
---|---|
date | Mon, 26 Jan 2009 14:59:57 +0100 |
parents | 9372c6448311 |
children | e3f85c9247b7 |
comparison
equal
deleted
inserted
replaced
4:b4c1e3d5d5ce | 5:4fc2f22efcdf |
---|---|
110 */ | 110 */ |
111 function noderef_view_alter_item(&$form, $key, $field) { | 111 function noderef_view_alter_item(&$form, $key, $field) { |
112 if (is_array($field) && $field['type'] == 'nodereference') { | 112 if (is_array($field) && $field['type'] == 'nodereference') { |
113 $link = _noderef_view_get_link($field); | 113 $link = _noderef_view_get_link($field); |
114 if (!empty($link)) { | 114 if (!empty($link)) { |
115 $form[$key]['#links'] = $link; | 115 $form[$key]['#noderef_view_link'] = $link; |
116 $form[$key]['#after_build'] = array('noderef_view_add_link'); | 116 $form[$key]['#after_build'][] = 'noderef_view_add_link'; |
117 return TRUE; | 117 return TRUE; |
118 } | 118 } |
119 } | 119 } |
120 return FALSE; | 120 return FALSE; |
121 } | 121 } |