From 342ebd7776df44eae48876a2526949fef4d04d4b Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sun, 1 Nov 2009 14:05:32 +0000 Subject: - Patch #567064 by yched, sun: widgets done 'the easy way' have too many limitations. Removes more code than it adds! --- modules/field/field.api.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'modules/field/field.api.php') diff --git a/modules/field/field.api.php b/modules/field/field.api.php index fcf78b36d..6248842b7 100644 --- a/modules/field/field.api.php +++ b/modules/field/field.api.php @@ -632,11 +632,15 @@ function hook_field_widget_info_alter(&$info) { * Array of default values for this field. * @param $delta * The order of this item in the array of subelements (0, 1, 2, etc). + * @param $element + * A form element array containing basic properties for the widget: #title, + * #description, #required, #field, #field_instance, #field_name, #delta, + * #columns. * @return * The form item for a single element for this field. */ -function hook_field_widget(&$form, &$form_state, $field, $instance, $langcode, $items, $delta = 0) { - $element = array( +function hook_field_widget(&$form, &$form_state, $field, $instance, $langcode, $items, $delta, $element) { + $element += array( '#type' => $instance['widget']['type'], '#default_value' => isset($items[$delta]) ? $items[$delta] : '', ); -- cgit v1.2.3