You are here

function vppr_menu_alter in Vocabulary Permissions Per Role 7

Same name and namespace in other branches
  1. 6 vppr.module \vppr_menu_alter()

Implements hook_menu_alter().

File

./vppr.module, line 12
Vocabulary Permissions Per Role

Code

function vppr_menu_alter(&$items) {

  // Taxonomy overview page.
  $items['admin/structure/taxonomy']['access callback'] = 'vppr_access_taxonomy';
  $items['admin/structure/taxonomy']['page callback'] = 'vppr_taxonomy_overview_vocabularies';
  $items['admin/structure/taxonomy']['file'] = 'vppr.admin.inc';
  $items['admin/structure/taxonomy']['file path'] = drupal_get_path('module', 'vppr');
  unset($items['admin/structure/taxonomy']['page arguments']);

  // Terms list.
  $items['admin/structure/taxonomy/%taxonomy_vocabulary_machine_name']['access callback'] = 'vppr_access_vocabulary_terms';
  $items['admin/structure/taxonomy/%taxonomy_vocabulary_machine_name']['access arguments'] = array(
    3,
  );

  // Add terms.
  $items['admin/structure/taxonomy/%taxonomy_vocabulary_machine_name/add']['access callback'] = 'vppr_access_vocabulary_terms';
  $items['admin/structure/taxonomy/%taxonomy_vocabulary_machine_name/add']['access arguments'] = array(
    3,
  );

  // Term edit.
  $items['taxonomy/term/%taxonomy_term/edit']['access callback'] = 'vppr_access_term_edit';
  $items['taxonomy/term/%taxonomy_term/edit']['access arguments'] = array(
    2,
  );
}