From 0d7783934022733af22ce3ca4a9f38cc912bb002 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 4 Apr 2023 15:45:25 +0800 Subject: [PATCH] * Code for task #89915. --- module/doc/control.php | 27 +++++++++++++++++++++++++++ module/doc/view/lefttree.html.php | 4 ++-- module/tree/control.php | 4 ++-- module/tree/view/edit.html.php | 2 +- 4 files changed, 32 insertions(+), 5 deletions(-) diff --git a/module/doc/control.php b/module/doc/control.php index af4c0f8cd0..7df038341b 100755 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -1385,4 +1385,31 @@ class doc extends control $disabled = $project->multiple ? '' : 'disabled'; return print(html::select('execution', $executionPairs, 0, "class='form-control' data-placeholder='{$this->lang->doclib->tip->selectExecution}' $disabled data-drop_direction='down' data-drop-direction='down'")); } + + /** + * Edit a catalog. + * + * @param int $moduleID + * @param string $type doc|api + * @access public + * @return void + */ + public function editCatalog($moduleID, $type) + { + echo $this->fetch('tree', 'edit', "moduleID=$moduleID&type=$type"); + } + + /** + * Delete a catalog. + * + * @param int $rootID + * @param int $moduleID + * @param string $confirm yes|no + * @access public + * @return void + */ + public function deleteCatalog($rootID, $moduleID, $confirm = 'no') + { + echo $this->fetch('tree', 'delete', "rootID=$rootID&moduleID=$moduleID&confirm=$confirm"); + } } diff --git a/module/doc/view/lefttree.html.php b/module/doc/view/lefttree.html.php index c36ff5389c..75de8aebb1 100644 --- a/module/doc/view/lefttree.html.php +++ b/module/doc/view/lefttree.html.php @@ -115,10 +115,10 @@ js::set('isFirstLoad', isset($isFirstLoad) ? $isFirstLoad: '');
  • doc->libDropdown['addSubModule'];?>
  • -
  • rawModule");?>'>doc->libDropdown['editModule'];?>
  • +
  • rawModule");?>'>doc->libDropdown['editModule'];?>
  • -
  • ' target='hiddenwin'>doc->libDropdown['delModule'];?>
  • +
  • ' target='hiddenwin'>doc->libDropdown['delModule'];?>
  • diff --git a/module/tree/control.php b/module/tree/control.php index c026eebbc3..01e4641173 100644 --- a/module/tree/control.php +++ b/module/tree/control.php @@ -387,7 +387,7 @@ class tree extends control if(!empty($_POST)) { $this->tree->update($moduleID); - die(js::reload('parent')); + return print(js::reload('parent')); } $module = $this->tree->getById($moduleID); @@ -509,7 +509,7 @@ class tree extends control if($module->type == 'line') $confirmLang = $this->lang->tree->confirmDeleteLine; if($module->type == 'host') $confirmLang = $this->lang->tree->confirmDeleteHost; if(strpos($this->config->tree->groupTypes, ",$module->type,") !== false) $confirmLang = $this->lang->tree->confirmDeleteGroup; - die(js::confirm($confirmLang, $this->createLink('tree', 'delete', "rootID=$rootID&moduleID=$moduleID&confirm=yes"))); + return print(js::confirm($confirmLang, $this->createLink($this->app->rawModule, $this->app->rawMethod, "rootID=$rootID&moduleID=$moduleID&confirm=yes"))); } else { diff --git a/module/tree/view/edit.html.php b/module/tree/view/edit.html.php index 5be8d6298d..89937310be 100644 --- a/module/tree/view/edit.html.php +++ b/module/tree/view/edit.html.php @@ -36,7 +36,7 @@ if(isset($pageCSS)) css::internal($pageCSS);