4 * online_helpPlugin Class
6 * Copyright 2008 Alain Peyrat <aljeux@free.fr>
8 * This file is part of FusionForge.
10 * FusionForge is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * FusionForge is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License along
21 * with this program; if not, write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 * This plugin adds a contextual online doc to GForge by adding a link 'Get Help'
27 * on top of the page (near the login/logout links).
28 * Documentation is based on the docbook manual converted in chunked HTML.
31 class online_helpPlugin extends Plugin {
33 function online_helpPlugin () {
35 $this->name = "online_help" ;
36 $this->text = "online_help!" ; // To show in the tabs, use...
37 $this->hooks[] = "headermenu"; // to show up in the admin page fro group
40 function CallHook ($hookname, &$params) {
41 global $G_SESSION,$HTML;
42 if ($hookname == "headermenu") {
43 $guide = util_make_url('/plugins/online_help/');
46 'user' => 'ug_user.html',
47 'login' => 'ug_getting_started_login.html',
48 'trove' => 'ug_sitewide_trove.html',
49 'snippet' => 'ug_sitewide_snippet.html',
50 'people' => 'ug_sitewide_project_help.html',
51 'home' => 'ug_project.html',
52 'admin' => 'ug_project_project_admin.html',
53 'activity' => 'ug_project_activity.html',
54 'forums' => 'ug_project_forums.html',
55 'tracker' => 'ug_project_tracker.html',
56 'mail' => 'ug_project_mailing_lists.html',
57 'pm' => 'ug_project_task_manager.html',
58 'docman' => 'ug_project_docman.html',
59 'surveys' => 'ug_project_surveys.html',
60 'news' => 'ug_project_news.html',
61 'scm' => 'ug_project_subversion.html',
62 'frs' => 'ug_project_file_releases.html',
63 'wiki' => 'ug_project_wiki.html',
66 if (strstr($_SERVER['REQUEST_URI'],'softwaremap')) {
67 $guide .= $user_guide['trove'];
68 } elseif (strstr($_SERVER['REQUEST_URI'],'/my/')) {
69 $guide .= $user_guide['user'];
70 } elseif (strstr($_SERVER['REQUEST_URI'],'/account/login.php')) {
71 $guide .= $user_guide['login'];
72 } elseif (strstr($_SERVER['REQUEST_URI'],'/account/')) {
73 $guide .= $user_guide['user'];
74 } elseif (strstr($_SERVER['REQUEST_URI'],'/snippet/')) {
75 $guide .= $user_guide['snippet'];
76 } elseif (strstr($_SERVER['REQUEST_URI'],'/people/')) {
77 $guide .= $user_guide['people'];
78 } elseif (isset($params['toptab']) && isset($user_guide[ $params['toptab'] ])) {
79 $guide .= $user_guide[ $params['toptab'] ];
81 $guide .= 'index.html';
84 $guide = '<a href="javascript:help_window(\''.$guide.'\')">'._('Get Help').'</a>';
86 $template = isset($params['template']) ? $params['template'] : ' | {menu}';
87 echo str_replace('{menu}', $guide, $template);
94 // c-file-style: "bsd"