How about this?

This commit is contained in:
Highstrike 2015-06-24 15:46:48 +03:00
parent ef1fc7dfef
commit 8257100f54
5 changed files with 4 additions and 11 deletions

View file

@ -0,0 +1 @@
<div id="<?php echo $key; ?>Message" class="<?php echo !empty($params['class']) ? $params['class'] : 'message'; ?>"><?php echo $message; ?></div>

View file

@ -50,7 +50,7 @@ class AuthComponent extends Component {
* *
* @var array * @var array
*/ */
public $components = array('Session', 'RequestHandler'); public $components = array('Session', 'Flash', 'RequestHandler');
/** /**
* An array of authentication objects to use for authenticating users. You can configure * An array of authentication objects to use for authenticating users. You can configure
@ -840,7 +840,7 @@ class AuthComponent extends Component {
if ($message === false) { if ($message === false) {
return; return;
} }
$this->Session->setFlash($message, $this->flash['element'], $this->flash['params'], $this->flash['key']); $this->Flash->set($message, $this->flash);
} }
} }

View file

@ -0,0 +1 @@
<div id="<?php echo $key; ?>Message" class="<?php echo !empty($params['class']) ? $params['class'] : 'message'; ?>"><?php echo $message; ?></div>

View file

@ -85,15 +85,6 @@ class FlashHelper extends AppHelper {
$flash = $options + $flash; $flash = $options + $flash;
CakeSession::delete("Message.$key"); CakeSession::delete("Message.$key");
// backwards compatibility with Session->setFlash()
if ($flash['element'] === 'default') {
$class = 'message';
if (!empty($flash['params']['class'])) {
$class = $flash['params']['class'];
}
return '<div id="' . $key . 'Message" class="' . $class . '">' . $flash['message'] . '</div>';
}
return $this->_View->element($flash['element'], $flash); return $this->_View->element($flash['element'], $flash);
} }
} }