Permalink
Browse files

Fix missing plugin name from alert's element string.

  • Loading branch information...
1 parent 61c044c commit c73947a0fb18a8f13b622bb77a676cb3dc0ef252 @jadb jadb committed Feb 27, 2014
Showing with 6 additions and 5 deletions.
  1. +6 −5 Controller/CommonAppController.php
@@ -147,20 +147,21 @@ public function alert($msg, $options = array()) {
$params = array('code' => $options['code'], 'plugin' => $options['plugin']);
// View element
- $element = explode('/', $options['element']);
+ $element = $options['element'];
if (!empty($this->params['prefix'])) {
+ $element = explode('/', $options['element']);
array_push($element, $this->params['prefix'] . '_' . array_pop($element));
+ $element = implode('/', $element);
}
-
- $elementPath = 'View' . DS . 'Elements' . DS . implode('/', $element) . '.ctp';
+
+ $elementPath = 'View' . DS . 'Elements' . DS . $element . '.ctp';
if (!empty($options['plugin']) && CakePlugin::loaded($options['plugin'])) {
+ $element = $options['plugin'] . '.' . $element;
$elementPath = CakePlugin::path($options['plugin']) . $elementPath;
}
if (!is_file($elementPath)) {
$element = $defaults['element'];
- } else {
- $element = implode('/', $element);
}
// Redirect URL

0 comments on commit c73947a

Please sign in to comment.