menu_get_local_tasks
includes/menu.inc, строка 236
- Версии
- 5
menu_get_local_tasks()
Return the local task tree.
Unlike the rest of the menu structure, the local task tree cannot be cached
nor determined too early in the page request, because the user's current
location may be changed by a menu_set_location()
call, and the tasks shown
(just as the breadcrumb trail) need to reflect the changed location.
Связанные темы
Код
<?php
function menu_get_local_tasks() {
global $_menu;
// Don't cache the local task tree, as it varies by location and tasks are
// allowed to be dynamically determined.
if (!isset($_menu['local tasks'])) {
// _menu_build_local_tasks() may indirectly call this function, so prevent
// infinite loops.
$_menu['local tasks'] = array();
$pid = menu_get_active_nontask_item();
if (!_menu_build_local_tasks($pid)) {
// If the build returned FALSE, the tasks need not be displayed.
$_menu['local tasks'][$pid]['children'] = array();
}
}
return $_menu['local tasks'];
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии