4 * online_helpPlugin Class
6 * Copyright 2008 Alain Peyrat <aljeux@free.fr>
7 * Copyright (C) 2012 Alain Peyrat - Alcatel-Lucent
8 * Copyright 2014, Franck Villaume - TrivialDev
10 * This file is part of FusionForge.
12 * FusionForge is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * FusionForge is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License along
23 * with this program; if not, write to the Free Software Foundation, Inc.,
24 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
28 * This plugin adds a contextual online doc to GForge by adding a link 'Get Help'
29 * on top of the page (near the login/logout links).
30 * Documentation is based on the docbook manual converted in chunked HTML.
33 class online_helpPlugin extends Plugin {
35 function __construct() {
37 $this->name = "online_help" ;
38 $this->text = "online_help!" ; // To show in the tabs, use...
39 $this->hooks[] = "headermenu"; // to show up in the admin page fro group
42 function headermenu($params) {
43 $guide = util_make_uri('/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 $uri = getStringFromServer('REQUEST_URI');
68 if (strstr($uri,'softwaremap')) {
69 $guide .= $user_guide['trove'];
70 } elseif (strstr($uri,'/my/')) {
71 $guide .= $user_guide['user'];
72 } elseif (strstr($uri,'/account/login.php')) {
73 $guide .= $user_guide['login'];
74 } elseif (strstr($uri,'/account/')) {
75 $guide .= $user_guide['user'];
76 } elseif (strstr($uri,'/snippet/')) {
77 $guide .= $user_guide['snippet'];
78 } elseif (strstr($uri,'/people/')) {
79 $guide .= $user_guide['people'];
80 } elseif (isset($params['toptab']) && isset($user_guide[ $params['toptab'] ])) {
81 $guide .= $user_guide[ $params['toptab'] ];
83 $guide .= 'index.html';
86 $params['links'][] = util_make_link('javascript:help_window(\''.$guide.'\')', _('Get Help'), array(), true);
92 // c-file-style: "bsd"