From 0c452d762738975aeb7503494002020b428632fa Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sat, 5 May 2018 11:37:26 +0900 Subject: [PATCH] =?UTF-8?q?=E9=80=9F=E5=BA=A6=E6=94=B9=E5=96=84=E3=81=AE?= =?UTF-8?q?=E3=81=9F=E3=82=81=E3=81=AE=E4=BF=AE=E6=AD=A3=20=E3=83=BBHash::?= =?UTF-8?q?extract=E3=82=92=E4=BD=BF=E7=94=A8=E3=81=97=E3=81=AA=E3=81=84?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Component/ControlPanelLayoutComponent.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Controller/Component/ControlPanelLayoutComponent.php b/Controller/Component/ControlPanelLayoutComponent.php index 1d6c31d..50c9385 100644 --- a/Controller/Component/ControlPanelLayoutComponent.php +++ b/Controller/Component/ControlPanelLayoutComponent.php @@ -66,17 +66,21 @@ public function beforeRender(Controller $controller) { $controller->set('pluginsMenu', $this->plugins); if (isset($this->settings['plugin'])) { - $plugin = $this->settings['plugin']; + $pluginKey = $this->settings['plugin']; } else { - $plugin = $controller->params['plugin']; + $pluginKey = $controller->params['plugin']; } - - $plugin = Hash::extract($this->plugins, '{n}.Plugin[key=' . $plugin . ']'); - if (isset($plugin[0]['name'])) { + foreach ($this->plugins as $plugin) { + if ($plugin['Plugin']['key'] === $pluginKey) { + $pluginName = $plugin['Plugin']['name']; + break; + } + } + if (!empty($pluginName)) { if (! isset($controller->viewVars['title'])) { - $controller->set('title', $plugin[0]['name']); + $controller->set('title', $pluginName); } - $controller->set('pageTitle', $plugin[0]['name']); + $controller->set('pageTitle', $pluginName); } }