function taxonomy_field_settings_form
taxonomy_field_settings_form($field, $instance, $has_data)
Implements hook_field_settings_form().
File
- modules/taxonomy/taxonomy.module, line 1800
- Enables the organization of content into categories.
Code
function taxonomy_field_settings_form($field, $instance, $has_data) { // Get proper values for 'allowed_values_function', which is a core setting. $vocabularies = taxonomy_get_vocabularies(); $options = array(); foreach ($vocabularies as $vocabulary) { $options[$vocabulary->machine_name] = $vocabulary->name; } $form['allowed_values'] = array( '#tree' => TRUE, ); foreach ($field['settings']['allowed_values'] as $delta => $tree) { $form['allowed_values'][$delta]['vocabulary'] = array( '#type' => 'select', '#title' => t('Vocabulary'), '#default_value' => $tree['vocabulary'], '#options' => $options, '#required' => TRUE, '#description' => t('The vocabulary which supplies the options for this field.'), '#disabled' => $has_data, ); $form['allowed_values'][$delta]['parent'] = array( '#type' => 'value', '#value' => $tree['parent'], ); } return $form; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!taxonomy!taxonomy.module/function/taxonomy_field_settings_form/7.x