From cad94cd18b58bcc576bf1b31307f73cc1a342a7d Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 4 Feb 2019 08:46:03 +0100 Subject: [PATCH] call hook to filter documents in folder tree can be used to show only certain documents, e.g. those which are released --- views/bootstrap/class.Bootstrap.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/views/bootstrap/class.Bootstrap.php b/views/bootstrap/class.Bootstrap.php index 43e859c23..44266ef71 100644 --- a/views/bootstrap/class.Bootstrap.php +++ b/views/bootstrap/class.Bootstrap.php @@ -1719,7 +1719,7 @@ $(document).ready(function() { } /* }}} */ function printNewTreeNavigationHtml($folderid=0, $accessmode=M_READ, $showdocs=0, $formid='form1', $expandtree=0, $orderby='') { /* {{{ */ - echo "
\n"; + echo "
\n"; } /* }}} */ /** @@ -1749,6 +1749,8 @@ $(document).ready(function() { if($showdocs) { $documents = $folder->getDocuments($orderby); $documents = SeedDMS_Core_DMS::filterAccess($documents, $user, $accessmode); + if($this->hasHook('filterTreeDocuments')) + $documents = $this->callHook('filterTreeDocuments', $folder, $documents); foreach($documents as $document) { $node2 = array('label'=>$document->getName(), 'id'=>$document->getID(), 'load_on_demand'=>false, 'is_folder'=>false); $children[] = $node2; @@ -1785,6 +1787,8 @@ $(document).ready(function() { if($showdocs) { $documents = $folder->getDocuments($orderby); $documents = SeedDMS_Core_DMS::filterAccess($documents, $this->params['user'], $accessmode); + if($this->hasHook('filterTreeDocuments')) + $documents = $this->callHook('filterTreeDocuments', $folder, $documents); foreach($documents as $document) { $node2 = array('label'=>$document->getName(), 'id'=>$document->getID(), 'load_on_demand'=>false, 'is_folder'=>false); $node['children'][] = $node2; @@ -1795,6 +1799,8 @@ $(document).ready(function() { if($showdocs) { $documents = $folder->getDocuments($orderby); $documents = SeedDMS_Core_DMS::filterAccess($documents, $this->params['user'], $accessmode); + if($this->hasHook('filterTreeDocuments')) + $documents = $this->callHook('filterTreeDocuments', $folder, $documents); foreach($documents as $document) { $node2 = array('label'=>$document->getName(), 'id'=>$document->getID(), 'load_on_demand'=>false, 'is_folder'=>false); $node['children'][] = $node2;