You are here

function quotes_menu in Quotes 7

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

Implements hook_menu().

File

./quotes.module, line 119
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() {

  // Show tab on user account page.
  $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' => 99,
  );

  // Menu callbacks.
  $items['quotes/%user/feed'] = array(
    'title' => 'RSS feed',
    'access arguments' => array(
      'access quotes',
    ),
    'page callback' => '_quotes_feed_user',
    'page arguments' => array(
      1,
    ),
    'type' => MENU_CALLBACK,
  );
  $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,
  );

  // Quotes Selection by author menu entry.
  $items['quotes/byauthor'] = array(
    'title' => 'By author',
    'description' => 'Select quotes by author.',
    'page callback' => 'quotes_page',
    'page arguments' => array(
      1,
      "- FIND -",
    ),
    'access arguments' => array(
      'access quotes',
    ),
    'type' => MENU_NORMAL_ITEM,
  );

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

  // Quotes Selection by author menu entry.
  $items['quotes/%'] = array(
    'title' => 'Accounts quotes page',
    'page callback' => 'quotes_page',
    'page arguments' => array(
      1,
    ),
    'access arguments' => array(
      'access quotes',
    ),
    'type' => MENU_CALLBACK,
  );

  // 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);

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

  // Import quotes.
  $items['quotes/import'] = array(
    'title' => 'Import quotes',
    'page callback' => '_quotes_add',
    'page arguments' => array(
      1,
    ),
    'access arguments' => array(
      'import quotes',
    ),
    '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',
    ),
    'page arguments' => array(
      1,
    ),
    'type' => $quick_nav ? MENU_LOCAL_TASK : MENU_CALLBACK,
  );

  // Admin configuration settings for quotes.
  $items['admin/config/content/quotes'] = array(
    'access arguments' => array(
      'administer quotes',
    ),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'quotes_admin_settings',
    ),
    'title' => 'Quotes module',
    'file' => 'quotes.admin.inc',
    'description' => 'Configure Quotes module options and blocks.',
  );
  $items['admin/config/content/quotes/general'] = array(
    'title' => 'General',
    'description' => 'Quotes configuration settings.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'quotes_admin_settings',
    ),
    'access arguments' => array(
      'administer quotes',
    ),
    'file' => 'quotes.admin.inc',
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );
  $items['admin/config/content/quotes/blocks'] = array(
    'title' => 'Configure blocks',
    'description' => 'Quotes blocks Configuration.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'quotes_blocks_settings',
    ),
    'access arguments' => array(
      'administer quotes',
    ),
    'file' => 'quotes.admin.inc',
    'type' => MENU_LOCAL_TASK,
    'weight' => 1,
  );
  $items['admin/config/content/quotes/export'] = array(
    'title' => 'Export',
    'description' => 'Export your Quotes',
    'page callback' => 'drupal_get_form',
    'access arguments' => array(
      'administer quotes',
    ),
    'page arguments' => array(
      'quotes_export',
    ),
    'file' => 'quotes.admin.inc',
    'type' => MENU_LOCAL_TASK,
    'weight' => 3,
  );
  $items[QUOTES_BIOS_PATH] = array(
    'title' => 'Bios',
    'description' => 'Quotes author bios',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'quotes_bios',
    ),
    'access arguments' => array(
      'administer quotes',
    ),
    'file' => 'quotes.admin.inc',
    'type' => MENU_LOCAL_TASK,
    'weight' => 2,
  );
  $items['admin/config/content/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;
}