4 * online_helpPlugin Class
6 * Copyright 2008 Alain Peyrat <aljeux@free.fr>
7 * Copyright (C) 2012 Alain Peyrat - Alcatel-Lucent
9 * This file is part of FusionForge.
11 * FusionForge is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * FusionForge is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License along
22 * with this program; if not, write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27 * This plugin adds a contextual online doc to GForge by adding a link 'Get Help'
28 * on top of the page (near the login/logout links).
29 * Documentation is based on the docbook manual converted in chunked HTML.
32 class online_helpPlugin extends Plugin {
34 function __construct() {
36 $this->name = "online_help" ;
37 $this->text = "online_help!" ; // To show in the tabs, use...
38 $this->hooks[] = "headermenu"; // to show up in the admin page fro group
41 function CallHook ($hookname, &$params) {
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"