You are here

function taxonomy_access_menu in Taxonomy Access Control 5

Same name and namespace in other branches
  1. 5.2 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 164
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/settings/taxonomy_access',
      'title' => t('Taxonomy Access: Settings'),
      //        'description' => t('Configure Taxonomy Access Control'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        '_taxonomy_access_admin_settings',
      ),
      'access' => user_access('administer site configuration'),
    );
    $items[] = array(
      'path' => 'admin/user/taxonomy_access',
      'title' => t('Taxonomy Access: Permissions'),
      'description' => t('Sophisticated access control for content items based on category'),
      'callback' => '_taxonomy_access_permissions_page',
      'access' => user_access('administer access control'),
    );
  }
  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;
}