replace rootFolderId with $dms->getHomeFolder()

This commit is contained in:
Uwe Steinmann 2020-12-17 21:31:03 +01:00
parent 309867ac48
commit 7746fb72db
7 changed files with 11 additions and 22 deletions

View File

@ -155,9 +155,10 @@ switch($command) {
case 'subtree': /* {{{ */
if($user) {
if(empty($_GET['node']))
$nodeid = $settings->_rootFolderID;
$folder = $dms->getHomeFolder();
else
$nodeid = (int) $_GET['node'];
$folder = $dms->getFolder((int) $_GET['node']);
if (!is_object($folder)) return '';
if(empty($_GET['showdocs']))
$showdocs = false;
else
@ -167,9 +168,6 @@ switch($command) {
else
$orderby = $_GET['orderby'];
$folder = $dms->getFolder($nodeid);
if (!is_object($folder)) return '';
$subfolders = $folder->getSubFolders($orderby);
$subfolders = SeedDMS_Core_DMS::filterAccess($subfolders, $user, M_READ);
$tree = array();

View File

@ -35,8 +35,6 @@ if (!$user->isAdmin()) {
UI::exitError(getMLText("admin_tools"),getMLText("access_denied"));
}
$rootfolder = $dms->getFolder($settings->_rootFolderID);
$type = 'docsperuser';
if(!empty($_GET['type'])) {
$type = $_GET['type'];
@ -52,7 +50,6 @@ if($data = $dms->getStatisticalData($type)) {
}
if($view) {
$view->setParam('rootfolder', $rootfolder);
$view->setParam('type', $type);
$view->setParam('data', $data);
$view($_GET);

View File

@ -31,12 +31,11 @@ require_once("inc/inc.Authentication.php");
if(isset($_GET['action']) && $_GET['action'] == 'subtree') {
if (!isset($_GET["node"]) || !is_numeric($_GET["node"]) || intval($_GET["node"])<1) {
$nodeid = $settings->_rootFolderID;
$node = $dms->getRootFolder();
} else {
$nodeid = intval($_GET["node"]);
$node = $dms->getFolder(intval($_GET["node"]));
}
$node = $dms->getFolder($nodeid);
if (!is_object($node)) {
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_folder_id"))), getMLText("invalid_folder_id"));
}

View File

@ -30,12 +30,11 @@ require_once("inc/inc.Authentication.php");
if(isset($_GET['action']) && $_GET['action'] == 'subtree') {
if (!isset($_GET["node"]) || !is_numeric($_GET["node"]) || intval($_GET["node"])<1) {
$nodeid = $settings->_rootFolderID;
$node = $dms->getRootFolder();
} else {
$nodeid = intval($_GET["node"]);
$node = $dms->getFolder(intval($_GET["node"]));
}
$node = $dms->getFolder($nodeid);
if (!is_object($node)) {
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_folder_id"))), getMLText("invalid_folder_id"));
}

View File

@ -34,7 +34,6 @@ $view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user));
if (!$user->isAdmin()) {
UI::exitError(getMLText("admin_tools"),getMLText("access_denied"));
}
$rootfolder = $dms->getFolder($settings->_rootFolderID);
if(isset($_GET['skip']))
$skip = $_GET['skip'];

View File

@ -34,25 +34,23 @@ $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user));
if (!isset($_GET["folderid"]) || !is_numeric($_GET["folderid"]) || intval($_GET["folderid"])<1) {
$folderid = $settings->_rootFolderID;
$folder = $dms->getRootFolder();
}
else {
$folderid = intval($_GET["folderid"]);
$folder = $dms->getFolder(intval($_GET["folderid"]));
}
$folder = $dms->getFolder($folderid);
if (!is_object($folder)) {
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_folder_id"))), getMLText("invalid_folder_id"));
}
if(isset($_GET['action']) && $_GET['action'] == 'subtree') {
if (!isset($_GET["node"]) || !is_numeric($_GET["node"]) || intval($_GET["node"])<1) {
$nodeid = $settings->_rootFolderID;
$node = $dms->getRootFolder();
} else {
$nodeid = intval($_GET["node"]);
$node = $dms->getFolder(intval($_GET["node"]));
}
$node = $dms->getFolder($nodeid);
if (!is_object($node)) {
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_folder_id"))), getMLText("invalid_folder_id"));
}

View File

@ -191,7 +191,6 @@ $(document).ready( function() {
function show() { /* {{{ */
$this->dms = $this->params['dms'];
$user = $this->params['user'];
$rootfolder = $this->params['rootfolder'];
$data = $this->params['data'];
$type = $this->params['type'];