[WIP][TASK] Replace static calls to FlashMessageQueue 25/19225/5
authorWouter Wolters <typo3@wouterwolters.nl>
Sat, 23 Mar 2013 15:41:48 +0000 (16:41 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 29 Mar 2013 11:02:48 +0000 (12:02 +0100)
Change-Id: Iceaaa80bce3ca754b38643be0f0fa82cbaff84ff
Resolves: #46606
Related: #44593
Releases: 6.1
Reviewed-on: https://review.typo3.org/19225
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
13 files changed:
typo3/sysext/backend/Classes/Controller/EditDocumentController.php
typo3/sysext/backend/Classes/Controller/PageLayoutController.php
typo3/sysext/backend/Classes/Form/FormEngine.php
typo3/sysext/backend/Classes/Template/DocumentTemplate.php
typo3/sysext/core/Classes/DataHandling/DataHandler.php
typo3/sysext/core/Classes/Error/ErrorHandler.php
typo3/sysext/core/Classes/FormProtection/BackendFormProtection.php
typo3/sysext/core/Classes/Utility/File/ExtendedFileUtility.php
typo3/sysext/perm/Classes/Controller/PermissionModuleController.php
typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php
typo3/sysext/reports/Classes/Report/Status/ConfigurationStatus.php
typo3/sysext/scheduler/Classes/Controller/SchedulerModuleController.php
typo3/sysext/tstemplate_objbrowser/Classes/Controller/TypoScriptTemplateObjectBrowserModuleFunctionController.php

index 0f11ff9..0fcc709 100644 (file)
@@ -865,8 +865,12 @@ class EditDocumentController {
                                                                        }
                                                                        // Display "is-locked" message:
                                                                        if ($lockInfo = \TYPO3\CMS\Backend\Utility\BackendUtility::isRecordLocked($table, $rec['uid'])) {
-                                                                               $lockedMessage = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', htmlspecialchars($lockInfo['msg']), '', \TYPO3\CMS\Core\Messaging\FlashMessage::WARNING);
-                                                                               \TYPO3\CMS\Core\Messaging\FlashMessageQueue::addMessage($lockedMessage);
+                                                                               $flashMessage = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', htmlspecialchars($lockInfo['msg']), '', \TYPO3\CMS\Core\Messaging\FlashMessage::WARNING);
+                                                                               /** @var $flashMessageService \TYPO3\CMS\Core\Messaging\FlashMessageService */
+                                                                               $flashMessageService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessageService');
+                                                                               /** @var $defaultFlashMessageQueue \TYPO3\CMS\Core\Messaging\FlashMessageQueue */
+                                                                               $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
+                                                                               $defaultFlashMessageQueue->enqueue($flashMessage);
                                                                        }
                                                                        // Combine it all:
                                                                        $editForm .= $panel;
index e31a660..c13e9cf 100644 (file)
@@ -752,8 +752,12 @@ class PageLayoutController {
                                $theCode = $tceforms->printNeededJSFunctions_top() . $theCode . $tceforms->printNeededJSFunctions();
                                // Add warning sign if record was "locked":
                                if ($lockInfo = \TYPO3\CMS\Backend\Utility\BackendUtility::isRecordLocked($this->eRParts[0], $rec['uid'])) {
-                                       $lockedMessage = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', htmlspecialchars($lockInfo['msg']), '', \TYPO3\CMS\Core\Messaging\FlashMessage::WARNING);
-                                       \TYPO3\CMS\Core\Messaging\FlashMessageQueue::addMessage($lockedMessage);
+                                       $flashMessage = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', htmlspecialchars($lockInfo['msg']), '', \TYPO3\CMS\Core\Messaging\FlashMessage::WARNING);
+                                       /** @var $flashMessageService \TYPO3\CMS\Core\Messaging\FlashMessageService */
+                                       $flashMessageService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessageService');
+                                       /** @var $defaultFlashMessageQueue \TYPO3\CMS\Core\Messaging\FlashMessageQueue */
+                                       $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
+                                       $defaultFlashMessageQueue->enqueue($flashMessage);
                                }
                                // Add whole form as a document section:
                                $content .= $this->doc->section('', $theCode);
index 9bcdcb0..ebd6c34 100644 (file)
@@ -4771,7 +4771,11 @@ function ' . $evalData . '(value) {
                        $msgTitle = $this->sL('LLL:EXT:lang/locallang_core.php:error.database_schema_mismatch_title');
                        /** @var $flashMessage \TYPO3\CMS\Core\Messaging\FlashMessage */
                        $flashMessage = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', $msg, $msgTitle, \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, TRUE);
-                       \TYPO3\CMS\Core\Messaging\FlashMessageQueue::addMessage($flashMessage);
+                       /** @var $flashMessageService \TYPO3\CMS\Core\Messaging\FlashMessageService */
+                       $flashMessageService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessageService');
+                       /** @var $defaultFlashMessageQueue \TYPO3\CMS\Core\Messaging\FlashMessageQueue */
+                       $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
+                       $defaultFlashMessageQueue->enqueue($flashMessage);
                        return array();
                }
                // Get label prefix.
index c51bbc9..bc76ab9 100644 (file)
@@ -1875,7 +1875,11 @@ class DocumentTemplate {
                }
                // adding flash messages
                if ($this->showFlashMessages) {
-                       $flashMessages = \TYPO3\CMS\Core\Messaging\FlashMessageQueue::renderFlashMessages();
+                       /** @var $flashMessageService \TYPO3\CMS\Core\Messaging\FlashMessageService */
+                       $flashMessageService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessageService');
+                       /** @var $defaultFlashMessageQueue \TYPO3\CMS\Core\Messaging\FlashMessageQueue */
+                       $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
+                       $flashMessages = $defaultFlashMessageQueue->renderFlashMessages();
                        if (!empty($flashMessages)) {
                                $markerArray['FLASHMESSAGES'] = '<div id="typo3-messages">' . $flashMessages . '</div>';
                                // If there is no dedicated marker for the messages present
index a9d8768..7ebb8f8 100644 (file)
@@ -6868,7 +6868,11 @@ class DataHandler {
                        $log_data = unserialize($row['log_data']);
                        $msg = $row['error'] . ': ' . sprintf($row['details'], $log_data[0], $log_data[1], $log_data[2], $log_data[3], $log_data[4]);
                        $flashMessage = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', htmlspecialchars($msg), '', \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, TRUE);
-                       \TYPO3\CMS\Core\Messaging\FlashMessageQueue::addMessage($flashMessage);
+                       /** @var $flashMessageService \TYPO3\CMS\Core\Messaging\FlashMessageService */
+                       $flashMessageService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessageService');
+                       /** @var $defaultFlashMessageQueue \TYPO3\CMS\Core\Messaging\FlashMessageQueue */
+                       $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
+                       $defaultFlashMessageQueue->enqueue($flashMessage);
                }
                $GLOBALS['TYPO3_DB']->sql_free_result($res_log);
        }
index 600713e..1d5be00 100644 (file)
@@ -153,7 +153,11 @@ class ErrorHandler implements \TYPO3\CMS\Core\Error\ErrorHandlerInterface {
                        // Add error message to the flashmessageQueue
                        if (defined('TYPO3_ERRORHANDLER_MODE') && TYPO3_ERRORHANDLER_MODE == 'debug') {
                                $flashMessage = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', $message, 'PHP ' . $errorLevels[$errorLevel], $severity);
-                               \TYPO3\CMS\Core\Messaging\FlashMessageQueue::addMessage($flashMessage);
+                               /** @var $flashMessageService \TYPO3\CMS\Core\Messaging\FlashMessageService */
+                               $flashMessageService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessageService');
+                               /** @var $defaultFlashMessageQueue \TYPO3\CMS\Core\Messaging\FlashMessageQueue */
+                               $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
+                               $defaultFlashMessageQueue->enqueue($flashMessage);
                        }
                }
                // Don't execute PHP internal error handler
index 79a3760..c7cbdd7 100644 (file)
@@ -120,8 +120,12 @@ class BackendFormProtection extends \TYPO3\CMS\Core\FormProtection\AbstractFormP
         * @return void
         */
        protected function createValidationErrorMessage() {
-               $message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:error.formProtection.tokenInvalid'), '', \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, !(isset($GLOBALS['TYPO3_AJAX']) && $GLOBALS['TYPO3_AJAX'] === TRUE));
-               \TYPO3\CMS\Core\Messaging\FlashMessageQueue::addMessage($message);
+               $flashMessage = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:error.formProtection.tokenInvalid'), '', \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, !(isset($GLOBALS['TYPO3_AJAX']) && $GLOBALS['TYPO3_AJAX'] === TRUE));
+               /** @var $flashMessageService \TYPO3\CMS\Core\Messaging\FlashMessageService */
+               $flashMessageService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessageService');
+               /** @var $defaultFlashMessageQueue \TYPO3\CMS\Core\Messaging\FlashMessageQueue */
+               $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
+               $defaultFlashMessageQueue->enqueue($flashMessage);
        }
 
        /**
index dc1d5f8..aacd1e7 100644 (file)
@@ -306,7 +306,11 @@ class ExtendedFileUtility extends \TYPO3\CMS\Core\Utility\File\BasicFileUtility
                        $logData = unserialize($row['log_data']);
                        $msg = $row['error'] . ': ' . sprintf($row['details'], $logData[0], $logData[1], $logData[2], $logData[3], $logData[4]);
                        $flashMessage = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', $msg, '', \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, TRUE);
-                       \TYPO3\CMS\Core\Messaging\FlashMessageQueue::addMessage($flashMessage);
+                       /** @var $flashMessageService \TYPO3\CMS\Core\Messaging\FlashMessageService */
+                       $flashMessageService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessageService');
+                       /** @var $defaultFlashMessageQueue \TYPO3\CMS\Core\Messaging\FlashMessageQueue */
+                       $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
+                       $defaultFlashMessageQueue->enqueue($flashMessage);
                }
                $GLOBALS['TYPO3_DB']->sql_free_result($res);
        }
index 09eafb7..b4ad6f7 100644 (file)
@@ -303,8 +303,12 @@ class PermissionModuleController {
        public function doEdit() {
                if ($GLOBALS['BE_USER']->workspace != 0) {
                        // Adding section with the permission setting matrix:
-                       $lockedMessage = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', $GLOBALS['LANG']->getLL('WorkspaceWarningText'), $GLOBALS['LANG']->getLL('WorkspaceWarning'), \TYPO3\CMS\Core\Messaging\FlashMessage::WARNING);
-                       \TYPO3\CMS\Core\Messaging\FlashMessageQueue::addMessage($lockedMessage);
+                       $flashMessage = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', $GLOBALS['LANG']->getLL('WorkspaceWarningText'), $GLOBALS['LANG']->getLL('WorkspaceWarning'), \TYPO3\CMS\Core\Messaging\FlashMessage::WARNING);
+                       /** @var $flashMessageService \TYPO3\CMS\Core\Messaging\FlashMessageService */
+                       $flashMessageService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessageService');
+                       /** @var $defaultFlashMessageQueue \TYPO3\CMS\Core\Messaging\FlashMessageQueue */
+                       $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
+                       $defaultFlashMessageQueue->enqueue($flashMessage);
                }
                // Get usernames and groupnames
                $beGroupArray = \TYPO3\CMS\Backend\Utility\BackendUtility::getListGroupNames('title,uid');
index a0e1e6a..84d765e 100644 (file)
@@ -341,8 +341,11 @@ class DatabaseRecordList extends \TYPO3\CMS\Recordlist\RecordList\AbstractDataba
                        $message = sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_web_list.php:missingTcaColumnsMessage', TRUE), $table, $table);
                        $messageTitle = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_web_list.php:missingTcaColumnsMessageTitle', TRUE);
                        $flashMessage = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', $message, $messageTitle, \TYPO3\CMS\Core\Messaging\FlashMessage::WARNING, TRUE);
-                       /** @var \TYPO3\CMS\Core\Messaging\FlashMessage $flashMessage */
-                       \TYPO3\CMS\Core\Messaging\FlashMessageQueue::addMessage($flashMessage);
+                       /** @var $flashMessageService \TYPO3\CMS\Core\Messaging\FlashMessageService */
+                       $flashMessageService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessageService');
+                       /** @var $defaultFlashMessageQueue \TYPO3\CMS\Core\Messaging\FlashMessageQueue */
+                       $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
+                       $defaultFlashMessageQueue->enqueue($flashMessage);
                }
                // Making sure that the fields in the field-list ARE in the field-list from TCA!
                $selectFields = array_intersect($selectFields, $fieldListFields);
index a2a9eb6..b341872 100644 (file)
@@ -288,7 +288,12 @@ class ConfigurationStatus implements \TYPO3\CMS\Reports\StatusProviderInterface
                        $message = $GLOBALS['LANG']->getLL('status_configuration_DeprecationLogDeletionFailed');
                        $severity = \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR;
                }
-               \TYPO3\CMS\Core\Messaging\FlashMessageQueue::addMessage(\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', $message, '', $severity, TRUE));
+               $flashMessage = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', $message, '', $severity, TRUE);
+               /** @var $flashMessageService \TYPO3\CMS\Core\Messaging\FlashMessageService */
+               $flashMessageService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessageService');
+               /** @var $defaultFlashMessageQueue \TYPO3\CMS\Core\Messaging\FlashMessageQueue */
+               $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
+               $defaultFlashMessageQueue->enqueue($flashMessage);
        }
 
 }
