You are here

function taxonomy_access_menu in Taxonomy Access Control 5.2

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

Implementation of hook_menu

File

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

Code

function taxonomy_access_menu($may_cache) {
  $items = array();
  if ($may_cache) {
    $items[] = array(
      'path' => 'admin/user/taxonomy_access',
      'title' => t('Taxonomy access permissions'),
      'description' => t('Taxonomy-based access control for content'),
      'callback' => 'taxonomy_access_admin',
      'access' => user_access('administer access control'),
    );
    $items[] = array(
      'path' => 'admin/user/taxonomy_access/delete',
      'type' => MENU_CALLBACK,
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'taxonomy_access_admin_delete_role',
      ),
    );
    $items[] = array(
      'path' => 'admin/user/taxonomy_access/edit',
      'type' => MENU_CALLBACK,
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'taxonomy_access_admin_form',
      ),
    );
  }
  else {
    if (arg(0) == 'admin') {
      $path = drupal_get_path('module', 'taxonomy_access');
      include_once $path . '/taxonomy_access_admin.inc';
      drupal_add_css($path . '/admin.css');
    }
  }
  return $items;
}