diff --git a/module/doc/js/tablecontents.js b/module/doc/js/tablecontents.js index 7639abcd26..060ac08338 100644 --- a/module/doc/js/tablecontents.js +++ b/module/doc/js/tablecontents.js @@ -32,7 +32,7 @@ $(function() var libClass = ['lib', 'annex', 'api', 'execution'].indexOf(item.type) !== -1 ? 'lib' : ''; var hasChild = item.children ? !!item.children.length : false; var link = item.hasAction ? '###' : '#'; - var $item = ''; + var $item = ''; $item += '
'; if(libClass == 'lib' && item.type != 'execution') $item += '
'; diff --git a/module/doc/view/tablecontents.html.php b/module/doc/view/tablecontents.html.php index b3a2c0c9fe..0fcf0798e5 100644 --- a/module/doc/view/tablecontents.html.php +++ b/module/doc/view/tablecontents.html.php @@ -31,22 +31,19 @@ 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($libType == 'api') + { + 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", '', true), ' ' . $lang->api->createApi, '', 'class="btn btn-primary iframe" data-width="95%"'); + } + else { 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); - } - } - else - { - 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", '', true), ' ' . $lang->api->createApi, '', 'class="btn btn-primary iframe" data-width="95%"'); + if($libID and common::hasPriv('doc', 'create')) echo $this->doc->printCreateBtn($lib, $type, $objectID, $moduleID, $apiLibID); } ?>