index d20f064..775e263 100644 (file)
@@ -1389,8 +1389,12 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
         * @return void
         */
        public function addMessage($message, $severity = \TYPO3\CMS\Core\Messaging\FlashMessage::OK) {
-               $message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', $message, '', $severity);
-               \TYPO3\CMS\Core\Messaging\FlashMessageQueue::addMessage($message);
+               $flashMessage = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', $message, '', $severity);
+               /** @var $flashMessageService \TYPO3\CMS\Core\Messaging\FlashMessageService */
+               $flashMessageService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessageService');
+               /** @var $defaultFlashMessageQueue \TYPO3\CMS\Core\Messaging\FlashMessageQueue */
+               $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
+               $defaultFlashMessageQueue->enqueue($flashMessage);
        }
 
        /**
index a424201..1882296 100644 (file)
@@ -234,23 +234,23 @@ class TypoScriptTemplateObjectBrowserModuleFunctionController extends \TYPO3\CMS
                                                $property = trim($POST['data'][$name]['name']);
                                                if (preg_replace('/[^a-zA-Z0-9_\\.]*/', '', $property) != $property) {
                                                        $badPropertyMessage = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', $GLOBALS['LANG']->getLL('noSpaces') . '<br />' . $GLOBALS['LANG']->getLL('nothingUpdated'), $GLOBALS['LANG']->getLL('badProperty'), \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR);
