| 22 |
} |
} |
| 23 |
|
|
| 24 |
/** |
/** |
| 25 |
|
* Implementation of hook_nodeapi, used to set the active menu trail |
| 26 |
|
*/ |
| 27 |
|
function sympal_book_menu_nodeapi(&$node, $op, $teaser, $page) { |
| 28 |
|
if ($op == 'view' && !$teaser) { |
| 29 |
|
$book = db_fetch_array(db_query('SELECT * FROM {book} WHERE vid = %d', $node->vid)); |
| 30 |
|
if ($book) { |
| 31 |
|
$path = book_location($node); |
| 32 |
|
$node->breadcrumb = array(); |
| 33 |
|
$sympal_book_trail = 'book_menu'; |
| 34 |
|
foreach ($path as $level) { |
| 35 |
|
$sympal_book_trail .= '/'. $level->nid; |
| 36 |
|
$node->breadcrumb[] = array('path' => $sympal_book_trail, 'title' => $level->title); |
| 37 |
|
} |
| 38 |
|
if ($page) { |
| 39 |
|
menu_set_location($node->breadcrumb); |
| 40 |
|
menu_set_active_item($sympal_book_trail .'/'. $node->nid); |
| 41 |
|
} |
| 42 |
|
} |
| 43 |
|
} |
| 44 |
|
} |
| 45 |
|
|
| 46 |
|
/** |
| 47 |
* Grab the table of contents from the book, recurse into all children. |
* Grab the table of contents from the book, recurse into all children. |
| 48 |
*/ |
*/ |
| 49 |
function book_menu_toc() { |
function book_menu_toc() { |