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); } }