-                                                       \TYPO3\CMS\Core\Messaging\FlashMessageQueue::addMessage($badPropertyMessage);
+                                                       $this->addFlashMessage($badPropertyMessage);
                                                } else {
                                                        $pline = $name . '.' . $property . ' = ' . trim($POST['data'][$name]['propertyValue']);
                                                        $propertyAddedMessage = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', htmlspecialchars($pline), $GLOBALS['LANG']->getLL('propertyAdded'));
-                                                       \TYPO3\CMS\Core\Messaging\FlashMessageQueue::addMessage($propertyAddedMessage);
+                                                       $this->addFlashMessage($propertyAddedMessage);
                                                        $line .= LF . $pline;
                                                }
                                        } elseif ($POST['update_value']) {
                                                $pline = $name . ' = ' . trim($POST['data'][$name]['value']);
                                                $updatedMessage = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', htmlspecialchars($pline), $GLOBALS['LANG']->getLL('valueUpdated'));
-                                               \TYPO3\CMS\Core\Messaging\FlashMessageQueue::addMessage($updatedMessage);
+                                               $this->addFlashMessage($updatedMessage);
                                                $line .= LF . $pline;
                                        } elseif ($POST['clear_object']) {
                                                if ($POST['data'][$name]['clearValue']) {
                                                        $pline = $name . ' >';
                                                        $objectClearedMessage = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', htmlspecialchars($pline), $GLOBALS['LANG']->getLL('objectCleared'));
-                                                       \TYPO3\CMS\Core\Messaging\FlashMessageQueue::addMessage($objectClearedMessage);
+                                                       $this->addFlashMessage($objectClearedMessage);
                                                        $line .= LF . $pline;
                                                }
                                        }
