From c40a50987ae1b308c60c7fbdf27741013778b2cc Mon Sep 17 00:00:00 2001 From: guofeilong Date: Tue, 4 Apr 2023 10:54:34 +0800 Subject: [PATCH 1/5] * Adjust code . --- module/doc/control.php | 2 ++ module/doc/view/lefttree.html.php | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/module/doc/control.php b/module/doc/control.php index f750ff202b..08d8980fac 100755 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -1291,6 +1291,7 @@ class doc extends control */ public function tableContents($type = 'custom', $objectID = 0, $libID = 0, $moduleID = 0, $browseType = 'all', $orderBy = 'status,id_desc', $param = 0, $recTotal = 0, $recPerPage = 20, $pageID = 1) { + $this->view->isFirstLoad = $objectID == 0 ? 'true' : 'false'; $this->session->set('createProjectLocate', $this->app->getURI(true), 'doc'); if(empty($browseType)) $browseType = 'all'; @@ -1363,6 +1364,7 @@ class doc extends control $this->view->canExport = common::hasPriv('doc', $type . '2export'); $this->view->apiLibID = key($apiLibs); + $this->display(); } diff --git a/module/doc/view/lefttree.html.php b/module/doc/view/lefttree.html.php index f97ae54674..4585d84280 100644 --- a/module/doc/view/lefttree.html.php +++ b/module/doc/view/lefttree.html.php @@ -61,6 +61,7 @@ js::set('versionLang', $lang->build->common); /* ObjectType and objectID used for other space. */ js::set('objectType', isset($type) ? $type : ''); js::set('objectID', isset($objectID) ? $objectID : ''); +js::set('isFirstLoad', isset($isFirstLoad) ? $isFirstLoad: ''); ?>
@@ -236,7 +237,7 @@ $(function() if(item.active) $li.addClass('active'); } }); - if(location.href.indexOf('moduleID') == -1) ele.data('zui.tree').collapse(); + if(isFirstLoad !== 'false') ele.data('zui.tree').collapse(); var $leaf = ele.find('li.active'); if($leaf.length) $leaf[$leaf.length - 1].scrollIntoView(true); From 9313f05b4a00791a7ddecdf741cd4fb180db5f20 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Tue, 4 Apr 2023 10:57:03 +0800 Subject: [PATCH 2/5] * Code for task #89917. --- module/dev/control.php | 11 ++++++----- module/dev/lang/de.php | 4 ++++ module/dev/lang/en.php | 4 ++++ module/dev/lang/fr.php | 4 ++++ module/dev/lang/zh-cn.php | 4 ++++ module/dev/view/header.html.php | 20 ++++++++++++++++++++ module/dev/view/restapi.html.php | 2 +- 7 files changed, 43 insertions(+), 6 deletions(-) diff --git a/module/dev/control.php b/module/dev/control.php index 308b82eaa5..3ca357f9d3 100644 --- a/module/dev/control.php +++ b/module/dev/control.php @@ -51,11 +51,12 @@ class dev extends control $moduleID = $api->module; $api->desc = htmlspecialchars_decode($api->desc); } - $this->view->title = $this->lang->dev->api; - $this->view->moduleTree = $menu; - $this->view->typeList = $typeList; - $this->view->api = $api; - $this->view->apiID = $apiID; + $this->view->title = $this->lang->dev->api; + $this->view->selectedModule = 'restapi'; + $this->view->moduleTree = $menu; + $this->view->typeList = $typeList; + $this->view->api = $api; + $this->view->apiID = $apiID; $this->display(); } diff --git a/module/dev/lang/de.php b/module/dev/lang/de.php index e648dff8e1..b55fcf0103 100644 --- a/module/dev/lang/de.php +++ b/module/dev/lang/de.php @@ -21,6 +21,7 @@ $lang->dev->paramMailto = "User account. Separate accounts by ','."; $lang->dev->noteEditor = "The editor is disabled for security reasons. To use this feature, Please turn on."; $lang->dev->noteTranslate = "The translation is disabled for security reasons. To use this feature, please go to the official website to download and install the plugin of translation."; $lang->dev->confirmRestore = 'Do you want to reset?'; +$lang->dev->apiTips = 'Every page can be called through the JSON interface'; $lang->dev->language = 'Language: %s'; $lang->dev->default = 'Default'; @@ -201,6 +202,9 @@ $lang->dev->endGroupList['admin'] = 'Admin'; $lang->dev->endGroupList['system'] = 'System'; $lang->dev->endGroupList['other'] = 'Andere'; +$lang->dev->featureBar['api']['restapi'] = 'RESTful'; +$lang->dev->featureBar['api']['index'] = 'Built In'; + $lang->dev->featureBar['langItem']['common'] = 'Common'; $lang->dev->featureBar['langItem']['first'] = 'First Menu'; $lang->dev->featureBar['langItem']['second'] = 'Second Menu'; diff --git a/module/dev/lang/en.php b/module/dev/lang/en.php index 95bff27d80..56b0bbffe8 100644 --- a/module/dev/lang/en.php +++ b/module/dev/lang/en.php @@ -21,6 +21,7 @@ $lang->dev->paramMailto = "User account. Separate accounts by ','."; $lang->dev->noteEditor = "The editor is disabled for security reasons. To use this feature, Please turn on."; $lang->dev->noteTranslate = "The translation is disabled for security reasons. To use this feature, please go to the official website to download and install the plugin of translation."; $lang->dev->confirmRestore = 'Do you want to reset?'; +$lang->dev->apiTips = 'Every page can be called through the JSON interface'; $lang->dev->language = 'Language: %s'; $lang->dev->default = 'Default'; @@ -201,6 +202,9 @@ $lang->dev->endGroupList['admin'] = 'Admin'; $lang->dev->endGroupList['system'] = 'System'; $lang->dev->endGroupList['other'] = 'Others'; +$lang->dev->featureBar['api']['restapi'] = 'RESTful'; +$lang->dev->featureBar['api']['index'] = 'Built In'; + $lang->dev->featureBar['langItem']['common'] = 'Common'; $lang->dev->featureBar['langItem']['first'] = 'First Menu'; $lang->dev->featureBar['langItem']['second'] = 'Second Menu'; diff --git a/module/dev/lang/fr.php b/module/dev/lang/fr.php index 95bff27d80..56b0bbffe8 100644 --- a/module/dev/lang/fr.php +++ b/module/dev/lang/fr.php @@ -21,6 +21,7 @@ $lang->dev->paramMailto = "User account. Separate accounts by ','."; $lang->dev->noteEditor = "The editor is disabled for security reasons. To use this feature, Please turn on."; $lang->dev->noteTranslate = "The translation is disabled for security reasons. To use this feature, please go to the official website to download and install the plugin of translation."; $lang->dev->confirmRestore = 'Do you want to reset?'; +$lang->dev->apiTips = 'Every page can be called through the JSON interface'; $lang->dev->language = 'Language: %s'; $lang->dev->default = 'Default'; @@ -201,6 +202,9 @@ $lang->dev->endGroupList['admin'] = 'Admin'; $lang->dev->endGroupList['system'] = 'System'; $lang->dev->endGroupList['other'] = 'Others'; +$lang->dev->featureBar['api']['restapi'] = 'RESTful'; +$lang->dev->featureBar['api']['index'] = 'Built In'; + $lang->dev->featureBar['langItem']['common'] = 'Common'; $lang->dev->featureBar['langItem']['first'] = 'First Menu'; $lang->dev->featureBar['langItem']['second'] = 'Second Menu'; diff --git a/module/dev/lang/zh-cn.php b/module/dev/lang/zh-cn.php index c01ab55b44..1cfe5dfd1b 100644 --- a/module/dev/lang/zh-cn.php +++ b/module/dev/lang/zh-cn.php @@ -21,6 +21,7 @@ $lang->dev->paramMailto = "填写帐号,多个账号用','分隔。"; $lang->dev->noteEditor = "编辑器功能存在部分安全问题,如需使用该功能,可在此开启。"; $lang->dev->noteTranslate = "翻译功能因为安全原因被禁用。使用该功能,请到官网下载安装 翻译 插件。"; $lang->dev->confirmRestore = '是否要恢复默认?'; +$lang->dev->apiTips = '可访问的每个页面都可通过JSON接口调取'; $lang->dev->language = '语言:%s'; $lang->dev->default = '默认值'; @@ -201,6 +202,9 @@ $lang->dev->endGroupList['admin'] = '后台'; $lang->dev->endGroupList['system'] = '系统'; $lang->dev->endGroupList['other'] = '其他'; +$lang->dev->featureBar['api']['restapi'] = 'RESTful接口'; +$lang->dev->featureBar['api']['index'] = '内置页面接口'; + $lang->dev->featureBar['langItem']['common'] = '公共'; $lang->dev->featureBar['langItem']['first'] = '一级菜单'; $lang->dev->featureBar['langItem']['second'] = '二级菜单'; diff --git a/module/dev/view/header.html.php b/module/dev/view/header.html.php index 22553cad6e..6e955c2b3a 100644 --- a/module/dev/view/header.html.php +++ b/module/dev/view/header.html.php @@ -2,3 +2,23 @@ +rawMethod == 'api'):?> + + + + diff --git a/module/dev/view/restapi.html.php b/module/dev/view/restapi.html.php index 056cce64c4..e393b8076e 100644 --- a/module/dev/view/restapi.html.php +++ b/module/dev/view/restapi.html.php @@ -9,7 +9,7 @@ * @version $Id$ * @link http://www.zentao.net */ -include '../../common/view/header.html.php'; +include 'header.html.php'; js::set('confirmDelete', $lang->api->confirmDelete); ?>
From f6c0c0e14f0e12b9ae52c5a160a8740b94f6e9f0 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Tue, 4 Apr 2023 09:25:52 +0800 Subject: [PATCH 3/5] * code for task #89905. --- module/api/view/index.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/api/view/index.html.php b/module/api/view/index.html.php index 1632e88b73..0084b4ed57 100644 --- a/module/api/view/index.html.php +++ b/module/api/view/index.html.php @@ -25,7 +25,7 @@ if($libTree and common::hasPriv('api', 'struct')) echo html::a($this->createLink('api', 'struct', "libID=$libID"), " " . $lang->api->struct, '', "class='btn btn-link'"); if($libTree and common::hasPriv('api', 'releases')) echo html::a($this->createLink('api', 'releases', "libID=$libID", 'html', true), " " . $lang->api->releases, '', "class='btn btn-link iframe' data-width='800px'"); if($libTree and common::hasPriv('api', 'createRelease')) echo html::a($this->createLink('api', 'createRelease', "libID=$libID"), " " . $lang->api->createRelease, '', "class='btn btn-link iframe' data-width='800px'"); - //if($config->edition != 'open' and $libTree and common::hasPriv('api', 'export')) echo html::a($this->createLink('api', 'export', "libID=$libID", 'html', true), " " . $lang->export, '', "class='btn btn-link export' id='export'"); + if($libTree and common::hasPriv('api', 'export') and $config->edition != 'open') echo html::a($this->createLink('api', 'export', "libID=$libID", 'html', true), " " . $lang->export, '', "class='btn btn-link export' id='export'"); if(common::hasPriv('api', 'createLib')) echo html::a($this->createLink('api', 'createLib', "type=" . ($objectType == 'project' ? 'project' : 'product') . "&objectID=$objectID"), ' ' . $lang->api->createLib, '', 'class="btn btn-secondary iframe" data-width="800px"'); if($libTree and common::hasPriv('api', 'create')) echo html::a($this->createLink('api', 'create', "libID=$libID&moduleID=$moduleID"), ' ' . $lang->api->createApi, '', 'class="btn btn-primary"'); ?> From 5983e628647921ec3eb1232e5941610296674709 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Tue, 4 Apr 2023 11:16:01 +0800 Subject: [PATCH 4/5] * code for task #89905. --- module/api/control.php | 1 + module/api/view/create.html.php | 22 +++++++--------------- module/api/view/index.html.php | 6 +++--- module/doc/control.php | 4 ++-- module/doc/view/lefttree.html.php | 2 +- module/doc/view/tablecontents.html.php | 6 +++++- 6 files changed, 19 insertions(+), 22 deletions(-) diff --git a/module/api/control.php b/module/api/control.php index 61d78f911e..9690d8b1d2 100755 --- a/module/api/control.php +++ b/module/api/control.php @@ -120,6 +120,7 @@ class api extends control $this->view->objectType = $objectType; $this->view->objectID = $objectID; $this->view->moduleID = $moduleID; + $this->view->version = $version; $this->view->libTree = $this->api->getLibTree($libID, $libs, $moduleID, $objectID, $browseType); $this->view->users = $this->user->getPairs('noclosed,noletter'); $this->view->objectDropdown = isset($libs[$libID]) ? $this->generateLibsDropMenu($libs[$libID], $release) : ''; diff --git a/module/api/view/create.html.php b/module/api/view/create.html.php index 970f6d929a..f79574454f 100644 --- a/module/api/view/create.html.php +++ b/module/api/view/create.html.php @@ -38,12 +38,10 @@ js::set('struct_paramsType', $lang->struct->paramsType);