3 * FusionForge extratabs plugin
5 * Copyright 2005, Raphaƫl Hertzog
6 * Copyright 2009, Roland Mas
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
12 * by the Free Software Foundation; either version 2 of the License,
13 * or (at your option) any later version.
15 * FusionForge is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with FusionForge; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
26 class ExtraTabsPlugin extends Plugin {
27 function ExtraTabsPlugin () {
29 $this->name = "extratabs" ;
30 $this->text = "Extra tabs";
31 $this->hooks[] = "project_admin_plugins" ;
32 $this->hooks[] = "groupmenu" ; // To put into the project tabs
35 function CallHook ($hookname, $params) {
38 if ($hookname == "project_admin_plugins") {
39 $group_id=$params['group_id'];
40 echo '<p>'.util_make_link ('/plugins/extratabs/index.php?group_id='.$group_id,
41 _('Extra tabs')).'</p>';
42 } elseif ($hookname == "groupmenu") {
43 $group_id=$params['group'];
44 $project = &group_get_object($group_id);
45 if (!$project || !is_object($project))
47 if ($project->isError())
49 if (!$project->isProject())
51 $res_tabs = db_query_params ('SELECT tab_name, tab_url FROM plugin_extratabs_main WHERE group_id=$1 ORDER BY index',
53 while ($row_tab = db_fetch_array($res_tabs)) {
54 $params['DIRS'][] = $row_tab['tab_url'];
55 $params['TITLES'][] = $row_tab['tab_name'];
63 // c-file-style: "bsd"