451f93dbe370364ddd7a4173b5d47afb2da4d281
[acontent.git] / docs / documentation / print.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 global $handbook_pages, $_pages;
18
19 if (isset($_GET['p'])) {
20         $this_page = htmlentities($_GET['p']);
21 } else {
22         $this_page = 'index.php';
23
24
25 function print_handbook($handbook_pages)
26 {
27         global $_pages;
28         
29         foreach ($handbook_pages as $page_key => $page_value) 
30         {
31                 if (is_array($page_value)) 
32                 {
33                         if (isset($_pages[$page_key]))
34                         {
35                                 echo _AT($_pages[$page_key]['guide'])."<br /><br />";
36                                 print_handbook($page_value);
37                         }
38                 } 
39                 else if (isset($_pages[$page_value]))
40                 {
41                         echo _AT($_pages[$page_value]['guide'])."<br /><br />";
42                 }
43         }
44 }
45 ?>
46 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict //EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
47 <html lang="<?php echo DEFAULT_LANGUAGE_CODE; ?>">
48 <head>
49         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
50         <title><?php echo _AT('doc_title'); ?></title>
51         <link rel="stylesheet" href="styles.css" type="text/css" />
52 </head>
53 <body>
54
55 <a href="index.php?p=<?php echo $this_page; ?>"><?php echo _AT('back_to_chapters'); ?></a><br /><br />
56
57 <?php print_handbook($handbook_pages); ?>
58 </body>
59 </html>