From 70feb52f73861ed3177b8eda0a957c375f811170 Mon Sep 17 00:00:00 2001 From: mattmemmesheimer Date: Thu, 20 Aug 2015 20:19:22 -0500 Subject: [PATCH] Changing the default layout to use FlashComponent::render instead of the deprecated SessionComponent::flash. Changing the flash elements to retain the id attribute that was previously present. Also fixing file permissions on the template files I added. --- app/View/Layouts/default.ctp | 2 +- lib/Cake/View/Elements/Flash/default.ctp | 2 +- lib/Cake/View/Elements/Flash/error.ctp | 2 +- lib/Cake/View/Elements/Flash/success.ctp | 2 +- lib/Cake/View/Helper/FlashHelper.php | 1 + 5 files changed, 5 insertions(+), 4 deletions(-) mode change 100755 => 100644 lib/Cake/View/Elements/Flash/error.ctp mode change 100755 => 100644 lib/Cake/View/Elements/Flash/success.ctp diff --git a/app/View/Layouts/default.ctp b/app/View/Layouts/default.ctp index fb4e9f36e..5815ead6e 100644 --- a/app/View/Layouts/default.ctp +++ b/app/View/Layouts/default.ctp @@ -42,7 +42,7 @@ $cakeVersion = __d('cake_dev', 'CakePHP %s', Configure::version())
- Session->flash(); ?> + Flash->render(); ?> fetch('content'); ?>
diff --git a/lib/Cake/View/Elements/Flash/default.ctp b/lib/Cake/View/Elements/Flash/default.ctp index bc1e2c369..3080c523a 100644 --- a/lib/Cake/View/Elements/Flash/default.ctp +++ b/lib/Cake/View/Elements/Flash/default.ctp @@ -4,4 +4,4 @@ if (!empty($params['class'])) { $class .= ' ' . $params['class']; } ?> -
+
diff --git a/lib/Cake/View/Elements/Flash/error.ctp b/lib/Cake/View/Elements/Flash/error.ctp old mode 100755 new mode 100644 index 6d6f27e6d..376456988 --- a/lib/Cake/View/Elements/Flash/error.ctp +++ b/lib/Cake/View/Elements/Flash/error.ctp @@ -1 +1 @@ -
+
diff --git a/lib/Cake/View/Elements/Flash/success.ctp b/lib/Cake/View/Elements/Flash/success.ctp old mode 100755 new mode 100644 index 4a375e60f..13932bd70 --- a/lib/Cake/View/Elements/Flash/success.ctp +++ b/lib/Cake/View/Elements/Flash/success.ctp @@ -1 +1 @@ -
+
diff --git a/lib/Cake/View/Helper/FlashHelper.php b/lib/Cake/View/Helper/FlashHelper.php index 46dc67ac4..058d19125 100644 --- a/lib/Cake/View/Helper/FlashHelper.php +++ b/lib/Cake/View/Helper/FlashHelper.php @@ -84,6 +84,7 @@ class FlashHelper extends AppHelper { $flash = $options + $flash; CakeSession::delete("Message.$key"); + $flash['key'] = $key; return $this->_View->element($flash['element'], $flash); }