function panelizer_admin_hook_menu in Panelizer 7.3
Same name and namespace in other branches
- 7.2 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/structure/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/structure/panelizer/%panelizer_handler/%/allowed'] = array(
'title' => 'Allowed content',
'page callback' => 'panelizer_allowed_content_page',
'page arguments' => array(
3,
4,
),
'type' => MENU_CALLBACK,
'weight' => -10,
) + $settings_base;
$tabs_base = array(
'access callback' => 'panelizer_has_no_choice_callback',
'access arguments' => array(
3,
4,
),
'page arguments' => array(
3,
4,
'default',
'',
),
'type' => MENU_LOCAL_TASK,
'file' => 'includes/admin.inc',
);
$items['admin/structure/panelizer/%panelizer_handler/%'] = array(
'title callback' => 'panelizer_default_title_callback',
'title arguments' => array(
3,
4,
),
'title' => 'Settings',
'page callback' => 'panelizer_default_settings_page',
'weight' => -5,
'type' => MENU_SUGGESTED_ITEM,
) + $tabs_base;
$index = 0;
foreach (panelizer_operations() as $path => $operation) {
$items['admin/structure/panelizer/%panelizer_handler/%/' . $path] = array(
'title' => $operation['menu title'],
'page callback' => $operation['admin callback'],
'weight' => $index - 5,
'type' => $index === 0 ? MENU_DEFAULT_LOCAL_TASK : MENU_LOCAL_TASK,
) + $tabs_base;
if (isset($operation['file'])) {
$items['admin/structure/panelizer/%panelizer_handler/%/' . $path]['file'] = $operation['file'];
}
if (isset($operation['file path'])) {
$items['admin/structure/panelizer/%panelizer_handler/%/' . $path]['file path'] = $operation['file path'];
}
$index++;
}
$subtabs_base = array(
'access callback' => 'panelizer_administer_panelizer_default',
'access arguments' => array(
3,
4,
6,
),
'page arguments' => array(
3,
4,
6,
'',
),
'type' => MENU_LOCAL_TASK,
'file' => 'includes/admin.inc',
);
$items['admin/structure/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;
$index = 0;
foreach (panelizer_operations() as $path => $operation) {
$items['admin/structure/panelizer/%panelizer_handler/%/list/%/' . $path] = array(
'title' => $operation['menu title'],
'page callback' => $operation['admin callback'],
'weight' => $index - 5,
) + $subtabs_base;
if (isset($operation['file'])) {
$items['admin/structure/panelizer/%panelizer_handler/%/list/%/' . $path]['file'] = $operation['file'];
}
if (isset($operation['file path'])) {
$items['admin/structure/panelizer/%panelizer_handler/%/list/%/' . $path]['file path'] = $operation['file path'];
}
$index++;
}
$items['admin/structure/panelizer/%panelizer_handler/%/list/%/access'] = array(
'title' => 'Access',
'page callback' => 'panelizer_default_access_page',
'weight' => -2,
) + $subtabs_base;
}