3 * FusionForge Documentation Manager
5 * Copyright 1999-2001, VA Linux Systems
6 * Copyright 2000, Quentin Cregan/SourceForge
7 * Copyright 2002-2004, GForge Team
8 * Copyright 2010-2011, Franck Villaume - Capgemini
9 * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
10 * http://fusionforge.org
12 * This file is part of FusionForge. FusionForge is free software;
13 * you can redistribute it and/or modify it under the terms of the
14 * GNU General Public License as published by the Free Software
15 * Foundation; either version 2 of the Licence, or (at your option)
18 * FusionForge is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License along
24 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
25 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
28 /* please do not add require here : use www/docman/index.php to add require */
29 /* global variables used */
30 global $HTML; // html object
31 global $d_arr; // document array
32 global $group_id; // id of group
34 if (!forge_check_perm('docman', $group_id, 'read')) {
35 $return_msg= _('Document Manager Access Denied');
36 session_redirect('/docman/?group_id='.$group_id.'&warning_msg='.urlencode($return_msg));
39 /* create the submenu following role, rules and content */
41 $menu_links = array();
44 $menu_text[] = _('List files & Directories');
45 $menu_links[] = '/docman/?group_id='.$group_id.'&view=listfile&dirid=0';
46 $menu_attr[] = array('title' => _('View files and folders in 2 panels. Left a folder tree, right a list of files of selected folder.'), 'id' => 'listFileDocmanMenu', 'class' => 'tabtitle-nw');
48 if (forge_check_perm('docman', $group_id, 'submit')) {
49 $menu_text[] = _('Add new item');
50 $menu_links[] = '/docman/?group_id='.$group_id.'&view=additem';
51 $menu_attr[] = array('title' => _('Add a new item such as file, create directory, inject a zip at root level.'), 'id' => 'addItemDocmanMenu', 'class' => 'tabtitle');
54 if ($g->useDocmanSearch()) {
55 $menu_text[] = _('Search in documents');
56 $menu_links[] = '/docman/?group_id='.$group_id.'&view=search';
57 $menu_attr[] = array('title' => _('Search documents in this project using keywords.'), 'id' => 'searchDocmanMenu', 'class' => 'tabtitle');
60 if (forge_check_perm('docman', $group_id, 'approve')) {
61 $menu_text[] = _('Trash');
62 $menu_links[] = '/docman/?group_id='.$group_id.'&view=listtrashfile';
63 $menu_attr[] = array('title' => _('Recover or delete permanently files with deleted status.'), 'id' => 'trashDocmanMenu', 'class' => 'tabtitle');
66 if (forge_check_perm('docman', $group_id, 'admin')) {
67 $menu_text[] = _('Admin');
68 $menu_links[] = '/docman/?group_id='.$group_id.'&view=admin';
69 $menu_attr[] = array('title' => _('Docman module administration.'), 'id' => 'adminDocmanMenu', 'class' => 'tabtitle');
72 if (count($menu_text)) {
73 echo $HTML->subMenu($menu_text, $menu_links, $menu_attr);
76 plugin_hook("blocks", "doc index");