Skip to content

Commit

Permalink
How about this?
Browse files Browse the repository at this point in the history
  • Loading branch information
highstrike committed Jun 24, 2015
1 parent ef1fc7d commit 8257100
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 11 deletions.
@@ -0,0 +1 @@
<div id="<?php echo $key; ?>Message" class="<?php echo !empty($params['class']) ? $params['class'] : 'message'; ?>"><?php echo $message; ?></div>
Empty file.
4 changes: 2 additions & 2 deletions lib/Cake/Controller/Component/AuthComponent.php
Expand Up @@ -50,7 +50,7 @@ class AuthComponent extends Component {
*
* @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
Expand Down Expand Up @@ -840,7 +840,7 @@ public function flash($message) {
if ($message === false) {
return;
}
$this->Session->setFlash($message, $this->flash['element'], $this->flash['params'], $this->flash['key']);
$this->Flash->set($message, $this->flash);
}

}
1 change: 1 addition & 0 deletions lib/Cake/View/Elements/Flash/default.ctp
@@ -0,0 +1 @@
<div id="<?php echo $key; ?>Message" class="<?php echo !empty($params['class']) ? $params['class'] : 'message'; ?>"><?php echo $message; ?></div>
9 changes: 0 additions & 9 deletions lib/Cake/View/Helper/FlashHelper.php
Expand Up @@ -85,15 +85,6 @@ public function render($key = 'flash', $options = array()) {
$flash = $options + $flash;
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);
}
}

0 comments on commit 8257100

Please sign in to comment.