call hook to filter docs in tree, add data-url to jqtree div

This commit is contained in:
Uwe Steinmann 2019-02-04 14:51:52 +01:00
parent 6880901b4a
commit 6d09865bae

View File

@ -1719,7 +1719,7 @@ $(document).ready(function() {
} /* }}} */
function printNewTreeNavigationHtml($folderid=0, $accessmode=M_READ, $showdocs=0, $formid='form1', $expandtree=0, $orderby='') { /* {{{ */
echo "<div id=\"jqtree".$formid."\" style=\"margin-left: 10px;\"></div>\n";
echo "<div id=\"jqtree".$formid."\" style=\"margin-left: 10px;\" data-url=\"../op/op.Ajax.php?command=subtree&showdocs=".$showdocs."&orderby=".$orderby."\"></div>\n";
} /* }}} */
/**
@ -1750,8 +1750,8 @@ $(document).ready(function() {
if($showdocs) {
$documents = $subfolder->getDocuments($orderby);
$documents = SeedDMS_Core_DMS::filterAccess($documents, $user, $accessmode);
// if($obj->hasHook('filterTreeDocuments'))
// $documents = $obj->callHook('filterTreeDocuments', $folder, $documents);
if($obj->hasHook('filterTreeDocuments'))
$documents = $obj->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;