* Copyright 2000, Quentin Cregan/Sourceforge
* Copyright 2002-2003, Tim Perdue/GForge, LLC
* Copyright 2010-2011, Franck Villaume - Capgemini
+ * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
* http://fusionforge.org
*
- * This file is part of FusionForge.
- *
- * FusionForge is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
*
* FusionForge is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with FusionForge; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/* please do not add require here : use www/docman/index.php to add require */
global $group_id; // id of the group
global $nested_docs;
global $linkmenu;
+global $g; // the group object
if (!forge_check_perm('docman', $group_id, 'read')) {
$return_msg= _('Document Manager Access Denied');
$idExposeTreeIndex = 0;
$idhtml = 0;
-echo '<div id="documenttree" style="height:100%">';
-?>
-
-<script type="text/javascript">
- var myThemeXPBase = "<?php echo util_make_uri('/jscook/ThemeXP/'); ?>";
-</script>
-<script type="text/javascript" src="<?php echo util_make_uri('/jscook/JSCookTree.js'); ?>"></script>
-<link rel="stylesheet" href="<?php echo util_make_uri('/jscook/ThemeXP/theme.css'); ?>" type="text/css" />
-<script src="<?php echo util_make_uri('/jscook/ThemeXP/theme.js'); ?>" type="text/javascript"></script>
+$displayProjectName = 0;
-<div id="myMenuID" style="overflow:auto;"></div>
+if ($g->usesPlugin('projects_hierarchy')) {
+ $projectsHierarchy = plugin_get_object('projects_hierarchy');
+ $projectIDsArray = $projectsHierarchy->getFamilyID($group_id, 'child', false, 'validated');
+ if (sizeof($projectIDsArray))
+ $displayProjectName = 1;
+}
-<script type="text/javascript">
- var myMenu =
- [
- ['<span class="JSCookTreeFolderClosed"><i><img alt="" src="' + myThemeXPBase + 'folder1.gif" /></i></span><span id="ctItemID0" class="JSCookTreeFolderOpen"><i><img alt="" src="' + myThemeXPBase + 'folderopen1.gif" /></i></span>', '/', '<?php echo '?group_id='.$group_id.'&view='.$linkmenu ?>', '', '', <?php docman_recursive_display(0); ?>
- ]
- ];
+echo '<div id="documenttree" style="height:100%">';
+$dm = new DocumentManager($g);
+$dm->getJSTree($linkmenu, $displayProjectName);
+echo '<noscript>';
+echo '<ul>';
+$label = '/';
+if ($displayProjectName)
+ $label = $g->getPublicName();
- var treeIndex = ctDraw('myMenuID', myMenu, ctThemeXP1, 'ThemeXP', 0, 1);
- ctExposeTreeIndex(treeIndex, <?php echo $idExposeTreeIndex ?>);
- var openItem = ctGetSelectedItem(treeIndex);
- ctOpenFolder(openItem);
-</script>
+echo '<li><a href="?group_id='.$g->getID().'&view='.$linkmenu.'">'.$label.'</a></il>';
+$dm->getTree($linkmenu);
+echo '</ul>';
+echo '</noscript>';
+if (isset($projectIDsArray) && is_array($projectIDsArray)) {
+ foreach ($projectIDsArray as $key=>$projectID) {
+ $groupObject = group_get_object($projectID);
+ if ($groupObject->usesDocman() && $projectsHierarchy->getDocmanStatus($groupObject->getID())
+ && forge_check_perm('docman', $groupObject->getID(), 'read')) {
+ $dm = new DocumentManager($groupObject);
+ $dm->getJSTree($linkmenu, $displayProjectName);
+ echo '<noscript>';
+ echo '<ul>';
+ $label = '/';
+ if ($displayProjectName)
+ $label = $groupObject->getPublicName();
-<?php
+ echo '<li><a href="?group_id='.$groupObject->getID().'&view='.$linkmenu.'">'.$label.'</a></il>';
+ $dm->getTree($linkmenu);
+ echo '</ul>';
+ echo '</noscript>';
+ }
+ }
+}
echo '</div>';
?>