3 * FusionForge Documentation Manager
5 * Copyright 2000, Quentin Cregan/Sourceforge
6 * Copyright 2002-2003, Tim Perdue/GForge, LLC
7 * Copyright 2010, Franck Villaume - Capgemini
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 $gfcommon.'include/pre.php';
28 require_once $gfcommon.'docman/Document.class.php';
29 require_once $gfcommon.'docman/DocumentFactory.class.php';
30 require_once $gfcommon.'docman/DocumentGroup.class.php';
31 require_once $gfcommon.'docman/DocumentGroupFactory.class.php';
32 require_once $gfcommon.'docman/include/DocumentGroupHTML.class.php';
33 require_once $gfcommon.'docman/include/utils.php';
34 require_once $gfcommon.'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'))
38 exit_disabled('home');
40 /* get informations from request or $_POST */
41 $group_id = getIntFromRequest('group_id');
42 $feedback = htmlspecialchars(getStringFromRequest('feedback'));
43 $error_msg = htmlspecialchars(getStringFromRequest('error_msg'));
44 $warning_msg = htmlspecialchars(getStringFromRequest('warning_msg'));
50 $g =& group_get_object($group_id);
51 if (!$g || !is_object($g))
54 /* is this group using docman ? */
55 if (!$g->usesDocman())
59 exit_error($g->getErrorMessage(),'docman');
61 $dirid = getIntFromRequest('dirid');
65 $df = new DocumentFactory($g);
67 exit_error($df->getErrorMessage(),'docman');
69 $dgf = new DocumentGroupFactory($g);
71 exit_error($dgf->getErrorMessage(),'docman');
73 $nested_groups = $dgf->getNested();
75 $dgh = new DocumentGroupHTML($g);
77 exit_error($dgh->getErrorMessage(),'docman');
79 $d_arr =& $df->getDocuments();
80 if (!$d_arr || count($d_arr) <1)
81 $d_arr = &$df->getDocuments();
83 /* everything sounds ok, now let do the job */
84 $action = getStringFromRequest('action');
87 case "addsubdocgroup":
91 case "forcereindexenginesearch":
95 case "updateenginesearch":
96 case "updatewebdavinterface":
97 case "updatecreateonline":
98 include ("docman/actions/$action.php");
102 $title = _('Document Manager: Display Document');
104 site_project_header(array('title'=>$title,'group'=>$group_id,'toptab'=>'docman'));
106 echo '<div style="float:left; width:17%;">';
107 include('docman/views/tree.php');
110 echo '<div style="float:right; width:82%;">';
111 include('docman/views/menu.php');
112 include('docman/views/views.php');
115 echo '<div style="clear:both; margin-bottom:5px;" />';
116 site_project_footer(array());