You are here

function panelizer_admin_hook_menu in Panelizer 7.2

Same name and namespace in other branches
  1. 7.3 includes/admin.inc \panelizer_admin_hook_menu()

Delegated hook_menu for admin

Since most of hook_menu is delegated to plugins anyway, the admin menu is delegated here to reduce code weight.

1 call to panelizer_admin_hook_menu()
panelizer_menu in ./panelizer.module
Implements hook_menu().

File

includes/admin.inc, line 13
Contains administrative forms and settings.

Code

function panelizer_admin_hook_menu(&$items) {

  // Configure settings pages.
  $settings_base = array(
    'access arguments' => array(
      'administer panelizer',
    ),
    'file' => 'includes/admin.inc',
  );
  $items['admin/config/content/panelizer'] = array(
    'title' => 'Panelizer',
    'description' => 'Configure panelizer availability and defaults',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'panelizer_settings_page_form',
    ),
    'type' => MENU_NORMAL_ITEM,
  ) + $settings_base;
  $items['admin/config/content/panelizer/%panelizer_handler/%'] = array(
    'title callback' => 'panelizer_default_title_callback',
    'title arguments' => array(
      4,
      5,
    ),
    'page callback' => 'panelizer_allowed_content_page',
    'page arguments' => array(
      4,
      5,
    ),
    'type' => MENU_CALLBACK,
  ) + $settings_base;
  $items['admin/config/content/panelizer/%panelizer_handler/%/allowed'] = array(
    'title' => 'Available content',
    'page callback' => 'panelizer_allowed_content_page',
    'page arguments' => array(
      4,
      5,
    ),
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  ) + $settings_base;
  $tabs_base = array(
    'access callback' => 'panelizer_has_no_choice_callback',
    'access arguments' => array(
      4,
      5,
    ),
    'page arguments' => array(
      4,
      5,
      'default',
    ),
    'type' => MENU_LOCAL_TASK,
    'file' => 'includes/admin.inc',
  );
  $items['admin/config/content/panelizer/%panelizer_handler/%/settings'] = array(
    'title' => 'Settings',
    'page callback' => 'panelizer_default_settings_page',
    'weight' => -5,
  ) + $tabs_base;
  $items['admin/config/content/panelizer/%panelizer_handler/%/context'] = array(
    'title' => 'Contexts',
    'page callback' => 'panelizer_default_context_page',
    'weight' => -4,
  ) + $tabs_base;
  $items['admin/config/content/panelizer/%panelizer_handler/%/layout'] = array(
    'title' => 'Layout',
    'page callback' => 'panelizer_default_layout_page',
    'weight' => -3,
  ) + $tabs_base;
  $items['admin/config/content/panelizer/%panelizer_handler/%/content'] = array(
    'title' => 'Content',
    'page callback' => 'panelizer_default_content_page',
    'weight' => -2,
  ) + $tabs_base;
  $subtabs_base = array(
    'access callback' => 'panelizer_administer_panelizer_default',
    'access arguments' => array(
      4,
      5,
      7,
    ),
    'page arguments' => array(
      4,
      5,
      7,
    ),
    'type' => MENU_LOCAL_TASK,
    'file' => 'includes/admin.inc',
  );
  $items['admin/config/content/panelizer/%panelizer_handler/%/list/%'] = array(
    'title' => 'Settings',
    'page callback' => 'panelizer_default_settings_page',
    'title callback' => 'panelizer_default_name_title_callback',
    'type' => MENU_CALLBACK,
  ) + $subtabs_base;
  $items['admin/config/content/panelizer/%panelizer_handler/%/list/%/settings'] = array(
    'title' => 'Settings',
    'page callback' => 'panelizer_default_settings_page',
    'weight' => -5,
  ) + $subtabs_base;
  $items['admin/config/content/panelizer/%panelizer_handler/%/list/%/context'] = array(
    'title' => 'Contexts',
    'page callback' => 'panelizer_default_context_page',
    'weight' => -4,
  ) + $subtabs_base;
  $items['admin/config/content/panelizer/%panelizer_handler/%/list/%/layout'] = array(
    'title' => 'Layout',
    'page callback' => 'panelizer_default_layout_page',
    'weight' => -3,
  ) + $subtabs_base;
  $items['admin/config/content/panelizer/%panelizer_handler/%/list/%/content'] = array(
    'title' => 'Content',
    'page callback' => 'panelizer_default_content_page',
    'weight' => -2,
  ) + $subtabs_base;
  $items['admin/config/content/panelizer/%panelizer_handler/%/list/%/access'] = array(
    'title' => 'Access',
    'page callback' => 'panelizer_default_access_page',
    'weight' => -2,
  ) + $subtabs_base;
}