You are here

function quotes_menu in Quotes 6

Same name and namespace in other branches
  1. 5 quotes.module \quotes_menu()
  2. 7 quotes.module \quotes_menu()

Implementation of hook_menu().

File

./quotes.module, line 84
The quotes module allows users to maintain a list of quotes that can be displayed in any number of administrator-defined quote blocks.

Code

function quotes_menu() {
  global $user;
  $items = array();

  // User account tab.
  $items['user/%user/quotes'] = array(
    'title' => 'My Quotes',
    'page callback' => 'quotes_user_page',
    'page arguments' => array(
      1,
    ),
    'file' => 'quotes.user.inc',
    'access callback' => '_quotes_recentquotes_access',
    'type' => MENU_LOCAL_TASK,
    'weight' => 2,
  );

  // Menu callbacks.
  $items['quotes/feed'] = array(
    'title' => 'RSS feed',
    'access arguments' => array(
      'access quotes',
    ),
    'page callback' => '_quotes_feed_last',
    'type' => MENU_CALLBACK,
  );
  $items['quotes/autocomplete/author'] = array(
    'title' => 'Autocomplete author field',
    'access arguments' => array(
      'access quotes',
    ),
    'page callback' => '_quotes_autocomplete_author',
    'type' => MENU_CALLBACK,
  );
  $items['quotes/autocomplete/citation'] = array(
    'title' => 'Autocomplete citation field',
    'access arguments' => array(
      'access quotes',
    ),
    'page callback' => '_quotes_autocomplete_citation',
    'type' => MENU_CALLBACK,
  );

  // My quotes menu entry.
  $items['quotes/myquotes'] = array(
    'title' => 'My quotes',
    'page callback' => 'quotes_myquotes',
    'access callback' => '_quotes_myquotes_access',
    'type' => MENU_NORMAL_ITEM,
  );

  // Primary menu entry.
  $items['quotes'] = array(
    'title' => 'Quotes',
    'access arguments' => array(
      'access quotes',
    ),
    'page callback' => 'quotes_page',
    'type' => MENU_NORMAL_ITEM,
  );

  // Begin quotes page tabs.
  $quick_nav = variable_get('quotes_quick_nav', TRUE);
  $items['quotes/%'] = array(
    'title' => 'Quotes page',
    'page callback' => 'quotes_page',
    'page arguments' => array(
      1,
    ),
    'access arguments' => array(
      'access quotes',
    ),
    'type' => $quick_nav ? MENU_DEFAULT_LOCAL_TASK : MENU_CALLBACK,
    'weight' => -5,
  );

  // Add new quote.
  $items['quotes/add'] = array(
    'title' => 'Add a new quote',
    'page callback' => '_quotes_add',
    'access arguments' => array(
      'create quotes',
    ),
    'type' => $quick_nav ? MENU_LOCAL_TASK : MENU_CALLBACK,
  );
  $items['quotes/author'] = array(
    'title' => 'By author',
    'access arguments' => array(
      'access quotes',
    ),
    'page callback' => 'quotes_page',
    'page arguments' => array(
      1,
      2,
    ),
    'type' => $quick_nav ? MENU_LOCAL_TASK : MENU_CALLBACK,
  );

  // Admin settings for the site.
  $items['quotes/settings'] = array(
    'title' => 'Settings',
    'description' => 'Configure Quotes module options and blocks.',
    'page callback' => '_quotes_settings',
    'access arguments' => array(
      'administer quotes',
    ),
    'type' => $quick_nav ? MENU_LOCAL_TASK : MENU_CALLBACK,
  );

  // End tabs.
  // Admin menu.
  $items['admin/settings/quotes'] = array(
    'title' => 'Quotes',
    'description' => 'Configure Quotes module options and blocks.',
    'access arguments' => array(
      'administer quotes',
    ),
    'page callback' => 'quotes_admin_settings_page',
    'type' => MENU_NORMAL_ITEM,
    'file' => 'quotes.admin.inc',
  );
  $items['admin/settings/quotes/general'] = array(
    'title' => 'General',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'quotes_admin_settings',
    ),
    'access arguments' => array(
      'administer quotes',
    ),
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -1,
    'file' => 'quotes.admin.inc',
  );
  $items['admin/settings/quotes/blocks'] = array(
    'title' => 'Configure blocks',
    'description' => 'Block configuration for quotes',
    'page callback' => 'drupal_get_form',
    'access arguments' => array(
      'administer quotes',
    ),
    'page arguments' => array(
      'quotes_blocks_settings',
    ),
    'type' => MENU_LOCAL_TASK,
    'file' => 'quotes.admin.inc',
  );
  $items['admin/settings/quotes/export'] = array(
    'title' => 'Export',
    'description' => check_plain(t('Export quotes')),
    'page callback' => 'drupal_get_form',
    'access arguments' => array(
      'administer quotes',
    ),
    'page arguments' => array(
      'quotes_export',
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => 1,
    'file' => 'quotes.admin.inc',
  );
  $items[BIOS_PATH] = array(
    'title' => 'Bios',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'quotes_bios',
    ),
    'access arguments' => array(
      'administer quotes',
    ),
    'type' => MENU_LOCAL_TASK,
    'file' => 'quotes.admin.inc',
  );
  $items['admin/settings/quotes/delete'] = array(
    'title' => 'Delete quote block',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      '_quotes_block_delete',
    ),
    'access arguments' => array(
      'administer quotes',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'quotes.admin.inc',
  );
  return $items;
}