You are here

function simplify_form_taxonomy_form_vocabulary_alter in Simplify 7.3

Implements hook_form_FORM_ID_alter() for taxonomy_form_vocabulary.

File

./simplify.module, line 233
Simplifies the user interface by hiding particular fields.

Code

function simplify_form_taxonomy_form_vocabulary_alter(&$form, &$form_state, $form_id) {
  $vocabulary = $form['#vocabulary'];

  // Taxonomy
  $form['simplify'] = array(
    '#type' => 'fieldset',
    '#title' => t('Simplify'),
    '#description' => t("These fields will be hidden from <em>@vocabulary</em> taxonomy term forms. Disabled checkboxes indicate fields that have been hidden globally on the <a href=\"@global\">Simplify administration page</a>.", array(
      '@vocabulary' => $vocabulary->name,
      '@global' => url('admin/config/user-interface/simplify'),
    )),
    '#access' => user_access('administer simplify'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['simplify']['simplify_taxonomy'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Hide'),
    '#options' => simplify_get_fields('taxonomy'),
    '#default_value' => variable_get('simplify_taxonomy_' . $vocabulary->machine_name, array()),
    '#after_build' => array(
      'simplify_disable_globally_hidden_checkboxes',
    ),
  );

  // Add custom submit function
  $form['#submit'][] = 'simplify_taxonomy_form_vocabulary_submit';
}