From a4aef73aa630e4d3a7ccd7640cd6c3a996ee20e9 Mon Sep 17 00:00:00 2001 From: xiawenlong Date: Thu, 28 Oct 2021 14:41:31 +0800 Subject: [PATCH] * Finish Task #43676,43675,43672,43671,43679,43669 --- db/update15.7.sql | 2 ++ module/api/control.php | 8 +++++--- module/api/view/create.html.php | 2 +- module/api/view/index.html.php | 4 +++- module/api/view/releases.html.php | 2 +- module/api/view/struct.html.php | 4 ++-- 6 files changed, 14 insertions(+), 8 deletions(-) create mode 100644 db/update15.7.sql diff --git a/db/update15.7.sql b/db/update15.7.sql new file mode 100644 index 0000000000..6d05d9db7f --- /dev/null +++ b/db/update15.7.sql @@ -0,0 +1,2 @@ +ALTER TABLE `zt_apistruct` + MODIFY COLUMN `desc` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL AFTER `type`; diff --git a/module/api/control.php b/module/api/control.php index 0c3c7253a0..d419fa54db 100755 --- a/module/api/control.php +++ b/module/api/control.php @@ -67,7 +67,7 @@ class api extends control $this->view->apiList = $apiList; } - $this->setMenu($libID); + $this->setMenu($libID, $moduleID); $this->view->isRelease = $release > 0; $this->view->release = $release; @@ -469,6 +469,7 @@ class api extends control { $now = helper::now(); $params = fixer::input('post') + ->trim('title,path') ->remove('type') ->skipSpecial('params,response') ->add('addedBy', $this->app->user->account) @@ -612,10 +613,11 @@ class api extends control * Set doc menu by method name. * * @param int $libID + * @param int $moduleID * @access public * @return void */ - private function setMenu($libID = 0) + private function setMenu($libID = 0, $moduleID = 0) { common::setMenuVars('doc', $libID); @@ -640,7 +642,7 @@ class api extends control if(common::hasPriv('api', 'create')) { $menu .= "
  • "; - $menu .= html::a(helper::createLink('api', 'create', "libID=$libID"), " " . $this->lang->api->apiDoc, '', "data-app='{$this->app->tab}'"); + $menu .= html::a(helper::createLink('api', 'create', "libID=$libID&moduleID=$moduleID"), " " . $this->lang->api->apiDoc, '', "data-app='{$this->app->tab}'"); $menu .= "
  • "; } diff --git a/module/api/view/create.html.php b/module/api/view/create.html.php index 73a953a1f0..43cd351874 100644 --- a/module/api/view/create.html.php +++ b/module/api/view/create.html.php @@ -69,7 +69,7 @@ js::set('struct_paramsType', $lang->struct->paramsType); api->module;?> - + diff --git a/module/api/view/index.html.php b/module/api/view/index.html.php index b1b7c1a8dc..5e124171c2 100644 --- a/module/api/view/index.html.php +++ b/module/api/view/index.html.php @@ -42,7 +42,9 @@
    -
    api->noModule;?>
    + +
    api->noModule;?>
    + diff --git a/module/api/view/releases.html.php b/module/api/view/releases.html.php index ca0afb44b6..1c1e1a7d69 100644 --- a/module/api/view/releases.html.php +++ b/module/api/view/releases.html.php @@ -41,7 +41,7 @@ addedBy, '');?> addedDate;?> - createLink('api', 'deleteRelease', "libID=$libID&id=$release->id"), '', 'hiddenwin', "title='{$lang->api->delete}' class='btn'");?> + createLink('api', 'deleteRelease', "libID=$libID&id=$release->id"), '', 'hiddenwin', "title='{$lang->api->deleteRelease}' class='btn'");?> diff --git a/module/api/view/struct.html.php b/module/api/view/struct.html.php index d7f744ab1f..f1983a737b 100644 --- a/module/api/view/struct.html.php +++ b/module/api/view/struct.html.php @@ -49,8 +49,8 @@ addedDate;?> createLink('api', 'editStruct', "libID=$libID&structID=$struct->id"), '', '', "title='{$lang->api->edit}' class='btn'"); - if(common::hasPriv('api', 'deleteStruct')) echo html::a($this->createLink('api', 'deleteStruct', "libID=$libID&structID=$struct->id"), '', 'hiddenwin', "title='{$lang->api->delete}' class='btn'"); + if(common::hasPriv('api', 'editStruct')) echo html::a($this->createLink('api', 'editStruct', "libID=$libID&structID=$struct->id"), '', '', "title='{$lang->api->editStruct}' class='btn'"); + if(common::hasPriv('api', 'deleteStruct')) echo html::a($this->createLink('api', 'deleteStruct', "libID=$libID&structID=$struct->id"), '', 'hiddenwin', "title='{$lang->api->deleteStruct}' class='btn'"); ?>