function _panels_page_create_menu_item in Panels 5.2
Create a menu item for a panel page.
1 call to _panels_page_create_menu_item()
- panels_page_menu in panels_page/
panels_page.module - Implementation of hook_menu().
File
- panels_page/
panels_page.module, line 357 - panels_page.module
Code
function _panels_page_create_menu_item(&$items, $panel_page, $path, $args = array()) {
$access = panels_page_access($panel_page);
$title = filter_xss_admin(panels_page_get_title($panel_page, 'menu'));
$type = _panels_page_menu_type($panel_page);
if ($type == MENU_LOCAL_TASK || $type == MENU_DEFAULT_LOCAL_TASK) {
$weight = $panel_page->menu_tab_weight;
}
$items[] = _panels_page_menu_item($path, $title, $panel_page, $args, $access, $type, isset($weight) ? $weight : NULL);
if ($type == MENU_DEFAULT_LOCAL_TASK && dirname($path) && dirname($path) != '.') {
switch ($panel_page->menu_tab_default_parent_type) {
case 'tab':
$parent_type = MENU_LOCAL_TASK;
break;
case 'normal':
$parent_type = MENU_NORMAL_ITEM;
break;
default:
case 'existing':
$parent_type = 0;
break;
}
if ($parent_type) {
$title = filter_xss_admin(panels_page_get_title($panel_page, 'menu-parent'));
$weight = $panel_page->menu_parent_tab_weight;
$items[] = _panels_page_menu_item(dirname($path), $title, $panel_page, $args, $access, $parent_type, $weight);
}
}
}