You are here

function og_vocab_form_taxonomy_form_term_alter in OG Vocabulary 6

Same name and namespace in other branches
  1. 7 og_vocab.module \og_vocab_form_taxonomy_form_term_alter()

Implementation of hook_form_FORM_ID_alter().

Remove synonyms from the term adding/ editing form.

File

./og_vocab.module, line 323
Give each group its own system controlled vocabularies.

Code

function og_vocab_form_taxonomy_form_term_alter(&$form, &$form_state) {
  $vocab = taxonomy_vocabulary_load($form['vid']['#value']);
  if ($vocab->module == 'og_vocab') {
    unset($form['advanced']['synonyms']);
  }
  $item = menu_get_item();
  if (strpos($item['path'], 'node/%/og/vocab/terms') === 0) {

    // This is edit term, so redirect back to og_vocab tab.
    $form['#redirect'] = 'node/' . $item['map'][1]->nid . '/og/vocab';
    if (!empty($form['actions']['cancel'])) {
      _og_vocab_redirect_cancel_to_og_vocab($form, $item);
    }
  }
}