From f0e76ff576481d5ebbb1e3b75eab02da4e7fa3e0 Mon Sep 17 00:00:00 2001 From: daitingting Date: Tue, 16 May 2017 13:53:17 +0800 Subject: [PATCH] * Set flow for custom doc menu. --- module/doc/control.php | 5 +++-- module/doc/model.php | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/module/doc/control.php b/module/doc/control.php index 275c9a154c..c6d44995fd 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -576,7 +576,8 @@ class doc extends control */ public function ajaxFixedMenu($libID, $type = 'fixed') { - $customMenus = $this->loadModel('setting')->getItem("owner={$this->app->user->account}&module=common§ion=customMenu&key=doc"); + $customMenuKey = $this->config->global->flow . '_doc'; + $customMenus = $this->loadModel('setting')->getItem("owner={$this->app->user->account}&module=common§ion=customMenu&key={$customMenuKey}"); if($customMenus) $customMenus = json_decode($customMenus); if(empty($customMenus)) { @@ -604,7 +605,7 @@ class doc extends control $customMenu->order = count($customMenus); $customMenu->float = 'right'; if($type == 'fixed') $customMenus[] = $customMenu; - $this->setting->setItem("{$this->app->user->account}.common.customMenu.doc", json_encode($customMenus)); + $this->setting->setItem("{$this->app->user->account}.common.customMenu.{$customMenuKey}", json_encode($customMenus)); die(js::reload('parent')); } diff --git a/module/doc/model.php b/module/doc/model.php index 0cb305d04a..f66ca6648b 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -24,9 +24,10 @@ class docModel extends model */ public function setMenu($libID = 0, $moduleID = 0, $crumb = '') { - if(isset($this->config->customMenu->doc)) + $customMenuKey = $this->config->global->flow . '_doc'; + if(isset($this->config->customMenu->{$customMenuKey})) { - $customMenu = json_decode($this->config->customMenu->doc, true); + $customMenu = json_decode($this->config->customMenu->{$customMenuKey}, true); $menuLibIdList = array(); foreach($customMenu as $i => $menu) { @@ -59,7 +60,7 @@ class docModel extends model $libName .= $lib->name; $customMenu[$i]['link'] = "{$libName}|doc|browse|libID={$menuLibID}"; } - $this->config->customMenu->doc = json_encode($customMenu); + $this->config->customMenu->{$customMenuKey} = json_encode($customMenu); } $this->app->loadLang('project');