2 /************************************************************************/
\r
4 /************************************************************************/
\r
5 /* Copyright (c) 2010 */
\r
6 /* Inclusive Design Institute */
\r
8 /* This program is free software. You can redistribute it and/or */
\r
9 /* modify it under the terms of the GNU General Public License */
\r
10 /* as published by the Free Software Foundation. */
\r
11 /************************************************************************/
\r
13 define('TR_INCLUDE_PATH', '../include/');
\r
14 include(TR_INCLUDE_PATH.'vitals.inc.php');
\r
15 include_once(TR_INCLUDE_PATH.'handbook_pages.inc.php');
\r
16 include_once(TR_INCLUDE_PATH.'classes/DAO/LanguageTextDAO.class.php');
\r
19 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict //EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
\r
20 <html lang="<?php if ($missing_lang) { echo DEFAULT_LANGUAGE_CODE; } else { echo $req_lang; } ?>">
\r
22 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
\r
23 <title><?php echo _AT('Transformable_documentation'); ?></title>
\r
24 <base target="body" />
\r
26 body { font-family: Verdana,Arial,sans-serif; font-size: x-small; margin: 0px; padding: 0px; background: #fafafa; margin-left: -5px; }
\r
27 ul, ol { list-style: none; padding-left: 0px; margin-left: -15px; }
\r
28 li { margin-left: 19pt; padding-top: 2px; }
\r
29 a { background-repeat: no-repeat; background-position: 0px 1px; padding-left: 12px; text-decoration: none; }
\r
30 a.tree { background-image: url('../images/folder.gif'); }
\r
31 a.leaf { background-image: url('../images/paper.gif'); }
\r
32 a:link, a:visited { color: #006699; }
\r
33 a:hover { color: #66AECC; }
\r
38 echo '<a href="frame_toc.php" target="_self">';
\r
39 echo _AT('back_to_contents');
\r
42 if ($_GET['query']) {
\r
43 $_GET['query'] = str_replace(',', ' ', $_GET['query']);
\r
44 $_GET['query'] = str_replace('"', '', $_GET['query']);
\r
46 if (strlen($_GET['query']) > 3) {
\r
47 $_GET['query'] = strtolower($_GET['query']);
\r
49 $search_terms = explode(' ', $_GET['query']);
\r
53 $languageTextDAO = new LanguageTextDAO();
\r
55 $final_match_rows = array();
\r
56 foreach ($search_terms as $term)
\r
58 $match_rows = $languageTextDAO->getHelpByMatchingText($addslashes($term), $_SESSION['lang']);
\r
60 if (is_array($match_rows)) $final_match_rows = array_merge($final_match_rows, $match_rows);
\r
63 if (is_array($final_match_rows))
\r
65 foreach ($final_match_rows as $match)
\r
67 if (is_array($result))
\r
68 $all_match_terms = array_keys($result);
\r
70 $all_match_terms = array();
\r
72 if (!in_array($match['term'], $all_match_terms))
\r
76 $contents = strtolower($match['text']);
\r
78 foreach ($search_terms as $term)
\r
80 $term = trim($term);
\r
82 $count += substr_count($contents, $term);
\r
88 $results[$match['term']] = $count;
\r
94 // replace term in match array with script name
\r
100 foreach ($results as $term => $count)
\r
102 foreach ($_pages as $this_page => $page_def)
\r
104 if (strcmp($page_def['guide'], $term) == 0)
\r
105 echo '<li><a href="frame_content.php?p='.$this_page.'" class="leaf" target="body">'._AT($page_def['title_var']).'</a></li>';
\r
111 echo '<p style="padding: 8px;">';
\r
112 echo _AT('no_results_found');
\r
116 echo '<p style="padding: 8px;">';
\r
117 echo _AT('search_term_longer_3_chars');
\r