You are here

function term_level_field_widget_settings_form in Term Level Field 7

Implements hook_widget_settings_form().

File

./term_level.module, line 249
Field type for referencing terms with a level to an entity.

Code

function term_level_field_widget_settings_form($field, $instance) {
  $settings = $instance['widget']['settings'];
  $form['term_entries_limit_per_group'] = array(
    '#type' => 'select',
    '#title' => t('Number of terms per group'),
    '#options' => array(
      FIELD_CARDINALITY_UNLIMITED => t('Unlimited'),
    ) + drupal_map_assoc(range(0, 10)),
    '#default_value' => $settings['term_entries_limit_per_group'],
  );
  $form['tag_cloud'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable Tag Cloud'),
    '#default_value' => $settings['tag_cloud'],
    '#description' => t('If checked, each term group will have a tag cloud with addional terms not listed in the table.'),
  );
  $form['validate_empty_terms'] = array(
    '#type' => 'checkbox',
    '#title' => t('Validate empty terms'),
    '#default_value' => $settings['validate_empty_terms'],
    '#description' => t('If checked, terms with no selected level will throw a validation errror. This forces the user to either select a level or remove the term from the table group.'),
  );
  return $form;
}