0b1de0c40ffcf0e8d4bfbfb5b99e885d4253ddaf
[acontent.git] / docs / documentation / frame_toc.php
1 <?php
2 /************************************************************************/
3 /* AContent                                                             */
4 /************************************************************************/
5 /* Copyright (c) 2010                                                   */
6 /* Inclusive Design Institute                                           */
7 /*                                                                      */
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 /************************************************************************/
12
13 define('TR_INCLUDE_PATH', '../include/');
14 include(TR_INCLUDE_PATH.'vitals.inc.php');
15 include(TR_INCLUDE_PATH.'handbook_pages.inc.php');
16
17 /**
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.
22  */
23 function hb_print_toc($handbook_pages) {
24         global $_pages;
25         echo '<ul id="handbook-toc">';
26         foreach ($handbook_pages as $page_key => $page_value) {
27                 echo '<li>';
28                 if (is_array($page_value)) 
29                 {
30                         if (isset($_pages[$page_key]))
31                         {
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);
34                         }
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>';
37                 }
38                 echo '</li>';
39         }
40         echo '</ul>';
41 }
42 ?>
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; } ?>">
45 <head>
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; }
58 </style>
59
60 <script type="text/javascript">
61 // <!--
62 function highlight(page) {
63         if (page == false) {
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';
69                 }
70         } else {
71                 if (parent.header.currentPage) {
72                         var toc = parent.toc.document.getElementById(parent.header.currentPage);
73                         toc.style.color = '';
74                         toc.style.fontWeight = '';
75                 }
76         
77                 var toc = parent.toc.document.getElementById(page);
78                 toc.style.color = 'blue';
79                 toc.style.fontWeight = 'bold';
80                 parent.header.currentPage = page;
81         }
82 }
83 // -->
84 </script>
85 </head>
86 <body onload="">
87 <?php
88 global $handbook_pages;
89
90 hb_print_toc($handbook_pages);
91 ?>
92
93 </body>
94 </html>