You are here

function taxonomy_tools_form_taxonomy_form_term_alter in Taxonomy Tools 7

Same name and namespace in other branches
  1. 8 taxonomy_tools.module \taxonomy_tools_form_taxonomy_form_term_alter()

Implements hook_form_FORM_ID_alter().

File

./taxonomy_tools.module, line 91
Drupal hooks and functions to work with taxonomy terms.

Code

function taxonomy_tools_form_taxonomy_form_term_alter(&$form, &$form_state) {

  // Preset default parent term.
  if (arg(4) && arg(4) == 'overview' && is_numeric(arg(5))) {
    $form['relations']['parent']['#default_value'] = array(
      arg(5) => arg(5),
    );
  }
  if (arg(3) && arg(3) == 'overview' && is_numeric(arg(2))) {
    $form['relations']['parent']['#default_value'] = array(
      arg(2) => arg(2),
    );
  }
}