From 27a57e6ee3e26444706aefdc7d6b0ca4b7f70b6e Mon Sep 17 00:00:00 2001 From: wangyidong Date: Tue, 15 Aug 2017 17:04:15 +0800 Subject: [PATCH] * finish task #3158. --- module/custom/control.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/module/custom/control.php b/module/custom/control.php index 913d29c976..9bc6ee8c4b 100644 --- a/module/custom/control.php +++ b/module/custom/control.php @@ -177,6 +177,24 @@ class custom extends control if($_POST) { $this->loadModel('setting')->setItem('system.custom.productProject', $this->post->productProject); + + /* Change block title. */ + $oldConfig = isset($this->config->custom->productProject) ? $this->config->custom->productProject : '0_0'; + $newConfig = $this->post->productProject; + + list($oldProductIndex, $oldProjectIndex) = explode('_', $oldConfig); + list($newProductIndex, $newProjectIndex) = explode('_', $newConfig); + + foreach($this->config->productCommonList as $clientLang => $productCommonList) + { + $this->dao->update(TABLE_BLOCK)->set("`title` = REPLACE(`title`, '{$productCommonList[$oldProductIndex]}', '{$productCommonList[$newProductIndex]}')")->where('source')->eq('product')->exec(); + } + + foreach($this->config->projectCommonList as $clientLang => $projectCommonList) + { + $this->dao->update(TABLE_BLOCK)->set("`title` = REPLACE(`title`, '{$projectCommonList[$oldProjectIndex]}', '{$projectCommonList[$newProjectIndex]}')")->where('source')->eq('project')->exec(); + } + die(js::reload('parent')); }