You are here

function fasttoggle_menu in Fasttoggle 6

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

Implementation of hook_menu().

File

./fasttoggle.module, line 43
Enables fast toggling of binary or not so binary settings.

Code

function fasttoggle_menu() {
  $items = array();
  $items['admin/settings/fasttoggle'] = array(
    'title' => 'Fasttoggle',
    'description' => 'Configure what fast toggling options are available.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'fasttoggle_settings_form',
    ),
    'file' => 'fasttoggle.admin.inc',
    'access arguments' => array(
      'administer fasttoggle',
    ),
  );
  $items['node/%node/toggle/%/%'] = array(
    'title' => 'Toggle',
    'page callback' => 'fasttoggle_node_option',
    'page arguments' => array(
      1,
      3,
      4,
    ),
    'access callback' => TRUE,
    // Access checking is handled in hook_fasttoggle_options().
    'type' => MENU_CALLBACK,
    'file' => 'fasttoggle.toggle.inc',
  );
  $items['user/%user/toggle/%/%'] = array(
    'title' => 'Toggle',
    'page callback' => 'fasttoggle_user_option',
    'page arguments' => array(
      1,
      3,
      4,
    ),
    'access callback' => TRUE,
    // Access checking is handled in hook_fasttoggle_options().
    'type' => MENU_CALLBACK,
    'file' => 'fasttoggle.toggle.inc',
  );

  // Note: _comment is required so that it maps to _comment_load
  $items['comment/%_comment/toggle/%/%'] = array(
    'title' => 'Toggle',
    'page callback' => 'fasttoggle_comment_option',
    'page arguments' => array(
      1,
      3,
      4,
    ),
    'access callback' => TRUE,
    // Access checking is handled in hook_fasttoggle_options().
    'type' => MENU_CALLBACK,
    'file' => 'fasttoggle.toggle.inc',
  );
  return $items;
}