You are here

function taxonomy_container_field_widget_settings_form in Taxonomy container 7

Implements hook_field_widget_settings_form().

File

./taxonomy_container.module, line 25
Allows users to organize containers using taxonomy terms.

Code

function taxonomy_container_field_widget_settings_form($field, $instance) {

  // Prefix might not be set if the module was updated from version 7.x-1.2
  // or earlier.
  $prefix = isset($instance['widget']['settings']['prefix']) ? $instance['widget']['settings']['prefix'] : '-';
  $form['prefix'] = array(
    '#type' => 'textfield',
    '#size' => 3,
    '#maxlength' => 3,
    '#title' => t('List item prefix'),
    '#description' => t('The character before each child term.'),
    '#default_value' => $prefix,
  );
  $form['multiple_select_size'] = array(
    '#type' => 'textfield',
    '#disabled' => $field['cardinality'] == 1,
    '#size' => 5,
    '#title' => t('Size of select box'),
    '#description' => t('Only for multi-select boxes. If left blank the browser default value will be used.'),
    '#default_value' => $instance['widget']['settings']['multiple_select_size'],
    '#field_suffix' => t('rows'),
    '#element_validate' => array(
      'element_validate_integer_positive',
    ),
  );
  return $form;
}