[ Index ] |
PHP Cross Reference of Eventum |
[Summary view] [Print] [Text view]
1 <?php 2 /* vim: set expandtab tabstop=4 shiftwidth=4 encoding=utf-8: */ 3 // +----------------------------------------------------------------------+ 4 // | Eventum - Issue Tracking System | 5 // +----------------------------------------------------------------------+ 6 // | Copyright (c) 2003, 2004, 2005, 2006, 2007 MySQL AB | 7 // | | 8 // | This program is free software; you can redistribute it and/or modify | 9 // | it under the terms of the GNU General Public License as published by | 10 // | the Free Software Foundation; either version 2 of the License, or | 11 // | (at your option) any later version. | 12 // | | 13 // | This program is distributed in the hope that it will be useful, | 14 // | but WITHOUT ANY WARRANTY; without even the implied warranty of | 15 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 16 // | GNU General Public License for more details. | 17 // | | 18 // | You should have received a copy of the GNU General Public License | 19 // | along with this program; if not, write to: | 20 // | | 21 // | Free Software Foundation, Inc. | 22 // | 59 Temple Place - Suite 330 | 23 // | Boston, MA 02111-1307, USA. | 24 // +----------------------------------------------------------------------+ 25 // | Authors: João Prado Maia <jpm@mysql.com> | 26 // +----------------------------------------------------------------------+ 27 // 28 // @(#) $Id: class.help.php 3246 2007-02-09 09:10:12Z glen $ 29 // 30 31 require_once (APP_INC_PATH . "class.error_handler.php"); 32 33 $topics = array( 34 "main" => array( 35 "title" => ev_gettext("Help Topics"), 36 "parent" => "" 37 ), 38 "report" => array( 39 "title" => ev_gettext("Reporting Issues"), 40 "parent" => "main" 41 ), 42 "report_category" => array( 43 "title" => ev_gettext("Category Field"), 44 "parent" => "report" 45 ), 46 "report_priority" => array( 47 "title" => ev_gettext("Priority Field"), 48 "parent" => "report" 49 ), 50 "report_assignment" => array( 51 "title" => ev_gettext("Assignment Field"), 52 "parent" => "report" 53 ), 54 "report_release" => array( 55 "title" => ev_gettext("Scheduled Release Field"), 56 "parent" => "report" 57 ), 58 "report_summary" => array( 59 "title" => ev_gettext("Summary Field"), 60 "parent" => "report" 61 ), 62 "report_description" => array( 63 "title" => ev_gettext("Description Field"), 64 "parent" => "report" 65 ), 66 "report_estimated_dev_time" => array( 67 "title" => ev_gettext("Estimated Development Time Field"), 68 "parent" => "report" 69 ), 70 "scm_integration" => array( 71 "title" => ev_gettext("SCM Integration"), 72 "parent" => "main" 73 ), 74 "scm_integration_usage" => array( 75 "title" => ev_gettext("Usage Examples"), 76 "parent" => "scm_integration" 77 ), 78 "scm_integration_installation" => array( 79 "title" => ev_gettext("Installation Instructions"), 80 "parent" => "scm_integration" 81 ), 82 "list" => array( 83 "title" => ev_gettext("Listing / Searching for Issues"), 84 "parent" => "main" 85 ), 86 "adv_search" => array( 87 "title" => ev_gettext("Advanced Search / Creating Custom Queries"), 88 "parent" => "main" 89 ), 90 "support_emails" => array( 91 "title" => ev_gettext("Associate Emails"), 92 "parent" => "main" 93 ), 94 "preferences" => array( 95 "title" => ev_gettext("Account Preferences"), 96 "parent" => "main" 97 ), 98 "notifications" => array( 99 "title" => ev_gettext("Email Notifications"), 100 "parent" => "main" 101 ), 102 "view" => array( 103 "title" => ev_gettext("Viewing Issues"), 104 "parent" => "main" 105 ), 106 "email_blocking" => array( 107 "title" => ev_gettext("Email Blocking"), 108 "parent" => "main" 109 ), 110 "link_filters" => array( 111 "title" => ev_gettext("Link Filters"), 112 "parent" => "main" 113 ), 114 "field_display" => array( 115 "title" => ev_gettext("Edit Fields to Display"), 116 "parent" => "main" 117 ), 118 "column_display" => array( 119 "title" => ev_gettext("Edit Columns to Display"), 120 "parent" => "main" 121 ), 122 "customize_listing" => array( 123 "title" => ev_gettext("Customize Issue Listing Screen"), 124 "parent" => "main" 125 ), 126 "segregate_reporter" => array( 127 "title" => ev_gettext("Segregate Reporters"), 128 "parent" => "main" 129 ), 130 "permission_levels" => array( 131 "title" => ev_gettext("User Permission Levels"), 132 "parent" => "main" 133 ), 134 ); 135 136 /** 137 * Class to handle the business logic related to the help 138 * documentation, such as providing a dynamic list of topics related 139 * to the current topic and such. 140 * 141 * @version 1.0 142 * @author João Prado Maia <jpm@mysql.com> 143 */ 144 145 class Help 146 { 147 /** 148 * Method used to check whether a specific topic exists or not. 149 * This is mainly used in the help documentation main page to see 150 * if a requested topic exists, and to show a default one 151 * otherwise. 152 * 153 * @access public 154 * @param string $topic The topic title to check for 155 * @return boolean Whether the topic exists or not 156 */ 157 function topicExists($topic) 158 { 159 global $topics; 160 161 if (isset($topics[$topic])) { 162 return true; 163 } else { 164 return false; 165 } 166 } 167 168 169 /** 170 * Method used to get the parent help documentation topic 171 * associated with a specific topic title. 172 * 173 * @access public 174 * @param string $topic The topic title 175 * @return array The information related to the parent help topic 176 */ 177 function getParent($topic) 178 { 179 global $topics; 180 181 $child = @$topics[$topic]; 182 if (empty($child["parent"])) { 183 return false; 184 } else { 185 return array( 186 "topic" => $child["parent"], 187 "title" => $topics[$child["parent"]]["title"] 188 ); 189 } 190 } 191 192 193 /** 194 * Method used to get all the help topics related to a specific 195 * 'parent' one. 196 * 197 * @access public 198 * @param string $topic The 'parent' help topic 199 * @return array The list of help topics 200 */ 201 function getChildLinks($topic) 202 { 203 global $topics; 204 205 $links = array(); 206 foreach ($topics as $child => $data) { 207 if ($data["parent"] == $topic) { 208 $links[] = array( 209 "topic" => $child, 210 "title" => $data["title"] 211 ); 212 } 213 } 214 if (count($links) == 0) { 215 return ""; 216 } else { 217 return $links; 218 } 219 } 220 221 222 /** 223 * Method used to get all of the navigation links related to a 224 * specific help topic. 225 * 226 * @access public 227 * @param string $topic The topic title 228 * @return array The list of navigation links 229 */ 230 function getNavigationLinks($topic) 231 { 232 global $topics; 233 234 $links = array(); 235 $links[] = @array( 236 "topic" => "", 237 "title" => $topics[$topic]["title"] 238 ); 239 while ($parent = Help::getParent($topic)) { 240 $links[] = array( 241 "topic" => $parent["topic"], 242 "title" => $parent["title"] 243 ); 244 $topic = $parent["topic"]; 245 } 246 $links = array_reverse($links); 247 return $links; 248 } 249 } 250 251 // benchmarking the included file (aka setup time) 252 if (APP_BENCHMARK) { 253 $GLOBALS['bench']->setMarker('Included Help Class'); 254 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Wed Dec 19 21:21:33 2007 | Cross-referenced by PHPXref 0.7 |