summaryrefslogtreecommitdiff
path: root/modules/simpletest/tests/field_test.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-11-01 14:05:32 +0000
committerDries Buytaert <dries@buytaert.net>2009-11-01 14:05:32 +0000
commit342ebd7776df44eae48876a2526949fef4d04d4b (patch)
tree4d3f9f79244e14ed94327a9649eff13204ac6d1f /modules/simpletest/tests/field_test.module
parente4ca439ba1f901526526f73adb106f7075fb5f11 (diff)
downloadbrdo-342ebd7776df44eae48876a2526949fef4d04d4b.tar.gz
brdo-342ebd7776df44eae48876a2526949fef4d04d4b.tar.bz2
- Patch #567064 by yched, sun: widgets done 'the easy way' have too many limitations. Removes more code than it adds!
Diffstat (limited to 'modules/simpletest/tests/field_test.module')
-rw-r--r--modules/simpletest/tests/field_test.module32
1 files changed, 2 insertions, 30 deletions
diff --git a/modules/simpletest/tests/field_test.module b/modules/simpletest/tests/field_test.module
index f8d2258a7..f3b1c8b9e 100644
--- a/modules/simpletest/tests/field_test.module
+++ b/modules/simpletest/tests/field_test.module
@@ -489,40 +489,12 @@ function field_test_field_widget_info() {
/**
* Implement hook_field_widget().
- *
- * Attach a single form element to the form. It will be built out and
- * validated in the callback(s) listed in hook_element_info(). We build it
- * out in the callbacks rather than here in hook_widget so it can be
- * plugged into any module that can provide it with valid
- * $field information.
- *
- * If there are multiple values for this field, the field module will
- * call this function as many times as needed.
- *
- * @param $form
- * the entire form array, $form['#node'] holds node information
- * @param $form_state
- * the form_state, $form_state['values'][$field['field_name']]
- * holds the field's form values.
- * @param $field
- * The field structure.
- * @param $instance
- * the instance array
- * @param $items
- * array of default values for this field
- * @param $delta
- * the order of this item in the array of subelements (0, 1, 2, etc)
- *
- * @return
- * the form item for a single element for this field
*/
-function field_test_field_widget(&$form, &$form_state, $field, $instance, $langcode, $items, $delta = 0) {
+function field_test_field_widget(&$form, &$form_state, $field, $instance, $langcode, $items, $delta, $element) {
$element = array(
- 'value' => array(
- '#title' => $instance['label'],
+ 'value' => $element + array(
'#type' => 'textfield',
'#default_value' => isset($items[$delta]['value']) ? $items[$delta]['value'] : '',
- '#required' => $instance['required'],
),
);
return $element;