book_build_active_trail
modules/book/book.module, строка 619
- Версии
- 6
book_build_active_trail($book_link)
Build an active trail to show in the breadcrumb.
Код
<?php
function book_build_active_trail($book_link) {
static $trail;
if (!isset($trail)) {
$trail = array();
$trail[] = array('title' => t('Home'), 'href' => '<front>', 'localized_options' => array());
$tree = menu_tree_all_data($book_link['menu_name'], $book_link);
$curr = array_shift($tree);
while ($curr) {
if ($curr['link']['href'] == $book_link['href']) {
$trail[] = $curr['link'];
$curr = FALSE;
}
else {
if ($curr['below'] && $curr['link']['in_active_trail']) {
$trail[] = $curr['link'];
$tree = $curr['below'];
}
$curr = array_shift($tree);
}
}
}
return $trail;
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии