function hook_field_widget_settings_form

×

Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
cis7 field_ui.api.php hook_field_widget_settings_form($field, $instance)
cle7 field_ui.api.php hook_field_widget_settings_form($field, $instance)
elmsmedia7 field_ui.api.php hook_field_widget_settings_form($field, $instance)
icor7 field_ui.api.php hook_field_widget_settings_form($field, $instance)
meedjum_blog7 field_ui.api.php hook_field_widget_settings_form($field, $instance)
mooc7 field_ui.api.php hook_field_widget_settings_form($field, $instance)

Add settings to a widget settings form.

Invoked from field_ui_field_edit_form() to allow the module defining the widget to add settings for a widget instance.

Parameters

$field: The field structure being configured.

$instance: The instance structure being configured.

Return value

The form definition for the widget settings.

Related topics

15 functions implement hook_field_widget_settings_form()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

date_field_widget_settings_form in sites/all/modules/ulmus/date/date.field.inc
Implements hook_field_widget_settings_form().
email_field_widget_settings_form in sites/all/modules/ulmus/email/email.module
Implements hook_field_widget_settings_form().
entityreference_field_widget_settings_form in sites/all/modules/ulmus/entityreference/entityreference.module
Implements hook_field_widget_settings_form().
field_collection_fieldset_field_widget_settings_form in sites/all/modules/ulmus/field_collection_fieldset/field_collection_fieldset.module
Implements hook_field_widget_settings_form().
field_collection_tabs_widget_field_widget_settings_form in sites/all/modules/ulmus/field_collection_tabs_widget/field_collection_tabs_widget.module
Implements hook_field_formatter_settings_form().

... See full list

1 invocation of hook_field_widget_settings_form()
field_ui_field_edit_form in modules/field_ui/field_ui.admin.inc
Form constructor for the field instance settings form.

File

modules/field_ui/field_ui.api.php, line 107
Hooks provided by the Field UI module.

Code

function hook_field_widget_settings_form($field, $instance) {
  $widget = $instance['widget'];
  $settings = $widget['settings'];

  if ($widget['type'] == 'text_textfield') {
    $form['size'] = array(
      '#type' => 'textfield',
      '#title' => t('Size of textfield'),
      '#default_value' => $settings['size'],
      '#element_validate' => array('element_validate_integer_positive'),
      '#required' => TRUE,
    );
  }
  else {
    $form['rows'] = array(
      '#type' => 'textfield',
      '#title' => t('Rows'),
      '#default_value' => $settings['rows'],
      '#element_validate' => array('element_validate_integer_positive'),
      '#required' => TRUE,
    );
  }

  return $form;
}