@@ -354,7 +354,7 @@ class TypoScriptTemplateObjectBrowserModuleFunctionController extends \TYPO3\CMS
                                $theOutput .= $this->pObj->doc->spacer(10);
                        } else {
                                $noTemplateMessage = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', $GLOBALS['LANG']->getLL('noCurrentTemplate'), $GLOBALS['LANG']->getLL('edit'), \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR);
-                               \TYPO3\CMS\Core\Messaging\FlashMessageQueue::addMessage($noTemplateMessage);
+                               $this->addFlashMessage($noTemplateMessage);
                        }
                        // Links:
                        $out = '';
@@ -477,6 +477,20 @@ class TypoScriptTemplateObjectBrowserModuleFunctionController extends \TYPO3\CMS
                return $theOutput;
        }
 
+       /**
+        * Add flash message to queue
+        *
+        * @param \TYPO3\CMS\Core\Messaging\FlashMessage $flasgMessage
+        * @return void
+        */
+       protected function addFlashMessage(\TYPO3\CMS\Core\Messaging\FlashMessage $flashMessage) {
+               /** @var $flashMessageService \TYPO3\CMS\Core\Messaging\FlashMessageService */
+               $flashMessageService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessageService');
+               /** @var $defaultFlashMessageQueue \TYPO3\CMS\Core\Messaging\FlashMessageQueue */
+               $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
+               $defaultFlashMessageQueue->enqueue($flashMessage);
+       }
+
 }
 
 ?>
\ No newline at end of file