You are here

function og_vocab_taxonomy_admin_term_edit in OG Vocabulary 6

Menu callback; Make sure the term id is a valid one and that can be accessed by the user.

Parameters

$tid: Term id passed by the menu system.

1 string reference to 'og_vocab_taxonomy_admin_term_edit'
og_vocab_menu in ./og_vocab.module
Implementation of hook_menu().

File

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

Code

function og_vocab_taxonomy_admin_term_edit($tid) {
  if (intval($tid) > 0) {

    // Make sure the term belongs to a vocabulary associated with the user's
    // acceisable group(s).
    $term = taxonomy_get_term($tid);
    $group = node_load(og_vocab_get_group($term->vid));
    if (node_access('view', $group)) {
      return taxonomy_admin_term_edit($tid);
    }
  }
  return drupal_access_denied();
}