3 * FusionForge Documentation Manager
5 * Copyright 2000, Quentin Cregan/Sourceforge
6 * Copyright 2002-2003, Tim Perdue/GForge, LLC
7 * Copyright 2010, Franck Villaume
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
22 * along with FusionForge; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 require_once('../env.inc.php');
27 require_once ('include/pre.php');
28 require_once ('docman/Document.class.php');
29 require_once ('docman/DocumentFactory.class.php');
30 require_once ('docman/DocumentGroup.class.php');
31 require_once ('docman/DocumentGroupFactory.class.php');
32 require_once ('docman/include/DocumentGroupHTML.class.php');
33 require_once ('docman/include/utils.php');
34 require_once ('include/TextSanitizer.class.php'); // to make the HTML input by the user safe to store
36 /* are we using docman ? */
37 if (!forge_get_config('use_docman'))
40 /* get informations from request or $_POST */
41 $group_id = getIntFromRequest('group_id');
42 $feedback = getStringFromRequest('feedback');
48 $g =& group_get_object($group_id);
49 if (!$g || !is_object($g) || $g->isError()) {
53 /* is this group using docman ? */
54 if (!$g->usesDocman())
55 exit_error(_('Error'),_('This project has turned off the Doc Manager.'));
57 $dirid = getIntFromRequest('dirid');
61 $df = new DocumentFactory($g);
63 exit_error(_('Error'),$df->getErrorMessage());
65 $dgf = new DocumentGroupFactory($g);
67 exit_error(_('Error'),$dgf->getErrorMessage());
69 $nested_groups =& $dgf->getNested();
71 $dgh = new DocumentGroupHTML($g);
74 exit_error('Error',$dgh->getErrorMessage());
76 $d_arr =& $df->getDocuments();
77 if (!$d_arr || count($d_arr) <1)
78 $d_arr = &$df->getDocuments();
80 /* everything sounds ok, now let do the job */
81 $action = getStringFromRequest('action');
84 case "addsubdocgroup":
88 case "forcereindexenginesearch":
92 case "updateenginesearch":
93 include ("docman/actions/$action.php");
97 $title = _('Document Manager: Display Document');
99 site_project_header(array('title'=>$title,'group'=>$group_id,'toptab'=>'docman'));
101 echo '<div style="float:left; width:20%;">';
102 include('docman/views/tree.php');
105 echo '<div style="float:right; width:78%;">';
106 include('docman/views/menu.php');
107 include('docman/views/views.php');
110 echo '<div style="clear:both; margin-bottom:5px;" />';
111 site_project_footer(array());