]> git.mxchange.org Git - core.git/blobdiff - inc/classes/main/response/class_BaseResponse.php
Copyright year updated, converted double->single quotes
[core.git] / inc / classes / main / response / class_BaseResponse.php
index 6eb3e2382e6bbbf3acfec3676280f35c96cf709d..8fc37c14fa7283b82e0102b7a8bddc3a21426fa2 100644 (file)
@@ -2,11 +2,11 @@
 /**
  * A generic request class
  *
- * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2013 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.ship-simu.org
+ * @link               http://www.shipsimu.org
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -50,11 +50,6 @@ class BaseResponse extends BaseFrameworkSystem {
         */
        private $templateInstance = NULL;
 
-       /**
-        * Fatal resolved messages from filters and so on
-        */
-       private $fatalMessages = array();
-
        /**
         * Protected constructor
         *
@@ -125,7 +120,7 @@ class BaseResponse extends BaseFrameworkSystem {
         */
        public final function addFatalMessage ($messageId) {
                // Adds the resolved message id to the fatal message list
-               array_push($this->fatalMessages, $this->getApplicationInstance()->getLanguageInstance()->getMessage($messageId));
+               $this->addFatalMessagePlain($this->getApplicationInstance()->getLanguageInstance()->getMessage($messageId));
        }
 
        /**
@@ -136,7 +131,7 @@ class BaseResponse extends BaseFrameworkSystem {
         */
        public final function addFatalMessagePlain ($message) {
                // Adds the resolved message id to the fatal message list
-               array_push($this->fatalMessages, $message);
+               $this->pushValueToGenericArrayKey('fatal_messages', 'generic', 'message', $message);
        }
 
        /**
@@ -186,12 +181,12 @@ class BaseResponse extends BaseFrameworkSystem {
                }
 
                // Are there some error messages?
-               if (count($this->fatalMessages) == 0) {
+               if ($this->countGenericArrayElements('fatal_messages', 'generic', 'message') == 0) {
                        // Flush the output to the world
                        $this->getWebOutputInstance()->output($this->responseBody);
                } else {
                        // Display all error messages
-                       $this->getApplicationInstance()->handleFatalMessages($this->fatalMessages);
+                       $this->getApplicationInstance()->handleFatalMessages($this->getGenericArrayKey('fatal_messages', 'generic', 'message'));
 
                        // Send the error messages out to the world
                        $this->getWebOutputInstance()->output($this->responseBody);