You are here

function panels_menu in Panels 6.2

Same name and namespace in other branches
  1. 8.3 panels.module \panels_menu()
  2. 5.2 panels.module \panels_menu()
  3. 5 panels.module \panels_menu()
  4. 6.3 panels.module \panels_menu()
  5. 7.3 panels.module \panels_menu()

Implementation of hook_menu

File

./panels.module, line 127
panels.module

Code

function panels_menu() {
  $items = array();

  // Provide some common options to reduce code repetition.
  // By using array addition and making sure these are the rightmost
  // value, they won't override anything already set.
  $base = array(
    'access arguments' => array(
      'access content',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'includes/display-edit.inc',
  );
  $items['panels/ajax/add-pane'] = array(
    'page callback' => 'panels_ajax_add_pane_choose',
  ) + $base;
  $items['panels/ajax/add-pane-config'] = array(
    'page callback' => 'panels_ajax_add_pane_config',
  ) + $base;
  $items['panels/ajax/configure'] = array(
    'page callback' => 'panels_ajax_configure_pane',
  ) + $base;
  $items['panels/ajax/show'] = array(
    'page callback' => 'panels_ajax_toggle_shown',
    'page arguments' => array(
      'show',
    ),
  ) + $base;
  $items['panels/ajax/hide'] = array(
    'page callback' => 'panels_ajax_toggle_shown',
    'page arguments' => array(
      'hide',
    ),
  ) + $base;
  $items['panels/ajax/cache-method'] = array(
    'page callback' => 'panels_ajax_cache_method',
  ) + $base;
  $items['panels/ajax/cache-settings'] = array(
    'page callback' => 'panels_ajax_cache_settings',
  ) + $base;

  // For panel settings on the edit layout settings page
  $items['panels/ajax/style-settings'] = array(
    'page callback' => 'panels_ajax_style_settings',
    'file' => 'includes/display-layout-settings.inc',
  ) + $base;

  // Non-display editor callbacks
  $items['panels/node/autocomplete'] = array(
    'title' => 'Autocomplete node',
    'page callback' => 'panels_node_autocomplete',
    'file' => 'includes/callbacks.inc',
  ) + $base;

  // For context add/configure calls in common-context.inc
  $items['panels/ajax/context-add'] = array(
    'page callback' => 'panels_ajax_context_item_add',
    'file' => 'includes/common-context.inc',
  ) + $base;
  $items['panels/ajax/context-configure'] = array(
    'page callback' => 'panels_ajax_context_item_edit',
    'file' => 'includes/common-context.inc',
  ) + $base;
  $items['panels/ajax/context-delete'] = array(
    'page callback' => 'panels_ajax_context_item_delete',
    'file' => 'includes/common-context.inc',
  ) + $base;

  // Provide a nice location for a panels admin panel.
  $items['admin/panels'] = array(
    'title' => 'Panels',
    'access arguments' => array(
      'access administration pages',
    ),
    'page callback' => 'panels_admin_page',
    'file' => 'includes/callbacks.inc',
    'description' => 'Administer items related to the Panels module.',
  );
  return $items;
}