You are here

function active_tags_form_alter in Active Tags 5

Same name and namespace in other branches
  1. 6.2 active_tags.module \active_tags_form_alter()
  2. 6 active_tags.module \active_tags_form_alter()

File

./active_tags.module, line 23
Active Tags widget for free tagging taxonomies

Code

function active_tags_form_alter($form_id, &$form) {
  if ($form_id == 'taxonomy_form_vocabulary') {
    $form['active_tags'] = array(
      '#type' => 'checkbox',
      '#title' => t('Active Tags'),
      '#weight' => 10,
      '#default_value' => isset($form['vid']['#value']) ? variable_get('active_tags_' . $form['vid']['#value'], 0) : 0,
      '#description' => t('Swaps this vocabulary widget for an enhanced tag field if browser supports javascript.'),
    );
    $form['submit']['#weight'] = 11;
    if (isset($form['delete'])) {
      $form['delete']['#weight'] = 12;
    }
    $form['#validate'] = array(
      'active_tags_form_vocabulary_validate' => array(),
    );
    $form['#submit'] += array(
      'active_tags_form_vocabulary_submit' => array(),
    );
  }
}