From 254a2172c2578630e72f0ab7bcb803cfbc05fc1c Mon Sep 17 00:00:00 2001 From: liumengyi Date: Wed, 29 Mar 2023 13:46:41 +0800 Subject: [PATCH] * Fix bug of tableContents. --- module/doc/view/tablecontents.html.php | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/module/doc/view/tablecontents.html.php b/module/doc/view/tablecontents.html.php index a61f06b9d6..872eec23f9 100644 --- a/module/doc/view/tablecontents.html.php +++ b/module/doc/view/tablecontents.html.php @@ -31,22 +31,14 @@ echo html::a($this->createLink('doc', $exportMethod, "libID=$libID&docID=0", 'html', true), " " . $lang->export, '', "class='btn btn-link export' id='{$exportMethod}'"); } - if($libType != 'api') + if(common::hasPriv('doc', 'createLib')) { - if(common::hasPriv('doc', 'createLib')) - { - echo html::a(helper::createLink('doc', 'createLib', "type=$type&objectID=$objectID"), ' ' . $this->lang->doc->createLib, '', 'class="btn btn-secondary iframe" data-width="800px"'); - } - - if($libID and (common::hasPriv('doc', 'create') or (common::hasPriv('api', 'create') and !$apiLibID))) - { - echo $this->doc->printCreateBtn($lib, $type, $objectID, $moduleID, $apiLibID); - } + echo html::a(helper::createLink('doc', 'createLib', "type=$type&objectID=$objectID"), ' ' . $this->lang->doc->createLib, '', 'class="btn btn-secondary iframe" data-width="800px"'); } - else + + if($libID and (common::hasPriv('doc', 'create') or (common::hasPriv('api', 'create') and !$apiLibID))) { - if(common::hasPriv('api', 'createLib')) echo html::a($this->createLink('api', 'createLib', "type=$type"), ' ' . $lang->api->createLib, '', 'class="btn btn-secondary iframe" data-width="800px"'); - if(common::hasPriv('api', 'create')) echo html::a($this->createLink('api', 'create', "libID=$libID&moduleID=$moduleID"), ' ' . $lang->api->createApi, '', 'class="btn btn-primary"'); + echo $this->doc->printCreateBtn($lib, $type, $objectID, $moduleID, $apiLibID); } ?>