add new parameter partialtree to method printNewTreeNavigationJs()

This commit is contained in:
Uwe Steinmann 2019-09-06 15:19:47 +02:00
parent d12b41a958
commit 919757bbf3

View File

@ -1588,8 +1588,9 @@ $(document).ready(function() {
* @param boolean $showdocs set to true if tree shall contain documents
* as well.
* @param integer $expandtree level to which the tree shall be opened
* @param boolean $partialtree set to true if the given folder is the start folder
*/
function printNewTreeNavigationJs($folderid=0, $accessmode=M_READ, $showdocs=0, $formid='form1', $expandtree=0, $orderby='') { /* {{{ */
function printNewTreeNavigationJs($folderid=0, $accessmode=M_READ, $showdocs=0, $formid='form1', $expandtree=0, $orderby='', $partialtree=false) { /* {{{ */
function jqtree($path, $folder, $user, $accessmode, $showdocs=1, $expandtree=0, $orderby='', $level=0) {
$orderdir = (isset($orderby[1]) ? ($orderby[1] == 'd' ? 'desc' : 'asc') : 'asc');
if($path || $expandtree>=$level) {
@ -1630,7 +1631,9 @@ $(document).ready(function() {
$orderdir = (isset($orderby[1]) ? ($orderby[1] == 'd' ? 'desc' : 'asc') : 'asc');
if($folderid) {
$folder = $this->params['dms']->getFolder($folderid);
$path = $folder->getPath();
if(!$partialtree) {
$path = $folder->getPath();
}
/* Get the first folder (root folder) of path */
$folder = array_shift($path);
$node = array('label'=>$folder->getName(), 'id'=>$folder->getID(), 'load_on_demand'=>false, 'is_folder'=>true);