Rewritten a lot double-quotes to single-requotes, removed deprecated exception, some...
[core.git] / inc / classes / main / response / image / class_ImageResponse.php
index c03e6ea6e5519c2672449525fa6634bd68a83328..21344c453136cc225a5bcfd3b40cae26cca70186 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @copyright  Copyright (c) 2007 - 2009 Roland Haeder, this is free software
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -122,7 +122,7 @@ class ImageResponse extends BaseResponse implements Responseable {
                return;
 
                // Now construct the full header
-               $cookieString = $cookieName . "=" . $cookieValue . "; ";
+               $cookieString = $cookieName . '=' . $cookieValue . '; ';
                $cookieString .= "expires=" . date("D, d-F-Y H:i:s", $expires) . " GMT";
                // $cookieString .= "; path=".$path."; domain=".$domain;
 
@@ -149,28 +149,28 @@ class ImageResponse extends BaseResponse implements Responseable {
                $this->getTemplateInstance()->assignApplicationData($this->getApplicationInstance());
 
                // Get the url from config
-               $url = $this->getConfigInstance()->readConfig($configEntry);
+               $url = $this->getConfigInstance()->readConfig($configEntry . "_url");
 
                // Compile the URL
                $url = $this->getTemplateInstance()->compileRawCode($url);
 
-               // Do we have a "http" in front of the URL?
-               if (substr(strtolower($url), 0, 4) != "http") {
+               // Do we have a 'http' in front of the URL?
+               if (substr(strtolower($url), 0, 4) != 'http') {
                        // Is there a / in front of the relative URL?
-                       if (substr($url, 0, 1) == "/") $url = substr($url, 1);
+                       if (substr($url, 0, 1) == '/') $url = substr($url, 1);
 
                        // No, then extend it with our base URL
-                       $url = $this->getConfigInstance()->readConfig('base_url') . "/" . $url;
+                       $url = $this->getConfigInstance()->readConfig('base_url') . '/' . $url;
                } // END - if
 
                // Add redirect header
-               $this->addHeader("Location", $url);
+               $this->addHeader('Location', $url);
 
                // Set correct response status
-               $this->setResponseStatus("301 Moved Permanently");
+               $this->setResponseStatus('301 Moved Permanently');
 
                // Clear the body
-               $this->setResponseBody("");
+               $this->setResponseBody('');
 
                // Flush the result
                $this->flushBuffer();
@@ -213,7 +213,7 @@ class ImageResponse extends BaseResponse implements Responseable {
                // Is the cookie there?
                if (isset($_COOKIE[$cookieName])) {
                        // Then expire it with 20 minutes past
-                       $this->addCookie($cookieName, "", false, (time() - 1200));
+                       $this->addCookie($cookieName, '', false, (time() - 1200));
 
                        // Remove it from array
                        unset($_COOKIE[$cookieName]);