From 40f2311b9159aec7e9cf529bcf52f6549c84319c Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 12 Oct 2023 16:02:50 +0200 Subject: [PATCH] show files and folders in dropfolder dir recursively --- CHANGELOG | 1 + out/out.DropFolderChooser.php | 6 ++ views/bootstrap/class.Bootstrap.php | 16 +-- views/bootstrap/class.DropFolderChooser.php | 105 +++++++++++++------- views/bootstrap/class.ImportFS.php | 4 +- views/bootstrap4/class.Bootstrap4.php | 16 +-- 6 files changed, 96 insertions(+), 52 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 48e6aa416..a7b59a95b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -7,6 +7,7 @@ - do not show unreadable documents on Dashboard - fix creating preview image of file in drop folder if it contains special chars +- show fileѕ and folders in dropfolder dir recursively -------------------------------------------------------------------------------- Changes in version 5.1.32 diff --git a/out/out.DropFolderChooser.php b/out/out.DropFolderChooser.php index 345d57390..f153830f1 100644 --- a/out/out.DropFolderChooser.php +++ b/out/out.DropFolderChooser.php @@ -44,6 +44,11 @@ if(isset($_GET['showfolders']) && $_GET['showfolders']) else $showfolders = false; +if(isset($_GET['recursive']) && $_GET['recursive']) + $recursive = true; +else + $recursive = false; + if (isset($_GET["folderid"]) && is_numeric($_GET["folderid"])) { $folderid = intval($_GET["folderid"]); $folder = $dms->getFolder($folderid); @@ -66,6 +71,7 @@ if($view) { $view->setParam('timeout', $settings->_cmdTimeout); $view->setParam('xsendfile', $settings->_enableXsendfile); $view->setParam('showfolders', $showfolders); + $view->setParam('recursive', $recursive); $view->setParam('folder', $folder); $view($_GET); exit; diff --git a/views/bootstrap/class.Bootstrap.php b/views/bootstrap/class.Bootstrap.php index 02da0eecd..ee7b1b021 100644 --- a/views/bootstrap/class.Bootstrap.php +++ b/views/bootstrap/class.Bootstrap.php @@ -426,8 +426,10 @@ background-image: linear-gradient(to bottom, #882222, #111111);; if($this->params['dropfolderdir'] && $this->params['enabledropfolderlist']) { echo "
"; echo "
isType('folder')) - echo " data-query=\"folderid=".$folder->getID()."\""; + $query .= "&folderid=".$folder->getID(); + echo " data-query=\"".$query."\""; echo ">
"; echo "
"; } @@ -2020,18 +2022,18 @@ $(document).ready(function() { return $content; } /* }}} */ - function printDropFolderChooserHtml($formName, $dropfolderfile="", $showfolders=0) { /* {{{ */ - echo self::getDropFolderChooserHtml($formName, $dropfolderfile, $showfolders); + function printDropFolderChooserHtml($formName, $dropfolderfile="", $showfolders=0, $recursive=1) { /* {{{ */ + echo self::getDropFolderChooserHtml($formName, $dropfolderfile, $showfolders, $recursive); } /* }}} */ - function getDropFolderChooserHtml($formName, $dropfolderfile="", $showfolders=0) { /* {{{ */ + function getDropFolderChooserHtml($formName, $dropfolderfile="", $showfolders=0, $recursive=1) { /* {{{ */ $content = "
\n"; $content .= ""; $content .= ""; $content .= $this->getModalBoxLink( array( 'target' => 'dropfolderChooser', - 'remote' => $this->params['settings']->_httpRoot."out/out.DropFolderChooser.php?form=".$formName."&dropfolderfile=".urlencode($dropfolderfile)."&showfolders=".$showfolders, + 'remote' => $this->params['settings']->_httpRoot."out/out.DropFolderChooser.php?form=".$formName."&dropfolderfile=".urlencode($dropfolderfile)."&showfolders=".$showfolders."&recursive=".$recursive, 'title' => ($showfolders ? getMLText("choose_target_folder"): getMLText("choose_target_file")).'…' )); $content .= "
\n"; @@ -2070,8 +2072,8 @@ $(document).ready(function() { printDropFolderChooserHtml($formName, $dropfolderfile, $showfolders); + function printDropFolderChooser($formName, $dropfolderfile="", $showfolders=0, $recursive=1) { /* {{{ */ + $this->printDropFolderChooserHtml($formName, $dropfolderfile, $showfolders, $recursive); ?>