menu_get_active_breadcrumb
includes/menu.inc, строка 1577
- Версии
- 5 – 6
menu_get_active_breadcrumb()
Получает хлебные крошки для текущей страницы, определенные активным путем.
Связанные темы
Код
<?php
function menu_get_active_breadcrumb() {
$breadcrumb = array();
// No breadcrumb for the front page.
if (drupal_is_front_page()) {
return $breadcrumb;
}
$item = menu_get_item();
if ($item && $item['access']) {
$active_trail = menu_get_active_trail();
foreach ($active_trail as $parent) {
$breadcrumb[] = l($parent['title'], $parent['href'], $parent['localized_options']);
}
$end = end($active_trail);
// Don't show a link to the current page in the breadcrumb trail.
if ($item['href'] == $end['href'] || ($item['type'] == MENU_DEFAULT_LOCAL_TASK && $end['href'] != '<front>')) {
array_pop($breadcrumb);
}
}
return $breadcrumb;
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии