book_link
modules/book/book.module, строка 59
- Версии
- 5 – 6
book_link($type, $node = NULL, $teaser = FALSE)
Реализация hook_link()
.
Код
<?php
function book_link($type, $node = NULL, $teaser = FALSE) {
$links = array();
if ($type == 'node' && isset($node->parent)) {
if (!$teaser) {
if (book_access('create', $node) && $node->status == 1) {
$links['book_add_child'] = array(
'title' => t('Add child page'),
'href' => "node/add/book/parent/$node->nid"
);
}
if (user_access('see printer-friendly version')) {
$links['book_printer'] = array(
'title' => t('Printer-friendly version'),
'href' => 'book/export/html/'. $node->nid,
'attributes' => array('title' => t('Show a printer-friendly version of this book page and its sub-pages.'))
);
}
}
}
return $links;
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии