You are here

function field_test_field_widget_info in SimpleTest 7

Implement hook_field_widget_info().

Here we indicate that the field module will handle the default value and multiple values for these widgets.

Callbacks can be omitted if default handing is used. They're included here just so this module can be used as an example for custom modules that might do things differently.

File

tests/field_test.module, line 466

Code

function field_test_field_widget_info() {
  return array(
    'test_field_widget' => array(
      'label' => t('Test field'),
      'field types' => array(
        'test_field',
      ),
      'settings' => array(
        'test_widget_setting' => 'dummy test string',
      ),
      'behaviors' => array(
        'multiple values' => FIELD_BEHAVIOR_DEFAULT,
        'default value' => FIELD_BEHAVIOR_DEFAULT,
      ),
    ),
    'test_field_widget_multiple' => array(
      'label' => t('Test field 1'),
      'field types' => array(
        'test_field',
      ),
      'settings' => array(
        'test_widget_setting_multiple' => 'dummy test string',
      ),
      'behaviors' => array(
        'multiple values' => FIELD_BEHAVIOR_CUSTOM,
        'default value' => FIELD_BEHAVIOR_DEFAULT,
      ),
    ),
  );
}