| 1 |
<?php |
<?php |
| 2 |
// $Id: field.api.php,v 1.45 2009/10/22 00:49:12 dries Exp $ |
// $Id: field.api.php,v 1.46 2009/10/23 22:24:13 webchick Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @ingroup field_fieldable_type |
* @ingroup field_fieldable_type |
| 632 |
* Array of default values for this field. |
* Array of default values for this field. |
| 633 |
* @param $delta |
* @param $delta |
| 634 |
* The order of this item in the array of subelements (0, 1, 2, etc). |
* The order of this item in the array of subelements (0, 1, 2, etc). |
| 635 |
|
* @param $element |
| 636 |
|
* A form element array containing basic properties for the widget: #title, |
| 637 |
|
* #description, #required, #field, #field_instance, #field_name, #delta, |
| 638 |
|
* #columns. |
| 639 |
* @return |
* @return |
| 640 |
* The form item for a single element for this field. |
* The form item for a single element for this field. |
| 641 |
*/ |
*/ |
| 642 |
function hook_field_widget(&$form, &$form_state, $field, $instance, $langcode, $items, $delta = 0) { |
function hook_field_widget(&$form, &$form_state, $field, $instance, $langcode, $items, $delta, $element) { |
| 643 |
$element = array( |
$element += array( |
| 644 |
'#type' => $instance['widget']['type'], |
'#type' => $instance['widget']['type'], |
| 645 |
'#default_value' => isset($items[$delta]) ? $items[$delta] : '', |
'#default_value' => isset($items[$delta]) ? $items[$delta] : '', |
| 646 |
); |
); |