2 /************************************************************************/
4 /************************************************************************/
5 /* Copyright (c) 2010 */
6 /* Inclusive Design Institute */
8 /* This program is free software. You can redistribute it and/or */
9 /* modify it under the terms of the GNU General Public License */
10 /* as published by the Free Software Foundation. */
11 /************************************************************************/
13 define('TR_INCLUDE_PATH', '../include/');
14 include(TR_INCLUDE_PATH.'vitals.inc.php');
15 include(TR_INCLUDE_PATH.'handbook_pages.inc.php');
18 * handbook toc printer
19 * prints an unordered html list representation of the multidimensional array.
20 * $handbook_pages the array of items to print.
21 * $section the directory name of the files.
23 function hb_print_toc($handbook_pages) {
25 echo '<ul id="handbook-toc">';
26 foreach ($handbook_pages as $page_key => $page_value) {
28 if (is_array($page_value))
30 if (isset($_pages[$page_key]))
32 echo '<a href="frame_content.php?p='.$page_key.'" id="id'.$page_key.'" class="tree">'._AT($_pages[$page_key]['title_var']).'</a>';
33 hb_print_toc($page_value);
35 } else if (isset($_pages[$page_value])){
36 echo '<a href="frame_content.php?p='.$page_value.'" id="id'.$page_value.'" class="leaf">'._AT($_pages[$page_value]['title_var']).'</a>';
43 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict //EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
44 <html lang="<?php if ($missing_lang) { echo DEFAULT_LANGUAGE_CODE; } else { echo $req_lang; } ?>">
46 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
47 <title><?php _AT('handbook_toc'); ?></title>
48 <base target="body" />
49 <style type="text/css">
50 body { font-family: Verdana,Arial,sans-serif; font-size: x-small; margin: 0px; padding: 0px; background: #f4f4f4; margin-left: -5px; }
51 ul { list-style: none; padding-left: 0px; margin-left: -15px; }
52 li { margin-left: 19pt; padding-top: 2px;vertical-align:text-bottom; }
53 a { background-repeat: no-repeat; background-position: 0px 1px; padding-left: 12px; text-decoration: none; }
54 a.tree { background-image: url('../images/folder_open.png'); background-position:-1px -2px;text-align:center; line-height:1em; }
55 a.leaf { background-image: url('../images/paper.gif'); }
56 a:link, a:visited { color: #006699; }
57 a:hover { color: #66AECC; }
60 <script type="text/javascript">
62 function highlight(page) {
64 alert(parent.header.currentPage);
65 if (parent.header.currentPage) {
66 var toc = parent.toc.document.getElementById(parent.header.currentPage);
67 toc.style.color = 'blue';
68 toc.style.fontWeight = 'bold';
71 if (parent.header.currentPage) {
72 var toc = parent.toc.document.getElementById(parent.header.currentPage);
74 toc.style.fontWeight = '';
77 var toc = parent.toc.document.getElementById(page);
78 toc.style.color = 'blue';
79 toc.style.fontWeight = 'bold';
80 parent.header.currentPage = page;
88 global $handbook_pages;
90 hb_print_toc($handbook_pages);