You are here

function cctags_menu in cctags 6

Same name and namespace in other branches
  1. 7 cctags.module \cctags_menu()

Implementation of hook_menu

File

./cctags.module, line 24

Code

function cctags_menu() {
  $items = array();
  $items['admin/settings/cctags'] = array(
    'title' => 'Cctags configuration',
    'description' => 'Configure the Cctags.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'cctags_settings',
    ),
    'access callback' => 'user_access',
    'access arguments' => array(
      'administer site configuration',
    ),
    'file' => 'cctags.admin.inc',
  );
  $items['admin/settings/cctags/list'] = array(
    'title' => 'Cctags configuration',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  );
  $items['admin/settings/cctags/add'] = array(
    'title' => 'Add cctags item',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'cctags_settings_add_item',
    ),
    'access arguments' => array(
      'administer site configuration',
    ),
    'type' => MENU_LOCAL_TASK,
    'file' => 'cctags.admin.inc',
  );
  $items['admin/settings/cctags/%/edit'] = array(
    'title' => 'Edit cctags item',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'cctags_settings_edit_item',
      3,
    ),
    'access arguments' => array(
      'administer site configuration',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'cctags.admin.inc',
  );
  $items['admin/settings/cctags/%/delete'] = array(
    'title' => 'Delete cctags item',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'cctags_settings_delete_item',
      3,
    ),
    'access arguments' => array(
      'administer site configuration',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'cctags.admin.inc',
  );
  $cctags_items = _cctags_get_settings();
  foreach ($cctags_items as $key => $item) {
    if ($item['page']) {
      $items[$item['page_path']] = array(
        'title' => $item['page_title'] == '<none>' ? $item['name'] : $item['page_title'],
        'page callback' => 'cctags_page',
        'page arguments' => array(
          $item,
        ),
        'access callback' => 'user_access',
        'access arguments' => array(
          'access content',
        ),
        'file' => 'cctags.page.inc',
      );
    }
  }
  $path = variable_get('cctags_users_page_path', 'cctags/users');
  $items[$path] = array(
    'title' => 'Users list',
    'page callback' => 'cctags_users_page',
    'access callback' => 'user_access',
    'access arguments' => array(
      'access content',
    ),
    'file' => 'cctags.page.inc',
  );
  return $items;
}