diff --git a/module/doc/model.php b/module/doc/model.php index edc8b2980b..9164b6f3f9 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -2309,14 +2309,26 @@ EOT; { if(!$docID and $currentMethod != 'tablecontents') $docID = $doc->id; - $treeMenu[0] .= 'id == $docID ? ' class="active"' : ' class="independent"') . '>'; + $treeMenu[0] .= 'id == $docID ? ' class="active"' : ' class="independent"') . "data-id=$doc->id>"; if($currentMethod == 'tablecontents') { $treeMenu[0] .= '' . zget($users, $doc->editedBy) . '  ' . $doc->editedDate . ''; } - - $treeMenu[0] .= html::a(inlink('objectLibs', "type=$type&objectID=$objectID&libID=$rootID&docID={$doc->id}"), "  " . $doc->title, '', "data-app='{$this->app->tab}' class='doc-title' title='{$doc->title}'"); + if($currentMethod == 'objectlibs') + { + $treeMenu[0] .= "
" . html::a(inlink('objectLibs', "type=$type&objectID=$objectID&libID=$rootID&docID={$doc->id}"), "  " . $doc->title, '', "data-app='{$this->app->tab}' class='doc-title' title='{$doc->title}'") . ''; + if(common::hasPriv('doc', 'edit')) + { + $treeMenu[0] .= "
"; + $treeMenu[0] .= html::a(helper::createLink('doc', 'edit', "docID={$doc->id}&comment=false&objectType=$type&objectID=$objectID&libID=$rootID"), "", '', "title={$this->lang->doc->edit}"); + $treeMenu[0] .= '
'; + } + } + else + { + $treeMenu[0] .= html::a(inlink('objectLibs', "type=$type&objectID=$objectID&libID=$rootID&docID={$doc->id}"), "  " . $doc->title, '', "data-app='{$this->app->tab}' class='doc-title' title='{$doc->title}'"); + } $treeMenu[0] .= ''; } @@ -2373,9 +2385,13 @@ EOT; if($currentMethod == 'objectlibs') { $treeMenu[$module->id] .= "
" . html::a(inlink('objectLibs', "type=$type&objectID=$objectID&libID=$libID&docID={$doc->id}"), "  " . $doc->title, '', "data-app='{$this->app->tab}' class='doc-title' title='{$doc->title}'") . ''; - $treeMenu[$module->id] .= "
"; - $treeMenu[$module->id] .= html::a(helper::createLink('doc', 'edit', "docID=$docID&comment=false&objectType=$type&objectID=$objectID&libID=$libID"), "", '', "title={$this->lang->doc->edit}"); - $treeMenu[$module->id] .= '
'; + if(common::hasPriv('doc', 'edit')) + { + $treeMenu[$module->id] .= "
"; + $treeMenu[$module->id] .= html::a(helper::createLink('doc', 'edit', "docID=$docID&comment=false&objectType=$type&objectID=$objectID&libID=$libID"), "", '', "title={$this->lang->doc->edit}"); + $treeMenu[$module->id] .= '
'; + } + $treeMenu[$module->id] .= ''; } elseif($currentMethod == 'tablecontents') { @@ -2399,11 +2415,15 @@ EOT; } else { - $li = "
" . $module->name . ''; - $li .= "
"; - $li .= html::a(helper::createLink('tree', 'edit', "module=$module->id&type=doc"), "", '', "data-toggle='modal' title={$this->lang->doc->editType}"); - $li .= html::a(helper::createLink('tree', 'browse', "rootID=$libID&type=doc&module=$module->id", '', 1), "", '', "class='iframe' title={$this->lang->doc->editType}"); - $li .= '
'; + $li = "
" . $module->name . ''; + if(common::hasPriv('tree', 'edit') or common::hasPriv('tree', 'browse')) + { + $li .= "
"; + if(common::hasPriv('tree', 'edit')) $li .= html::a(helper::createLink('tree', 'edit', "module=$module->id&type=doc"), "", '', "data-toggle='modal' title={$this->lang->doc->editType}"); + if(common::hasPriv('tree', 'browse')) $li .= html::a(helper::createLink('tree', 'browse', "rootID=$libID&type=doc&module=$module->id", '', 1), "", '', "class='iframe' title={$this->lang->doc->editType}"); + $li .= '
'; + } + $li .= '
'; } } if($treeMenu[$module->id])