You are here

function taxonomy_access_form_alter in Taxonomy Access Control 5.2

Same name and namespace in other branches
  1. 5 taxonomy_access.module \taxonomy_access_form_alter()
  2. 6 taxonomy_access.module \taxonomy_access_form_alter()

Implementation of hook_form_alter()

File

./taxonomy_access.module, line 211
Allows administrators to specify how each category (in the taxonomy) can be used by various roles.

Code

function taxonomy_access_form_alter($form_id, &$form) {

  //TODO: Move control of "create" op here

  //TODO: look at feasability to eliminate _restore_terms and _preserve_terms by simply setting the '#access' attribute for those terms
  if ($form['#id'] == 'node-form' && is_numeric($form['nid']['#value'])) {
    $form['tac_protected_terms'] = array(
      '#type' => 'value',
      '#value' => taxonomy_access_preserve_terms($form['nid']['#value']),
    );
  }
}