Fixes for image generation
authorRoland Häder <roland@mxchange.org>
Fri, 19 Sep 2008 19:10:47 +0000 (19:10 +0000)
committerRoland Häder <roland@mxchange.org>
Fri, 19 Sep 2008 19:10:47 +0000 (19:10 +0000)
43 files changed:
.gitattributes
application/blog/class_ApplicationHelper.php
application/blog/config.php
application/blog/init.php
application/selector/class_ApplicationHelper.php
application/selector/class_ApplicationSelector.php
application/selector/config.php [new file with mode: 0644]
application/selector/init.php
application/ship-simu/class_ApplicationHelper.php
application/ship-simu/config.php
application/ship-simu/init.php
application/ship-simu/main/commands/web/class_WebShipsimuProfileCommand.php
application/ship-simu/main/registration/class_ShipSimuRegistration.php
application/todo/class_ApplicationHelper.php
application/todo/config.php
application/todo/init.php
inc/classes/main/class_BaseFrameworkSystem.php
inc/classes/main/commands/web/class_WebLoginFailedCommand.php
inc/classes/main/commands/web/class_WebLogoutDoneCommand.php
inc/classes/main/criteria/class_SearchCriteria.php
inc/classes/main/database/databases/class_LocalFileDatabase.php
inc/classes/main/images/class_BaseImage.php
inc/classes/main/images/extended/class_PngImage.php
inc/classes/main/mailer/debug/class_DebugMailer.php
inc/classes/main/output/class_ConsoleOutput.php
inc/classes/main/request/class_HttpRequest.php
inc/classes/main/response/class_BaseResponse.php [new file with mode: 0644]
inc/classes/main/response/class_HttpResponse.php [deleted file]
inc/classes/main/response/class_ImageResponse.php [deleted file]
inc/classes/main/response/http/.htaccess [new file with mode: 0644]
inc/classes/main/response/http/class_HttpResponse.php [new file with mode: 0644]
inc/classes/main/response/image/.htaccess [new file with mode: 0644]
inc/classes/main/response/image/class_ImageResponse.php [new file with mode: 0644]
inc/classes/main/result/class_DatabaseResult.php
inc/classes/main/template/class_BaseTemplateEngine.php
inc/classes/third_party/api/wernisportal/class_WernisApi.php
inc/config.php
inc/database.php
inc/database/lib-local.php
inc/loader/class_ClassLoader.php
inc/selector.php
index.php
templates/de/code/header.ctp

index ff8b2faf5d2a06a77bb5d455eba9439f63e75989..aaa38f09a24f9908aac6637648f1495d2402a3ce 100644 (file)
@@ -46,6 +46,7 @@ application/blog/templates/images/de/image/code_captcha.itp -text
 application/selector/.htaccess -text
 application/selector/class_ApplicationHelper.php -text
 application/selector/class_ApplicationSelector.php -text
 application/selector/.htaccess -text
 application/selector/class_ApplicationHelper.php -text
 application/selector/class_ApplicationSelector.php -text
+application/selector/config.php -text
 application/selector/debug.php -text
 application/selector/exceptions.php -text
 application/selector/init.php -text
 application/selector/debug.php -text
 application/selector/exceptions.php -text
 application/selector/init.php -text
@@ -685,8 +686,11 @@ inc/classes/main/resolver/controller/image/class_ImageControllerResolver.php -te
 inc/classes/main/resolver/controller/web/.htaccess -text
 inc/classes/main/resolver/controller/web/class_WebControllerResolver.php -text
 inc/classes/main/response/.htaccess -text
 inc/classes/main/resolver/controller/web/.htaccess -text
 inc/classes/main/resolver/controller/web/class_WebControllerResolver.php -text
 inc/classes/main/response/.htaccess -text
-inc/classes/main/response/class_HttpResponse.php -text
-inc/classes/main/response/class_ImageResponse.php -text
+inc/classes/main/response/class_BaseResponse.php -text
+inc/classes/main/response/http/.htaccess -text
+inc/classes/main/response/http/class_HttpResponse.php -text
+inc/classes/main/response/image/.htaccess -text
+inc/classes/main/response/image/class_ImageResponse.php -text
 inc/classes/main/result/.htaccess -text
 inc/classes/main/result/class_DatabaseResult.php -text
 inc/classes/main/rng/.htaccess -text
 inc/classes/main/result/.htaccess -text
 inc/classes/main/result/class_DatabaseResult.php -text
 inc/classes/main/rng/.htaccess -text
index 0746faa6668d6ae21ebc5835f114db285438a39f..c3334fd07c6c5e4ef5bcc12ac7f3b2abb87ff87d 100644 (file)
@@ -229,6 +229,17 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica
                        print("MSG:".$message."<br />\n");
                } // END - if
        }
                        print("MSG:".$message."<br />\n");
                } // END - if
        }
+
+       /**
+        * Assigns application-depending data
+        *
+        * @param       $templateInstance       An instance of a template engine
+        * @return      void
+        */
+       public function assignExtraTemplateData (CompileableTemplate $templateInstance) {
+               // Assign charset
+               $templateInstance->assignConfigVariable('header_charset');
+       }
 }
 
 // [EOF]
 }
 
 // [EOF]
index 5ceea919850f83b5cf79485eab2386fc590dd68c..f06094d50d4d7f8c46ed6a789dac134e63da7f90 100644 (file)
@@ -25,6 +25,9 @@
 // Get a configuration instance for shorter lines
 $cfg = FrameworkConfiguration::getInstance();
 
 // Get a configuration instance for shorter lines
 $cfg = FrameworkConfiguration::getInstance();
 
+// CFG: HEADER-CHARSET
+$cfg->setConfigEntry('header_charset', "utf-8");
+
 // CFG: DEFAULT-WEB-COMMAND
 $cfg->setConfigEntry('default_web_command', "home");
 
 // CFG: DEFAULT-WEB-COMMAND
 $cfg->setConfigEntry('default_web_command', "home");
 
index 4043f37ee404b854276357e047d10a629900e6cb..fa7aee2cfa0b057e2873aea05883a0645b6d8b62 100644 (file)
@@ -33,6 +33,9 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
+// Get config instance
+$cfg = FrameworkConfiguration::getInstance();
+
 // Initialize output system
 require($cfg->readConfig('base_path') . 'inc/output.php');
 
 // Initialize output system
 require($cfg->readConfig('base_path') . 'inc/output.php');
 
index aa297ccd41068a2b2bd17c879b97a74459ea59f1..d51ca02ce0454f75e5f1cd1a0973c7d2961ee6c9 100644 (file)
@@ -199,6 +199,17 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica
        public function handleFatalMessages (array $messageList) {
                die("<pre>".print_r($messageList, true)."</pre>");
        }
        public function handleFatalMessages (array $messageList) {
                die("<pre>".print_r($messageList, true)."</pre>");
        }
+
+       /**
+        * Assigns application-depending data
+        *
+        * @param       $templateInstance       An instance of a template engine
+        * @return      void
+        */
+       public function assignExtraTemplateData (CompileableTemplate $templateInstance) {
+               // Assign charset
+               $templateInstance->assignConfigVariable('header_charset');
+       }
 }
 
 // [EOF]
 }
 
 // [EOF]
index 1f664a66f85adec338d7057d5166523ddf77d34e..8d6d914463151236089ab5882313b0bb4d3b2749 100644 (file)
@@ -187,10 +187,7 @@ class ApplicationSelector extends BaseFrameworkSystem {
         */
        public function readApplicationDirectory () {
                // Generate the base path for all applications
         */
        public function readApplicationDirectory () {
                // Generate the base path for all applications
-               $appBasePath = sprintf("%s%s/",
-                       $this->getConfigInstance()->readConfig('base_path'),
-                       $this->getConfigInstance()->readConfig('application_path')
-               );
+               $appBasePath = $this->getConfigInstance()->readConfig('application_path');
 
                // Add the selector path to the ignore list
                $this->addDirIgnoreList($this->getConfigInstance()->readConfig('selector_path'));
 
                // Add the selector path to the ignore list
                $this->addDirIgnoreList($this->getConfigInstance()->readConfig('selector_path'));
@@ -198,7 +195,7 @@ class ApplicationSelector extends BaseFrameworkSystem {
                // Get a directory pointer for the application path
                $dirInstance = FrameworkDirectoryPointer::createFrameworkDirectoryPointer($appBasePath);
 
                // Get a directory pointer for the application path
                $dirInstance = FrameworkDirectoryPointer::createFrameworkDirectoryPointer($appBasePath);
 
-               // Backup and remove the 'app' from global name space
+               // Backup and remove the 'app' from local name space
                /*$appBackup = $app;
                unset($app);*/
 
                /*$appBackup = $app;
                unset($app);*/
 
diff --git a/application/selector/config.php b/application/selector/config.php
new file mode 100644 (file)
index 0000000..62cd1b7
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+/**
+ * Additional/overwritten configuration parts
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+// Get a configuration instance for shorter lines
+$cfg = FrameworkConfiguration::getInstance();
+
+// CFG: HEADER-CHARSET
+$cfg->setConfigEntry('header_charset', "utf-8");
+
+// CFG: DEFAULT-WEB-COMMAND
+$cfg->setConfigEntry('default_web_command', "home");
+
+// CFG: DEFAULT-IMAGE-COMMAND
+$cfg->setConfigEntry('default_image_command', "build");
+
+// CFG: PAGE-WITH-NEWS
+$cfg->setConfigEntry('page_with_news', "home");
+
+// CFG: FORM-ACTION
+$cfg->setConfigEntry('form_action', "index.php?app={?app_short_name?}&amp;page=do_form");
+
+// CFG: FORM-METHOD
+$cfg->setConfigEntry('form_method', "post");
+
+// CFG: FORM-TARGET
+$cfg->setConfigEntry('form_target', "_self");
+
+// [EOF]
+?>
index cac841df5223d9364e01be54ec7e47aaf3e115df..71893f0d51b84dcae7c86ed88e2cf9ff36a68f2f 100644 (file)
@@ -25,6 +25,9 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
+// Get config instance
+$cfg = FrameworkConfiguration::getInstance();
+
 // Initialize output system
 require($cfg->readConfig('base_path') . 'inc/output.php');
 
 // Initialize output system
 require($cfg->readConfig('base_path') . 'inc/output.php');
 
index 43cac8875ee8dd3b00f605b940da6f9ce5ed83ba..9f06072f79428ee1132e0096adf704c0a3009467 100644 (file)
@@ -229,6 +229,17 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica
                        print("MSG:".$message."<br />\n");
                } // END - if
        }
                        print("MSG:".$message."<br />\n");
                } // END - if
        }
+
+       /**
+        * Assigns application-depending data
+        *
+        * @param       $templateInstance       An instance of a template engine
+        * @return      void
+        */
+       public function assignExtraTemplateData (CompileableTemplate $templateInstance) {
+               // Assign charset
+               $templateInstance->assignConfigVariable('header_charset');
+       }
 }
 
 // [EOF]
 }
 
 // [EOF]
index 995707f7e29201a4eecbfd48626f80cd726494a8..84c14b6d869d486e597006b0a9c578ac3108c193 100644 (file)
@@ -25,6 +25,9 @@
 // Get a configuration instance for shorter lines
 $cfg = FrameworkConfiguration::getInstance();
 
 // Get a configuration instance for shorter lines
 $cfg = FrameworkConfiguration::getInstance();
 
+// CFG: HEADER-CHARSET
+$cfg->setConfigEntry('header_charset', "utf-8");
+
 // CFG: DEFAULT-WEB-COMMAND
 $cfg->setConfigEntry('default_web_command', "home");
 
 // CFG: DEFAULT-WEB-COMMAND
 $cfg->setConfigEntry('default_web_command', "home");
 
index 548894c981ed7b387453184bd111ae43b6d57c88..7b65cae15d40085de6d9e82e81395a42a75f9f79 100644 (file)
@@ -33,6 +33,9 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
+// Get config instance
+$cfg = FrameworkConfiguration::getInstance();
+
 // Initialize output system
 require($cfg->readConfig('base_path') . 'inc/output.php');
 
 // Initialize output system
 require($cfg->readConfig('base_path') . 'inc/output.php');
 
index b9d0cd7a0a3ec37c1c1e2ee8663277093dc710b6..1bb449a5e025c75c4d7ab6de6bfbf30a3158ba3b 100644 (file)
@@ -87,7 +87,7 @@ class WebShipsimuProfileCommand extends BaseCommand implements Commandable {
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Make sure only allowed values are comming through
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Make sure only allowed values are comming through
-               foreach ($this->allowedData as $alias=>$element) {
+               foreach ($this->allowedData as $alias => $element) {
                        // Get data
                        $data = $requestInstance->getRequestElement($element);
 
                        // Get data
                        $data = $requestInstance->getRequestElement($element);
 
index a043056c6ad43ccb6755c404bd8135b0ed343012..31e6e6364de589e63fbf13777fede9daa90af813 100644 (file)
@@ -163,7 +163,7 @@ class ShipSimuRegistration extends BaseRegistration {
                } // END - if
 
                // Add a lot elements to the dataset criteria
                } // END - if
 
                // Add a lot elements to the dataset criteria
-               foreach ($this->criteriaElements as $alias=>$element) {
+               foreach ($this->criteriaElements as $alias => $element) {
                        // Do we have an alias?
                        if (is_string($alias)) {
                                // Yes, so use it
                        // Do we have an alias?
                        if (is_string($alias)) {
                                // Yes, so use it
@@ -181,7 +181,7 @@ class ShipSimuRegistration extends BaseRegistration {
                } // END - foreach
 
                // Mark the username as unique key
                } // END - foreach
 
                // Mark the username as unique key
-               $criteriaInstance->setUniqueKey('username');
+               $criteriaInstance->setUniqueKey(UserDatabaseWrapper::DB_COLUMN_USERNAME);
 
                // Add account status as configured
                $criteriaInstance->addConfiguredCriteria(UserDatabaseWrapper::DB_COLUMN_USER_STATUS, $configEntry);
 
                // Add account status as configured
                $criteriaInstance->addConfiguredCriteria(UserDatabaseWrapper::DB_COLUMN_USER_STATUS, $configEntry);
index ccedad679ef916a34bd0e8f32ebe4d91c43a5184..47680fbac63434b64f227aa7ecb68965b417a400 100644 (file)
@@ -229,6 +229,17 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica
                        print("MSG:".$message."<br />\n");
                } // END - if
        }
                        print("MSG:".$message."<br />\n");
                } // END - if
        }
+
+       /**
+        * Assigns application-depending data
+        *
+        * @param       $templateInstance       An instance of a template engine
+        * @return      void
+        */
+       public function assignExtraTemplateData (CompileableTemplate $templateInstance) {
+               // Assign charset
+               $templateInstance->assignConfigVariable('header_charset');
+       }
 }
 
 // [EOF]
 }
 
 // [EOF]
index a1a45445c0a48e7fe0e1c991d7283c549d28e1bb..89e52e1053138ae6eb33bc6c0a1cefba6072d122 100644 (file)
@@ -25,6 +25,9 @@
 // Get a configuration instance for shorter lines
 $cfg = FrameworkConfiguration::getInstance();
 
 // Get a configuration instance for shorter lines
 $cfg = FrameworkConfiguration::getInstance();
 
+// CFG: HEADER-CHARSET
+$cfg->setConfigEntry('header_charset', "utf-8");
+
 // CFG: DEFAULT-WEB-COMMAND
 $cfg->setConfigEntry('default_web_command', "home");
 
 // CFG: DEFAULT-WEB-COMMAND
 $cfg->setConfigEntry('default_web_command', "home");
 
index 3f7a8857ad81d96052048d271ce7dcc9a936c5b5..c8d19e32ee8c750503426332405023da04dfd620 100644 (file)
@@ -33,6 +33,9 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
+// Get config instance
+$cfg = FrameworkConfiguration::getInstance();
+
 // Initialize output system
 require($cfg->readConfig('base_path') . 'inc/output.php');
 
 // Initialize output system
 require($cfg->readConfig('base_path') . 'inc/output.php');
 
index 061b2f4da45953b8baae6f7db1d548fd3e4fb069..7e461ac820071fde42e846ae1b7f2e79adf211be 100644 (file)
@@ -718,8 +718,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                } // END - if
 
                // Generate FQFN for all application templates
                } // END - if
 
                // Generate FQFN for all application templates
-               $fqfn = sprintf("%s%s/%s/%s",
-                       $this->getConfigInstance()->readConfig('base_path'),
+               $fqfn = sprintf("%s%s/%s",
                        $this->getConfigInstance()->readConfig('application_path'),
                        strtolower($appInstance->getAppShortName()),
                        $this->getConfigInstance()->readConfig('tpl_base_path')
                        $this->getConfigInstance()->readConfig('application_path'),
                        strtolower($appInstance->getAppShortName()),
                        $this->getConfigInstance()->readConfig('tpl_base_path')
@@ -892,7 +891,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                } // END - if
 
                // Add line number to the code
                } // END - if
 
                // Add line number to the code
-               foreach (explode("\n", $phpCode) as $lineNo=>$code) {
+               foreach (explode("\n", $phpCode) as $lineNo => $code) {
                        // Add line numbers
                        $markedCode .= sprintf("<span id=\"code_line\">%s</span>: %s\n",
                                ($lineNo + 1),
                        // Add line numbers
                        $markedCode .= sprintf("<span id=\"code_line\">%s</span>: %s\n",
                                ($lineNo + 1),
index 9981133487d64b8cb2a9485617bb03694ee1104e..7c74d7bd2735a999fe68dcf75743a5834f1b9c3d 100644 (file)
@@ -63,6 +63,9 @@ class WebLoginFailedCommand extends BaseCommand implements Commandable {
                // Prepare a template instance
                $templateInstance = $this->prepareTemplateInstance($appInstance);
 
                // Prepare a template instance
                $templateInstance = $this->prepareTemplateInstance($appInstance);
 
+               // Assign application data with template engine
+               $templateInstance->assignApplicationData($appInstance);
+
                // Load the master template
                $masterTemplate = $appInstance->getMasterTemplate();
 
                // Load the master template
                $masterTemplate = $appInstance->getMasterTemplate();
 
index 15ecb706881634d80a72fa310b4d8adbb9271ad4..bbb7f2f702f93e2afe91c0a63dc9f62b7394af2c 100644 (file)
@@ -63,6 +63,9 @@ class WebLogoutDoneCommand extends BaseCommand implements Commandable {
                // Prepare a template instance
                $templateInstance = $this->prepareTemplateInstance($appInstance);
 
                // Prepare a template instance
                $templateInstance = $this->prepareTemplateInstance($appInstance);
 
+               // Assign application data
+               $templateInstance->assignApplicationData($appInstance);
+
                // Load the master template
                $masterTemplate = $appInstance->getMasterTemplate();
 
                // Load the master template
                $masterTemplate = $appInstance->getMasterTemplate();
 
index b9f27db7b08859e83633d6ee3bec2ed3e0765f52..c95d853bfd07b67bbc7f518317300b1b3208cfe0 100644 (file)
@@ -188,9 +188,9 @@ class SearchCriteria extends BaseFrameworkSystem implements LocalSearchCriteria
                $counted = 0;
 
                // Walk through all entries
                $counted = 0;
 
                // Walk through all entries
-               foreach ($entryArray as $key=>$entry) {
+               foreach ($entryArray as $key => $entry) {
                        // Then walk through all search criteria
                        // Then walk through all search criteria
-                       foreach ($this->searchCriteria as $criteriaKey=>$criteriaValue) {
+                       foreach ($this->searchCriteria as $criteriaKey => $criteriaValue) {
                                // Is the element found and does it match?
                                if (($key == $criteriaKey) && ($criteriaValue == $entry)) {
                                        // Then count this one up
                                // Is the element found and does it match?
                                if (($key == $criteriaKey) && ($criteriaValue == $entry)) {
                                        // Then count this one up
index a8cda7430d8f92bd8366a49fde3247624024573d..25cf9389f68b7708182e3767fedece739e04d8ec 100644 (file)
@@ -385,7 +385,7 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
                                // Is this an array?
                                if (is_array($dataArray)) {
                                        // Search in the criteria with FMFW (First Matches, First Wins)
                                // Is this an array?
                                if (is_array($dataArray)) {
                                        // Search in the criteria with FMFW (First Matches, First Wins)
-                                       foreach ($dataArray as $key=>$value) {
+                                       foreach ($dataArray as $key => $value) {
                                                // Get criteria element
                                                $criteria = $criteriaInstance->getCriteriaElemnent($key);
 
                                                // Get criteria element
                                                $criteria = $criteriaInstance->getCriteriaElemnent($key);
 
@@ -513,7 +513,7 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
                                // Is this an array?
                                if (is_array($dataArray)) {
                                        // Search in the criteria with FMFW (First Matches, First Wins)
                                // Is this an array?
                                if (is_array($dataArray)) {
                                        // Search in the criteria with FMFW (First Matches, First Wins)
-                                       foreach ($dataArray as $key=>$value) {
+                                       foreach ($dataArray as $key => $value) {
                                                // Get criteria element
                                                $criteria = $searchInstance->getCriteriaElemnent($key);
 
                                                // Get criteria element
                                                $criteria = $searchInstance->getCriteriaElemnent($key);
 
@@ -531,7 +531,7 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
                                                        } // END - if
 
                                                        // Entry found, so update it
                                                        } // END - if
 
                                                        // Entry found, so update it
-                                                       foreach ($criteriaArray as $criteriaKey=>$criteriaValue) {
+                                                       foreach ($criteriaArray as $criteriaKey => $criteriaValue) {
                                                                $dataArray[$criteriaKey] = $criteriaValue;
                                                        } // END - foreach
 
                                                                $dataArray[$criteriaKey] = $criteriaValue;
                                                        } // END - foreach
 
index 7c1e0891cd92102079a0a7c5958aaff73469e87b..7f667cde4a48e487d69789dffbdf59532435c32c 100644 (file)
@@ -469,10 +469,10 @@ class BaseImage extends BaseFrameworkSystem implements Registerable {
                $this->setBlue($blue);
 
                // Get a pointer for background color
                $this->setBlue($blue);
 
                // Get a pointer for background color
-               $backColor = imagecolorallocate($this->imageResource, $red, $green, $blue);
+               $backColor = imagecolorallocate($this->getImageResource(), $red, $green, $blue);
 
                // Fill the image
 
                // Fill the image
-               imagefill($this->imageResource, 0, 0, $backColor);
+               imagefill($this->getImageResource(), 0, 0, $backColor);
 
                // Compile foreground colors
                $red   = $templateInstance->compileRawCode($this->foregroundColor['red']);
 
                // Compile foreground colors
                $red   = $templateInstance->compileRawCode($this->foregroundColor['red']);
@@ -486,7 +486,7 @@ class BaseImage extends BaseFrameworkSystem implements Registerable {
                $this->setBlue($blue);
 
                // Get a pointer for foreground color
                $this->setBlue($blue);
 
                // Get a pointer for foreground color
-               $foreColor = imagecolorallocate($this->imageResource, $red, $green, $blue);
+               $foreColor = imagecolorallocate($this->getImageResource(), $red, $green, $blue);
 
                switch ($this->groupable) {
                        case "single": // Single image string
 
                switch ($this->groupable) {
                        case "single": // Single image string
@@ -502,7 +502,7 @@ class BaseImage extends BaseFrameworkSystem implements Registerable {
                                $size = $templateInstance->compileRawCode($this->getFontSize());
 
                                // Set the image string
                                $size = $templateInstance->compileRawCode($this->getFontSize());
 
                                // Set the image string
-                               imagestring($this->imageResource, $size, $x, $y, $imageString, $foreColor);
+                               imagestring($this->getImageResource(), $size, $x, $y, $imageString, $foreColor);
                                break;
 
                        case "groupable": // More than one string allowed
                                break;
 
                        case "groupable": // More than one string allowed
@@ -521,7 +521,7 @@ class BaseImage extends BaseFrameworkSystem implements Registerable {
 
                                        // Set the image string
                                        //* DEBUG: */ echo __METHOD__.": size={$size}, x={$x}, y={$y}, string={$imageString}<br />\n";
 
                                        // Set the image string
                                        //* DEBUG: */ echo __METHOD__.": size={$size}, x={$x}, y={$y}, string={$imageString}<br />\n";
-                                       imagestring($this->imageResource, $size, $x, $y, $imageString, $foreColor);
+                                       imagestring($this->getImageResource(), $size, $x, $y, $imageString, $foreColor);
                                } // END - foreach
                                break;
                }
                                } // END - foreach
                                break;
                }
index f8ee28b8f5b3a28f6d6c982edc5f7e78cdc3aa0b..8b0332099fef9479c671f4e2e5aefb9b2deb73d4 100644 (file)
@@ -64,6 +64,12 @@ class PngImage extends BaseImage {
                // Get a file name for our image
                $cacheFile = $this->getTemplateInstance()->getImageCacheFqfn();
 
                // Get a file name for our image
                $cacheFile = $this->getTemplateInstance()->getImageCacheFqfn();
 
+               // Does it exist?
+               if (file_exists($cacheFile)) {
+                       // Remove it
+                       @unlink($cacheFile);
+               } // END - if
+
                // Finish the image and send it to a cache file
                imagepng($this->getImageResource(), $cacheFile, 9, PNG_ALL_FILTERS);
        }
                // Finish the image and send it to a cache file
                imagepng($this->getImageResource(), $cacheFile, 9, PNG_ALL_FILTERS);
        }
index ffc3fc6ea81bd5eb17ff5fdfcc81e5108771f222..042ee69194122982abbf123343e0e495f9a0bfd4 100644 (file)
@@ -85,13 +85,13 @@ class DebugMailer extends BaseMailer implements DeliverableMail {
                                $templateInstance->assignVariable('subject', $this->getSubjectLine());
 
                                // Walk through all variables, first config to assign them
                                $templateInstance->assignVariable('subject', $this->getSubjectLine());
 
                                // Walk through all variables, first config to assign them
-                               foreach ($recipientList['config_vars'] as $variable=>$dummy) {
+                               foreach ($recipientList['config_vars'] as $variable => $dummy) {
                                        // Load the config value and set it
                                        $templateInstance->assignConfigVariable($variable);
                                } // END - if
 
                                // Now do the same with the values but ask the "value instance" instead!
                                        // Load the config value and set it
                                        $templateInstance->assignConfigVariable($variable);
                                } // END - if
 
                                // Now do the same with the values but ask the "value instance" instead!
-                               foreach ($recipientList['value_vars'] as $variable=>$dummy) {
+                               foreach ($recipientList['value_vars'] as $variable => $dummy) {
                                        // Is the value instance there?
                                        if (!isset($recipientList['values'][$variable])) {
                                                // Throw exception
                                        // Is the value instance there?
                                        if (!isset($recipientList['values'][$variable])) {
                                                // Throw exception
index b1cae5c408f77eee0c7816b72f768ed2720f54c0..bcc1fc5eb8d91bc0674fcb25c0b58a2c1c73e3a0 100644 (file)
@@ -90,7 +90,7 @@ class ConsoleOutput extends BaseFrameworkSystem implements OutputStreamer {
        public final function output ($outStream=false) {
                if ($outStream === false) {
                        // Output something here...
        public final function output ($outStream=false) {
                if ($outStream === false) {
                        // Output something here...
-                       foreach ($this->vars as $var=>$value) {
+                       foreach ($this->vars as $var => $value) {
                                $this->output("var=".$var.", value=".$value."");
                        }
                } else {
                                $this->output("var=".$var.", value=".$value."");
                        }
                } else {
index a046f185c689e055a03a777f26e0cd3a566659fb..0241cfc19f92e29a1cb4b20c268369883780b9cb 100644 (file)
@@ -72,8 +72,8 @@ class HttpRequest extends BaseFrameworkSystem implements Requestable {
         * @return      void
         */
        public function prepareRequestData () {
         * @return      void
         */
        public function prepareRequestData () {
-               // Copy the $_REQUEST array
-               $this->requestData = $_REQUEST;
+               // Copy GET then POST data
+               $this->requestData = array_merge($_GET, $_POST);
        }
 
        /**
        }
 
        /**
@@ -124,6 +124,7 @@ class HttpRequest extends BaseFrameworkSystem implements Requestable {
         * @return      void
         */
        public function setRequestElement ($element, $value) {
         * @return      void
         */
        public function setRequestElement ($element, $value) {
+               error_log(__METHOD__.":{$element}={$value}");
                $this->requestData[$element] = $value;
        }
 
                $this->requestData[$element] = $value;
        }
 
diff --git a/inc/classes/main/response/class_BaseResponse.php b/inc/classes/main/response/class_BaseResponse.php
new file mode 100644 (file)
index 0000000..2ecfaa2
--- /dev/null
@@ -0,0 +1,200 @@
+<?php
+/**
+ * A generic request class
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * The extended headers are taken from phpMyAdmin setup tool, written by
+ * Michal Cihar <michal@cihar.com>, licensed under GNU GPL 2.0.
+ */
+class BaseResponse extends BaseFrameworkSystem {
+       /**
+        * Response status
+        */
+       private $responseStatus = "200 OK";
+
+       /**
+        * Array with all headers
+        */
+       private $responseHeaders = array();
+
+       /**
+        * Cookies we shall sent out
+        */
+       private $cookies = array();
+
+       /**
+        * Body of the response
+        */
+       private $responseBody = "";
+
+       /**
+        * Instance of the template engine
+        */
+       private $templateInstance = null;
+
+       /**
+        * Fatal resolved messages from filters and so on
+        */
+       private $fatalMessages = array();
+
+       /**
+        * Protected constructor
+        *
+        * @param       $className      Name of the concrete response
+        * @return      void
+        */
+       protected function __construct ($className) {
+               // Call parent constructor
+               parent::__construct($className);
+
+               // Clean up a little
+               $this->removeNumberFormaters();
+               $this->removeSystemArray();
+       }
+
+       /**
+        * Setter for status
+        *
+        * @param       $status         New response status
+        * @return      void
+        */
+       public final function setResponseStatus ($status) {
+               $this->responseStatus = (string) $status;
+       }
+
+       /**
+        * Add header element
+        *
+        * @param       $name   Name of header element
+        * @param       $value  Value of header element
+        * @return      void
+        */
+       public final function addHeader ($name, $value) {
+               $this->responseHeaders[$name] = $value;
+       }
+
+       /**
+        * Reset the header array
+        *
+        * @return      void
+        */
+       public final function resetResponseHeaders () {
+               $this->responseHeaders = array();
+       }
+
+       /**
+        * "Writes" data to the response body
+        *
+        * @param       $output         Output we shall sent in the HTTP response
+        * @return      void
+        */
+       public final function writeToBody ($output) {
+               $this->responseBody .= $output;
+       }
+
+       /**
+        * Sets the response body to something new
+        *
+        * @param       $output         Output we shall sent in the HTTP response
+        * @return      void
+        */
+       public final function setResponseBody ($output) {
+               $this->responseBody = $output;
+       }
+
+       /**
+        * Adds a fatal message id to the response. The added messages can then be
+        * processed and outputed to the world
+        *
+        * @param       $messageId      The message id we shall add
+        * @return      void
+        */
+       public final function addFatalMessage ($messageId) {
+               // Adds the resolved message id to the fatal message list
+               $this->fatalMessages[] = $this->getApplicationInstance()->getLanguageInstance()->getMessage($messageId);
+       }
+
+       /**
+        * Flushs the cached HTTP response to the outer world
+        *
+        * @param       $force  Wether we shall force the output or abort if headers are
+        *                                      already sent with an exception
+        * @return      void
+        * @throws      ResponseHeadersAlreadySentException             Thrown if headers are
+        *                                                                                                      already sent
+        */
+       public function flushBuffer ($force = false) {
+               if ((headers_sent()) && (!$force)) {
+                       // Headers are already sent!
+                       throw new ResponseHeadersAlreadySentException($this, self::EXCEPTION_HEADERS_ALREADY_SENT);
+               } elseif (!headers_sent()) {
+                       // Send headers out
+                       header("HTTP/1.1 {$this->responseStatus}");
+
+                       // Used later
+                       $now = gmdate('D, d M Y H:i:s') . ' GMT';
+
+                       // General header for no caching
+                       $this->addHeader('Expired', $now); // RFC2616 - Section 14.21
+                       $this->addHeader('Last-Modified', $now);
+                       $this->addHeader('Cache-Control', 'no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0'); // HTTP/1.1
+                       $this->addHeader('Pragma', 'no-cache'); // HTTP/1.0
+
+                       // Define the charset to be used
+                       //$this->addHeader('Content-type:', sprintf("text/html; charset=%s", $this->getConfigInstance()->readConfig('header_charset')));
+
+                       // Send all headers
+                       foreach ($this->responseHeaders as $name => $value) {
+                               header("{$name}: {$value}");
+                               //* DEBUG: */ echo "{$name}: {$value}<br />\n";
+                       } // END - foreach
+
+                       // Send cookies out?
+                       if (count($this->cookies) > 0) {
+                               // Send all cookies
+                               $cookieString = implode(" ", $this->cookies);
+                               header("Set-Cookie: {$cookieString}");
+
+                               // Remove them all
+                               $this->cookies = array();
+                       } // END - if
+               }
+
+               // Are there some error messages?
+               if (count($this->fatalMessages) == 0) {
+                       // Flush the output to the world
+                       $this->getWebOutputInstance()->output($this->responseBody);
+               } else {
+                       // Display all error messages
+                       $this->getApplicationInstance()->handleFatalMessages($this->fatalMessages);
+
+                       // Send the error messages out to the world
+                       $this->getWebOutputInstance()->output($this->responseBody);
+               }
+
+               // Clear response header and body
+               $this->setResponseBody("");
+               $this->resetResponseHeaders();
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/response/class_HttpResponse.php b/inc/classes/main/response/class_HttpResponse.php
deleted file mode 100644 (file)
index 869d358..0000000
+++ /dev/null
@@ -1,362 +0,0 @@
-<?php
-/**
- * A class for an HTTP response on an HTTP request
- *
- * @author             Roland Haeder <webmaster@ship-simu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.ship-simu.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
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * The extended headers are taken from phpMyAdmin setup tool, written by
- * Michal Cihar <michal@cihar.com>, licensed under GNU GPL 2.0.
- */
-class HttpResponse extends BaseFrameworkSystem implements Responseable {
-       /**
-        * Response status
-        */
-       private $responseStatus = "200 OK";
-
-       /**
-        * Array with all headers
-        */
-       private $responseHeaders = array();
-
-       /**
-        * Cookies we shall sent out
-        */
-       private $cookies = array();
-
-       /**
-        * Body of the response
-        */
-       private $responseBody = "";
-
-       /**
-        * Instance of the template engine
-        */
-       private $templateInstance = null;
-
-       /**
-        * Fatal resolved messages from filters and so on
-        */
-       private $fatalMessages = array();
-
-       /**
-        * Protected constructor
-        *
-        * @return      void
-        */
-       protected function __construct () {
-               // Call parent constructor
-               parent::__construct(__CLASS__);
-
-               // Clean up a little
-               $this->removeNumberFormaters();
-               $this->removeSystemArray();
-       }
-
-       /**
-        * Creates an object of this class
-        *
-        * @param       $appInstance            An instance of a manageable application
-        * @return      $responseInstance       A prepared instance of this class
-        */
-       public final static function createHttpResponse (ManageableApplication $appInstance) {
-               // Get a new instance
-               $responseInstance = new HttpResponse();
-
-               // Set the application instance
-               $responseInstance->setApplicationInstance($appInstance);
-
-               // Initialize the template engine here
-               $responseInstance->initTemplateEngine($appInstance);
-
-               // Return the prepared instance
-               return $responseInstance;
-       }
-
-       /**
-        * Setter for status
-        *
-        * @param       $status         New response status
-        * @return      void
-        */
-       public final function setResponseStatus ($status) {
-               $this->responseStatus = (string) $status;
-       }
-
-       /**
-        * Add header element
-        *
-        * @param       $name   Name of header element
-        * @param       $value  Value of header element
-        * @return      void
-        */
-       public final function addHeader ($name, $value) {
-               $this->responseHeaders[$name] = $value;
-       }
-
-       /**
-        * Reset the header array
-        *
-        * @return      void
-        */
-       public final function resetResponseHeaders () {
-               $this->responseHeaders = array();
-       }
-
-       /**
-        * "Writes" data to the response body
-        *
-        * @param       $output         Output we shall sent in the HTTP response
-        * @return      void
-        */
-       public function writeToBody ($output) {
-               $this->responseBody .= $output;
-       }
-
-       /**
-        * Sets the response body to something new
-        *
-        * @param       $output         Output we shall sent in the HTTP response
-        * @return      void
-        */
-       public function setResponseBody ($output) {
-               $this->responseBody = $output;
-       }
-
-       /**
-        * Flushs the cached HTTP response to the outer world
-        *
-        * @param       $force  Wether we shall force the output or abort if headers are
-        *                                      already sent with an exception
-        * @return      void
-        * @throws      ResponseHeadersAlreadySentException             Thrown if headers are
-        *                                                                                                      already sent
-        */
-       public function flushBuffer ($force=false) {
-               if ((headers_sent()) && (!$force)) {
-                       // Headers are already sent!
-                       throw new ResponseHeadersAlreadySentException($this, self::EXCEPTION_HEADERS_ALREADY_SENT);
-               } elseif (!headers_sent()) {
-                       // Send headers out
-                       header("HTTP/1.1 {$this->responseStatus}");
-
-                       // Used later
-                       $now = gmdate('D, d M Y H:i:s') . ' GMT';
-
-                       // General header for no caching
-                       $this->addHeader('Expired', $now); // rfc2616 - Section 14.21
-                       $this->addHeader('Last-Modified', $now);
-                       $this->addHeader('Cache-Control', 'no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0'); // HTTP/1.1
-                       $this->addHeader('Pragma', 'no-cache'); // HTTP/1.0
-
-                       // Define the charset to be used
-                       //$this->addHeader('Content-Type:', sprintf("text/html; charset=%s", $this->getConfigInstance()->readConfig('header_charset')));
-
-                       foreach ($this->responseHeaders as $name=>$value) {
-                               header("{$name}: {$value}");
-                       } // END - foreach
-
-                       // Send cookies out?
-                       if (count($this->cookies) > 0) {
-                               // Send all cookies
-                               $cookieString = implode(" ", $this->cookies);
-                               header("Set-Cookie: {$cookieString}");
-
-                               // Remove them all
-                               $this->cookies = array();
-                       } // END - if
-               }
-
-               // Are there some error messages?
-               if (count($this->fatalMessages) == 0) {
-                       // Flush the output to the world
-                       $this->getWebOutputInstance()->output($this->responseBody);
-               } else {
-                       // Display all error messages
-                       $this->getApplicationInstance()->handleFatalMessages($this->fatalMessages);
-
-                       // Send the error messages out to the world
-                       $this->getWebOutputInstance()->output($this->responseBody);
-               }
-
-               // Clear response header and body
-               $this->setResponseBody("");
-               $this->resetResponseHeaders();
-       }
-
-       /**
-        * Initializes the template engine instance
-        *
-        * @param       $appInstance    An instance of a manageable application
-        * @return      void
-        */
-       public final function initTemplateEngine (ManageableApplication $appInstance) {
-               $this->setTemplateInstance($this->prepareTemplateInstance($appInstance));
-       }
-
-       /**
-        * Adds a fatal message id to the response. The added messages can then be
-        * processed and outputed to the world
-        *
-        * @param       $messageId      The message id we shall add
-        * @return      void
-        */
-       public final function addFatalMessage ($messageId) {
-               // Adds the resolved message id to the fatal message list
-               $this->fatalMessages[] = $this->getApplicationInstance()->getLanguageInstance()->getMessage($messageId);
-       }
-
-       /**
-        * Adds a cookie to the response
-        *
-        * @param       $cookieName             Cookie's name
-        * @param       $cookieValue    Value to store in the cookie
-        * @param       $encrypted              Do some extra encryption on the value
-        * @param       $expires                Timestamp of expiration (default: configured)
-        * @return      void
-        * @throws      ResponseHeadersAlreadySentException             If headers are already sent
-        * @todo        Encryption of cookie data not yet supported.
-        * @todo        Why are these parameters conflicting?
-        * @todo        If the return statement is removed and setcookie() commented out,
-        * @todo        this will send only one cookie out, the first one.
-        */
-       public function addCookie ($cookieName, $cookieValue, $encrypted = false, $expires = null) {
-               //* DEBUG: */ echo $cookieName."=".$cookieValue."<br />\n";
-               // Are headers already sent?
-               if (headers_sent()) {
-                       // Throw an exception here
-                       //* DEBUG: */ return;
-                       throw new ResponseHeadersAlreadySentException($this, self::EXCEPTION_HEADERS_ALREADY_SENT);
-               } // END - if
-
-               // Shall we encrypt the cookie?
-               if ($encrypted === true) {
-               } // END - if
-
-               // For slow browsers set the cookie array element first
-               $_COOKIE[$cookieName] = $cookieValue;
-
-               // Get all config entries
-               if (is_null($expires)) {
-                       $expires = (time() + $this->getConfigInstance()->readConfig('cookie_expire'));
-               } // END - if
-
-               $path = $this->getConfigInstance()->readConfig('cookie_path');
-               $domain = $this->getConfigInstance()->readConfig('cookie_domain');
-
-               setcookie($cookieName, $cookieValue, $expires);
-               //, $path, $domain, (isset($_SERVER['HTTPS']))
-               return;
-
-               // Now construct the full header
-               $cookieString = $cookieName . "=" . $cookieValue . "; ";
-               $cookieString .= "expires=" . date("D, d-F-Y H:i:s", $expires) . " GMT";
-               // $cookieString .= "; path=".$path."; domain=".$domain;
-
-               // Set the cookie as a header
-               $this->cookies[$cookieName] = $cookieString;
-       }
-
-       /**
-        * Redirect to a configured URL. The URL can be absolute or relative. In
-        * case of relative URL it will be extended automatically.
-        *
-        * @param       $configEntry    The configuration entry which holds our URL
-        * @return      void
-        * @throws      ResponseHeadersAlreadySentException             If headers are already sent
-        */
-       public function redirectToConfiguredUrl ($configEntry) {
-               // Is the header not yet sent?
-               if (headers_sent()) {
-                       // Throw an exception here
-                       throw new ResponseHeadersAlreadySentException($this, self::EXCEPTION_HEADERS_ALREADY_SENT);
-               } // END - if
-
-               // Get the url from config
-               $url = $this->getConfigInstance()->readConfig($configEntry);
-
-               // 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);
-
-                       // No, then extend it with our base URL
-                       $url = $this->getConfigInstance()->readConfig('base_url') . "/" . $url;
-               } // END - if
-
-               // Add redirect header
-               $this->addHeader("Location", $url);
-
-               // Set correct response status
-               $this->setResponseStatus("301 Moved Permanently");
-
-               // Clear the body
-               $this->setResponseBody("");
-
-               // Flush the result
-               $this->flushBuffer();
-
-               // All done here...
-               exit();
-       }
-
-       /**
-        * Expires the given cookie if it is set
-        *
-        * @param       $cookieName             Cookie to expire
-        * @return      void
-        */
-       public function expireCookie ($cookieName) {
-               // Is the cookie there?
-               if (isset($_COOKIE[$cookieName])) {
-                       // Then expire it with 20 minutes past
-                       $this->addCookie($cookieName, "", false, (time() - 1200));
-
-                       // Remove it from array
-                       unset($_COOKIE[$cookieName]);
-               } // END - if
-       }
-
-       /**
-        * Refreshs a given cookie. This will make the cookie live longer
-        *
-        * @param       $cookieName             Cookie to refresh
-        * @return      void
-        */
-       public function refreshCookie ($cookieName) {
-               // Only update existing cookies
-               if (isset($_COOKIE[$cookieName])) {
-                       // Update the cookie
-                       $this->addCookie($cookieName, $_COOKIE[$cookieName], false);
-               } // END - if
-       }
-
-       /**
-        * Getter for default command
-        *
-        * @return      $defaultCommand         Default command for this response
-        */
-       public function getDefaultCommand () {
-               $defaultCommand = $this->getConfigInstance()->readConfig('default_web_command');
-               return $defaultCommand;
-       }
-}
-
-// [EOF]
-?>
diff --git a/inc/classes/main/response/class_ImageResponse.php b/inc/classes/main/response/class_ImageResponse.php
deleted file mode 100644 (file)
index 71acb35..0000000
+++ /dev/null
@@ -1,381 +0,0 @@
-<?php
-/**
- * A class for an image response on an HTTP request
- *
- * @author             Roland Haeder <webmaster@ship-simu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.ship-simu.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
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * The extended headers are taken from phpMyAdmin setup tool, written by
- * Michal Cihar <michal@cihar.com>, licensed under GNU GPL 2.0.
- */
-class ImageResponse extends BaseFrameworkSystem implements Responseable {
-       /**
-        * Response status
-        */
-       private $responseStatus = "200 OK";
-
-       /**
-        * Array with all headers
-        */
-       private $responseHeaders = array();
-
-       /**
-        * Cookies we shall sent out
-        */
-       private $cookies = array();
-
-       /**
-        * Body of the response
-        */
-       private $responseBody = "";
-
-       /**
-        * Fatal resolved messages from filters and so on
-        */
-       private $fatalMessages = array();
-
-       /**
-        * Instance of the image
-        */
-       private $imageInstance = null;
-
-       /**
-        * Protected constructor
-        *
-        * @return      void
-        */
-       protected function __construct () {
-               // Call parent constructor
-               parent::__construct(__CLASS__);
-
-               // Clean up a little
-               $this->removeNumberFormaters();
-               $this->removeSystemArray();
-       }
-
-       /**
-        * Creates an object of this class
-        *
-        * @param       $appInstance            An instance of a manageable application
-        * @return      $responseInstance       A prepared instance of this class
-        */
-       public final static function createImageResponse (ManageableApplication $appInstance) {
-               // Get a new instance
-               $responseInstance = new ImageResponse();
-
-               // Set the application instance
-               $responseInstance->setApplicationInstance($appInstance);
-
-               // Initialize the template engine here
-               $responseInstance->initTemplateEngine($appInstance);
-
-               // Return the prepared instance
-               return $responseInstance;
-       }
-
-       /**
-        * Setter for status
-        *
-        * @param       $status         New response status
-        * @return      void
-        */
-       public final function setResponseStatus ($status) {
-               $this->responseStatus = (string) $status;
-       }
-
-       /**
-        * Add header element
-        *
-        * @param       $name   Name of header element
-        * @param       $value  Value of header element
-        * @return      void
-        */
-       public final function addHeader ($name, $value) {
-               $this->responseHeaders[$name] = $value;
-       }
-
-       /**
-        * Reset the header array
-        *
-        * @return      void
-        */
-       public final function resetResponseHeaders () {
-               $this->responseHeaders = array();
-       }
-
-       /**
-        * "Writes" data to the response body
-        *
-        * @param       $output         Output we shall sent in the HTTP response
-        * @return      void
-        */
-       public function writeToBody ($output) {
-               $this->responseBody .= $output;
-       }
-
-       /**
-        * Sets the response body to something new
-        *
-        * @param       $output         Output we shall sent in the HTTP response
-        * @return      void
-        */
-       public function setResponseBody ($output) {
-               $this->responseBody = $output;
-       }
-
-       /**
-        * Flushs the cached HTTP response to the outer world
-        *
-        * @param       $force  Wether we shall force the output or abort if headers are
-        *                                      already sent with an exception
-        * @return      void
-        * @todo        Add support for fatal messages in image response
-        * @throws      ResponseHeadersAlreadySentException             Thrown if headers are
-        *                                                                                                      already sent
-        */
-       public function flushBuffer ($force=false) {
-               if ((headers_sent()) && (!$force)) {
-                       // Headers are already sent!
-                       throw new ResponseHeadersAlreadySentException($this, self::EXCEPTION_HEADERS_ALREADY_SENT);
-               } elseif (!headers_sent()) {
-                       // Send headers out
-                       header("HTTP/1.1 {$this->responseStatus}");
-
-                       // Used later
-                       $now = gmdate('D, d M Y H:i:s') . ' GMT';
-
-                       // General header for no caching
-                       $this->addHeader('Expired', $now); // rfc2616 - Section 14.21
-                       $this->addHeader('Last-Modified', $now);
-                       $this->addHeader('Cache-Control', 'no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0'); // HTTP/1.1
-                       $this->addHeader('Pragma', 'no-cache'); // HTTP/1.0
-                       $this->addHeader('Content-type', 'image/'.$this->imageInstance->getImageType());
-
-                       // Define the charset to be used
-                       //$this->addHeader('Content-Type:', sprintf("text/html; charset=%s", $this->getConfigInstance()->readConfig('header_charset')));
-
-                       foreach ($this->responseHeaders as $name=>$value) {
-                               header("{$name}: {$value}");
-                       } // END - foreach
-
-                       // Send cookies out?
-                       if (count($this->cookies) > 0) {
-                               // Send all cookies
-                               $cookieString = implode(" ", $this->cookies);
-                               header("Set-Cookie: {$cookieString}");
-
-                               // Remove them all
-                               $this->cookies = array();
-                       } // END - if
-               }
-
-               // Are there some error messages?
-               if (count($this->fatalMessages) == 0) {
-                       // Get image content from cache
-                       $imageContent = $this->imageInstance->getContent();
-                       die($imageContent);
-               } else {
-                       // Display all error messages
-                       $this->partialStub("Fatal messages are currently unsupported in image response.");
-               }
-
-               // Clear response header and body
-               $this->setResponseBody("");
-               $this->resetResponseHeaders();
-       }
-
-       /**
-        * Initializes the template engine instance
-        *
-        * @param       $appInstance    An instance of a manageable application
-        * @return      void
-        */
-       public final function initTemplateEngine (ManageableApplication $appInstance) {
-               // Get config instance
-               $cfg = $this->getConfigInstance();
-
-               // Set new template engine
-               $cfg->setConfigEntry('template_class'         , $cfg->readConfig('image_template_class'));
-               $cfg->setConfigEntry('raw_template_extension' , ".img");
-               $cfg->setConfigEntry('code_template_extension', ".itp");
-               $cfg->setConfigEntry('tpl_base_path'          , "templates/images/");
-               $cfg->setConfigEntry('code_template_type'     , "image");
-
-               // Get a prepared instance
-               $this->setTemplateInstance($this->prepareTemplateInstance($appInstance));
-       }
-
-       /**
-        * Adds a fatal message id to the response. The added messages can then be
-        * processed and outputed to the world
-        *
-        * @param       $messageId      The message id we shall add
-        * @return      void
-        */
-       public final function addFatalMessage ($messageId) {
-               // Adds the resolved message id to the fatal message list
-               $this->fatalMessages[] = $this->getApplicationInstance()->getLanguageInstance()->getMessage($messageId);
-       }
-
-       /**
-        * Adds a cookie to the response
-        *
-        * @param       $cookieName             Cookie's name
-        * @param       $cookieValue    Value to store in the cookie
-        * @param       $encrypted              Do some extra encryption on the value
-        * @param       $expires                Timestamp of expiration (default: configured)
-        * @return      void
-        * @throws      ResponseHeadersAlreadySentException             If headers are already sent
-        * @todo        Encryption of cookie data not yet supported.
-        * @todo        Why are these parameters conflicting?
-        * @todo        If the return statement is removed and setcookie() commented out,
-        * @todo        this will send only one cookie out, the first one.
-        */
-       public function addCookie ($cookieName, $cookieValue, $encrypted = false, $expires = null) {
-               // Are headers already sent?
-               if (headers_sent()) {
-                       // Throw an exception here
-                       throw new ResponseHeadersAlreadySentException($this, self::EXCEPTION_HEADERS_ALREADY_SENT);
-               } // END - if
-
-               // Shall we encrypt the cookie?
-               if ($encrypted === true) {
-               } // END - if
-
-               // For slow browsers set the cookie array element first
-               $_COOKIE[$cookieName] = $cookieValue;
-
-               // Get all config entries
-               if (is_null($expires)) {
-                       $expires = (time() + $this->getConfigInstance()->readConfig('cookie_expire'));
-               } // END - if
-
-               $path = $this->getConfigInstance()->readConfig('cookie_path');
-               $domain = $this->getConfigInstance()->readConfig('cookie_domain');
-
-               setcookie($cookieName, $cookieValue, $expires);
-               //, $path, $domain, (isset($_SERVER['HTTPS']))
-               return;
-
-               // Now construct the full header
-               $cookieString = $cookieName . "=" . $cookieValue . "; ";
-               $cookieString .= "expires=" . date("D, d-F-Y H:i:s", $expires) . " GMT";
-               // $cookieString .= "; path=".$path."; domain=".$domain;
-
-               // Set the cookie as a header
-               $this->cookies[$cookieName] = $cookieString;
-       }
-
-       /**
-        * Redirect to a configured URL. The URL can be absolute or relative. In
-        * case of relative URL it will be extended automatically.
-        *
-        * @param       $configEntry    The configuration entry which holds our URL
-        * @return      void
-        * @throws      ResponseHeadersAlreadySentException             If headers are already sent
-        */
-       public function redirectToConfiguredUrl ($configEntry) {
-               // Is the header not yet sent?
-               if (headers_sent()) {
-                       // Throw an exception here
-                       throw new ResponseHeadersAlreadySentException($this, self::EXCEPTION_HEADERS_ALREADY_SENT);
-               } // END - if
-
-               // Get the url from config
-               $url = $this->getConfigInstance()->readConfig($configEntry);
-
-               // 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);
-
-                       // No, then extend it with our base URL
-                       $url = $this->getConfigInstance()->readConfig('base_url') . "/" . $url;
-               } // END - if
-
-               // Add redirect header
-               $this->addHeader("Location", $url);
-
-               // Set correct response status
-               $this->setResponseStatus("301 Moved Permanently");
-
-               // Clear the body
-               $this->setResponseBody("");
-
-               // Flush the result
-               $this->flushBuffer();
-
-               // All done here...
-               exit();
-       }
-
-       /**
-        * Expires the given cookie if it is set
-        *
-        * @param       $cookieName             Cookie to expire
-        * @return      void
-        */
-       public function expireCookie ($cookieName) {
-               // Is the cookie there?
-               if (isset($_COOKIE[$cookieName])) {
-                       // Then expire it with 20 minutes past
-                       $this->addCookie($cookieName, "", false, (time() - 1200));
-
-                       // Remove it from array
-                       unset($_COOKIE[$cookieName]);
-               } // END - if
-       }
-
-       /**
-        * Refreshs a given cookie. This will make the cookie live longer
-        *
-        * @param       $cookieName             Cookie to refresh
-        * @return      void
-        */
-       public function refreshCookie ($cookieName) {
-               // Only update existing cookies
-               if (isset($_COOKIE[$cookieName])) {
-                       // Update the cookie
-                       $this->addCookie($cookieName, $_COOKIE[$cookieName], false);
-               } // END - if
-       }
-
-       /**
-        * Setter for image instanxe
-        *
-        * @param       $imageInstance  An instance of an image
-        * @return      void
-        */
-       public final function setImageInstance (BaseImage $imageInstance) {
-               $this->imageInstance = $imageInstance;
-       }
-
-       /**
-        * Getter for default command
-        *
-        * @return      $defaultCommand         Default command for this response
-        */
-       public function getDefaultCommand () {
-               $defaultCommand = $this->getConfigInstance()->readConfig('default_image_command');
-               return $defaultCommand;
-       }
-}
-
-// [EOF]
-?>
diff --git a/inc/classes/main/response/http/.htaccess b/inc/classes/main/response/http/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/response/http/class_HttpResponse.php b/inc/classes/main/response/http/class_HttpResponse.php
new file mode 100644 (file)
index 0000000..50bf2de
--- /dev/null
@@ -0,0 +1,211 @@
+<?php
+/**
+ * A class for an HTTP response on an HTTP request
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * The extended headers are taken from phpMyAdmin setup tool, written by
+ * Michal Cihar <michal@cihar.com>, licensed under GNU GPL 2.0.
+ */
+class HttpResponse extends BaseResponse implements Responseable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an object of this class
+        *
+        * @param       $appInstance            An instance of a manageable application
+        * @return      $responseInstance       A prepared instance of this class
+        */
+       public final static function createHttpResponse (ManageableApplication $appInstance) {
+               // Get a new instance
+               $responseInstance = new HttpResponse();
+
+               // Set the application instance
+               $responseInstance->setApplicationInstance($appInstance);
+
+               // Initialize the template engine here
+               $responseInstance->initTemplateEngine($appInstance);
+
+               // Return the prepared instance
+               return $responseInstance;
+       }
+
+       /**
+        * Initializes the template engine instance
+        *
+        * @param       $appInstance    An instance of a manageable application
+        * @return      void
+        */
+       public final function initTemplateEngine (ManageableApplication $appInstance) {
+               $this->setTemplateInstance($this->prepareTemplateInstance($appInstance));
+       }
+
+       /**
+        * Adds a cookie to the response
+        *
+        * @param       $cookieName             Cookie's name
+        * @param       $cookieValue    Value to store in the cookie
+        * @param       $encrypted              Do some extra encryption on the value
+        * @param       $expires                Timestamp of expiration (default: configured)
+        * @return      void
+        * @throws      ResponseHeadersAlreadySentException             If headers are already sent
+        * @todo        Encryption of cookie data not yet supported.
+        * @todo        Why are these parameters conflicting?
+        * @todo        If the return statement is removed and setcookie() commented out,
+        * @todo        this will send only one cookie out, the first one.
+        */
+       public function addCookie ($cookieName, $cookieValue, $encrypted = false, $expires = null) {
+               //* DEBUG: */ echo $cookieName."=".$cookieValue."<br />\n";
+               // Are headers already sent?
+               if (headers_sent()) {
+                       // Throw an exception here
+                       //* DEBUG: */ return;
+                       throw new ResponseHeadersAlreadySentException($this, self::EXCEPTION_HEADERS_ALREADY_SENT);
+               } // END - if
+
+               // Shall we encrypt the cookie?
+               if ($encrypted === true) {
+               } // END - if
+
+               // For slow browsers set the cookie array element first
+               $_COOKIE[$cookieName] = $cookieValue;
+
+               // Get all config entries
+               if (is_null($expires)) {
+                       $expires = (time() + $this->getConfigInstance()->readConfig('cookie_expire'));
+               } // END - if
+
+               $path = $this->getConfigInstance()->readConfig('cookie_path');
+               $domain = $this->getConfigInstance()->readConfig('cookie_domain');
+
+               setcookie($cookieName, $cookieValue, $expires);
+               //, $path, $domain, (isset($_SERVER['HTTPS']))
+               return;
+
+               // Now construct the full header
+               $cookieString = $cookieName . "=" . $cookieValue . "; ";
+               $cookieString .= "expires=" . date("D, d-F-Y H:i:s", $expires) . " GMT";
+               // $cookieString .= "; path=".$path."; domain=".$domain;
+
+               // Set the cookie as a header
+               $this->cookies[$cookieName] = $cookieString;
+       }
+
+       /**
+        * Redirect to a configured URL. The URL can be absolute or relative. In
+        * case of relative URL it will be extended automatically.
+        *
+        * @param       $configEntry    The configuration entry which holds our URL
+        * @return      void
+        * @throws      ResponseHeadersAlreadySentException             If headers are already sent
+        */
+       public function redirectToConfiguredUrl ($configEntry) {
+               // Is the header not yet sent?
+               if (headers_sent()) {
+                       // Throw an exception here
+                       throw new ResponseHeadersAlreadySentException($this, self::EXCEPTION_HEADERS_ALREADY_SENT);
+               } // END - if
+
+               // Assign application data
+               $this->getTemplateInstance()->assignApplicationData($this->getApplicationInstance());
+
+               // Get the url from config
+               $url = $this->getConfigInstance()->readConfig($configEntry);
+
+               // 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") {
+                       // Is there a / in front of the relative URL?
+                       if (substr($url, 0, 1) == "/") $url = substr($url, 1);
+
+                       // No, then extend it with our base URL
+                       $url = $this->getConfigInstance()->readConfig('base_url') . "/" . $url;
+               } // END - if
+
+               // Add redirect header
+               $this->addHeader("Location", $url);
+
+               // Set correct response status
+               $this->setResponseStatus("301 Moved Permanently");
+
+               // Clear the body
+               $this->setResponseBody("");
+
+               // Flush the result
+               $this->flushBuffer();
+
+               // All done here...
+               exit();
+       }
+
+       /**
+        * Expires the given cookie if it is set
+        *
+        * @param       $cookieName             Cookie to expire
+        * @return      void
+        */
+       public function expireCookie ($cookieName) {
+               // Is the cookie there?
+               if (isset($_COOKIE[$cookieName])) {
+                       // Then expire it with 20 minutes past
+                       $this->addCookie($cookieName, "", false, (time() - 1200));
+
+                       // Remove it from array
+                       unset($_COOKIE[$cookieName]);
+               } // END - if
+       }
+
+       /**
+        * Refreshs a given cookie. This will make the cookie live longer
+        *
+        * @param       $cookieName             Cookie to refresh
+        * @return      void
+        */
+       public function refreshCookie ($cookieName) {
+               // Only update existing cookies
+               if (isset($_COOKIE[$cookieName])) {
+                       // Update the cookie
+                       $this->addCookie($cookieName, $_COOKIE[$cookieName], false);
+               } // END - if
+       }
+
+       /**
+        * Getter for default command
+        *
+        * @return      $defaultCommand         Default command for this response
+        */
+       public function getDefaultCommand () {
+               $defaultCommand = $this->getConfigInstance()->readConfig('default_web_command');
+               return $defaultCommand;
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/response/image/.htaccess b/inc/classes/main/response/image/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/response/image/class_ImageResponse.php b/inc/classes/main/response/image/class_ImageResponse.php
new file mode 100644 (file)
index 0000000..c03e6ea
--- /dev/null
@@ -0,0 +1,268 @@
+<?php
+/**
+ * A class for an image response on an HTTP request
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * The extended headers are taken from phpMyAdmin setup tool, written by
+ * Michal Cihar <michal@cihar.com>, licensed under GNU GPL 2.0.
+ */
+class ImageResponse extends BaseResponse implements Responseable {
+       /**
+        * Instance of the image
+        */
+       private $imageInstance = null;
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an object of this class
+        *
+        * @param       $appInstance            An instance of a manageable application
+        * @return      $responseInstance       A prepared instance of this class
+        */
+       public final static function createImageResponse (ManageableApplication $appInstance) {
+               // Get a new instance
+               $responseInstance = new ImageResponse();
+
+               // Set the application instance
+               $responseInstance->setApplicationInstance($appInstance);
+
+               // Initialize the template engine here
+               $responseInstance->initTemplateEngine($appInstance);
+
+               // Return the prepared instance
+               return $responseInstance;
+       }
+
+       /**
+        * Initializes the template engine instance
+        *
+        * @param       $appInstance    An instance of a manageable application
+        * @return      void
+        */
+       public final function initTemplateEngine (ManageableApplication $appInstance) {
+               // Get config instance
+               $cfg = $this->getConfigInstance();
+
+               // Set new template engine
+               $cfg->setConfigEntry('template_class'         , $cfg->readConfig('image_template_class'));
+               $cfg->setConfigEntry('raw_template_extension' , ".img");
+               $cfg->setConfigEntry('code_template_extension', ".itp");
+               $cfg->setConfigEntry('tpl_base_path'          , "templates/images/");
+               $cfg->setConfigEntry('code_template_type'     , "image");
+
+               // Get a prepared instance
+               $this->setTemplateInstance($this->prepareTemplateInstance($appInstance));
+       }
+
+       /**
+        * Adds a cookie to the response
+        *
+        * @param       $cookieName             Cookie's name
+        * @param       $cookieValue    Value to store in the cookie
+        * @param       $encrypted              Do some extra encryption on the value
+        * @param       $expires                Timestamp of expiration (default: configured)
+        * @return      void
+        * @throws      ResponseHeadersAlreadySentException             If headers are already sent
+        * @todo        Encryption of cookie data not yet supported.
+        * @todo        Why are these parameters conflicting?
+        * @todo        If the return statement is removed and setcookie() commented out,
+        * @todo        this will send only one cookie out, the first one.
+        */
+       public function addCookie ($cookieName, $cookieValue, $encrypted = false, $expires = null) {
+               // Are headers already sent?
+               if (headers_sent()) {
+                       // Throw an exception here
+                       throw new ResponseHeadersAlreadySentException($this, self::EXCEPTION_HEADERS_ALREADY_SENT);
+               } // END - if
+
+               // Shall we encrypt the cookie?
+               if ($encrypted === true) {
+               } // END - if
+
+               // For slow browsers set the cookie array element first
+               $_COOKIE[$cookieName] = $cookieValue;
+
+               // Get all config entries
+               if (is_null($expires)) {
+                       $expires = (time() + $this->getConfigInstance()->readConfig('cookie_expire'));
+               } // END - if
+
+               $path = $this->getConfigInstance()->readConfig('cookie_path');
+               $domain = $this->getConfigInstance()->readConfig('cookie_domain');
+
+               setcookie($cookieName, $cookieValue, $expires);
+               //, $path, $domain, (isset($_SERVER['HTTPS']))
+               return;
+
+               // Now construct the full header
+               $cookieString = $cookieName . "=" . $cookieValue . "; ";
+               $cookieString .= "expires=" . date("D, d-F-Y H:i:s", $expires) . " GMT";
+               // $cookieString .= "; path=".$path."; domain=".$domain;
+
+               // Set the cookie as a header
+               $this->cookies[$cookieName] = $cookieString;
+       }
+
+       /**
+        * Redirect to a configured URL. The URL can be absolute or relative. In
+        * case of relative URL it will be extended automatically.
+        *
+        * @param       $configEntry    The configuration entry which holds our URL
+        * @return      void
+        * @throws      ResponseHeadersAlreadySentException             If headers are already sent
+        */
+       public function redirectToConfiguredUrl ($configEntry) {
+               // Is the header not yet sent?
+               if (headers_sent()) {
+                       // Throw an exception here
+                       throw new ResponseHeadersAlreadySentException($this, self::EXCEPTION_HEADERS_ALREADY_SENT);
+               } // END - if
+
+               // Assign application data
+               $this->getTemplateInstance()->assignApplicationData($this->getApplicationInstance());
+
+               // Get the url from config
+               $url = $this->getConfigInstance()->readConfig($configEntry);
+
+               // 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") {
+                       // Is there a / in front of the relative URL?
+                       if (substr($url, 0, 1) == "/") $url = substr($url, 1);
+
+                       // No, then extend it with our base URL
+                       $url = $this->getConfigInstance()->readConfig('base_url') . "/" . $url;
+               } // END - if
+
+               // Add redirect header
+               $this->addHeader("Location", $url);
+
+               // Set correct response status
+               $this->setResponseStatus("301 Moved Permanently");
+
+               // Clear the body
+               $this->setResponseBody("");
+
+               // Flush the result
+               $this->flushBuffer();
+
+               // All done here...
+               exit();
+       }
+
+       /**
+        * Flushs the cached HTTP response to the outer world
+        *
+        * @param       $force  Wether we shall force the output or abort if headers are
+        *                                      already sent with an exception
+        * @return      void
+        */
+       public function flushBuffer ($force = false) {
+               // Finish the image
+               $this->getImageInstance()->finishImage();
+
+               // Get image content
+               $content = $this->getImageInstance()->getContent();
+
+               // Set it as response body
+               $this->setResponseBody($content);
+
+               // Set content type
+               $this->addHeader('Content-type', "image/".$this->getImageInstance()->getImageType());
+
+               // Call parent method
+               parent::flushBuffer($force);
+       }
+
+       /**
+        * Expires the given cookie if it is set
+        *
+        * @param       $cookieName             Cookie to expire
+        * @return      void
+        */
+       public function expireCookie ($cookieName) {
+               // Is the cookie there?
+               if (isset($_COOKIE[$cookieName])) {
+                       // Then expire it with 20 minutes past
+                       $this->addCookie($cookieName, "", false, (time() - 1200));
+
+                       // Remove it from array
+                       unset($_COOKIE[$cookieName]);
+               } // END - if
+       }
+
+       /**
+        * Refreshs a given cookie. This will make the cookie live longer
+        *
+        * @param       $cookieName             Cookie to refresh
+        * @return      void
+        */
+       public function refreshCookie ($cookieName) {
+               // Only update existing cookies
+               if (isset($_COOKIE[$cookieName])) {
+                       // Update the cookie
+                       $this->addCookie($cookieName, $_COOKIE[$cookieName], false);
+               } // END - if
+       }
+
+       /**
+        * Setter for image instanxe
+        *
+        * @param       $imageInstance  An instance of an image
+        * @return      void
+        */
+       public final function setImageInstance (BaseImage $imageInstance) {
+               $this->imageInstance = $imageInstance;
+       }
+
+       /**
+        * Getter for image instanxe
+        *
+        * @return      $imageInstance  An instance of an image
+        */
+       public final function getImageInstance () {
+               return $this->imageInstance;
+       }
+
+       /**
+        * Getter for default command
+        *
+        * @return      $defaultCommand         Default command for this response
+        */
+       public function getDefaultCommand () {
+               $defaultCommand = $this->getConfigInstance()->readConfig('default_image_command');
+               return $defaultCommand;
+       }
+}
+
+// [EOF]
+?>
index f7b1648ff08346d7c8f359bf7a68212fccb6493e..3f8918b79da8c54dc29f1dfad2ddde98cb5857f5 100644 (file)
@@ -103,7 +103,7 @@ class DatabaseResult extends BaseFrameworkSystem implements SearchableResult, Up
                $entryKey = $this->key();
 
                // Now get the update criteria array and update all entries
                $entryKey = $this->key();
 
                // Now get the update criteria array and update all entries
-               foreach ($updateInstance->getUpdateCriteria() as $criteriaKey=>$criteriaValue) {
+               foreach ($updateInstance->getUpdateCriteria() as $criteriaKey => $criteriaValue) {
                        // Update data
                        $this->resultArray['rows'][$entryKey][$criteriaKey] = $criteriaValue;
 
                        // Update data
                        $this->resultArray['rows'][$entryKey][$criteriaKey] = $criteriaValue;
 
@@ -318,7 +318,7 @@ class DatabaseResult extends BaseFrameworkSystem implements SearchableResult, Up
                        $currentEntry = $this->current();
 
                        // Walk only through out-dated columns
                        $currentEntry = $this->current();
 
                        // Walk only through out-dated columns
-                       foreach ($this->outDated as $key=>$dummy) {
+                       foreach ($this->outDated as $key => $dummy) {
                                // Does this key exist?
                                //* DEBUG: */ echo "outDated: {$key}<br />\n";
                                if (isset($currentEntry[$key])) {
                                // Does this key exist?
                                //* DEBUG: */ echo "outDated: {$key}<br />\n";
                                if (isset($currentEntry[$key])) {
index 4db73b617de299fc4c976bb955506c8a622ee28d..7e1aa7c194f0fb6d1a015e4b640aa3f104396b3b 100644 (file)
@@ -69,11 +69,6 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
         */
        private $varStack = array();
 
         */
        private $varStack = array();
 
-       /**
-        * Configuration variables in a simple array
-        */
-       private $configVariables = array();
-
        /**
         * Loaded templates for recursive protection and detection
         */
        /**
         * Loaded templates for recursive protection and detection
         */
@@ -154,10 +149,12 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                // Is the group there?
                if (isset($this->varStack[$this->currGroup])) {
                        // Now search for it
                // Is the group there?
                if (isset($this->varStack[$this->currGroup])) {
                        // Now search for it
-                       foreach ($this->varStack[$this->currGroup] as $idx=>$currEntry) {
+                       foreach ($this->varStack[$this->currGroup] as $idx => $currEntry) {
+                               //* DEBUG: */ echo __METHOD__.":currGroup={$this->currGroup},idx={$idx},currEntry={$currEntry['name']},var={$var}<br />\n";
                                // Is the entry found?
                                if ($currEntry['name'] == $var) {
                                        // Found!
                                // Is the entry found?
                                if ($currEntry['name'] == $var) {
                                        // Found!
+                                       //* DEBUG: */ echo __METHOD__.":FOUND!<br />\n";
                                        $found = $idx;
                                        break;
                                } // END - if
                                        $found = $idx;
                                        break;
                                } // END - if
@@ -586,7 +583,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                // Did we find some variables?
                if ((is_array($variableMatches)) && (count($variableMatches) == 4) && (count($variableMatches[0]) > 0)) {
                        // Initialize all missing variables
                // Did we find some variables?
                if ((is_array($variableMatches)) && (count($variableMatches) == 4) && (count($variableMatches[0]) > 0)) {
                        // Initialize all missing variables
-                       foreach ($variableMatches[3] as $key=>$var) {
+                       foreach ($variableMatches[3] as $key => $var) {
                                // Variable name
                                $varName = $variableMatches[1][$key];
 
                                // Variable name
                                $varName = $variableMatches[1][$key];
 
@@ -628,10 +625,17 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                        if ((!isset($this->loadedRawData[$template])) && (!in_array($template, $this->loadedTemplates))) {
 
                                // Template not found, but maybe variable assigned?
                        if ((!isset($this->loadedRawData[$template])) && (!in_array($template, $this->loadedTemplates))) {
 
                                // Template not found, but maybe variable assigned?
+                               //* DEBUG: */ echo __METHOD__.":template={$template}<br />\n";
                                if ($this->isVariableAlreadySet($template) !== false) {
                                        // Use that content here
                                        $this->loadedRawData[$template] = $this->readVariable($template);
 
                                if ($this->isVariableAlreadySet($template) !== false) {
                                        // Use that content here
                                        $this->loadedRawData[$template] = $this->readVariable($template);
 
+                                       // Recursive protection:
+                                       $this->loadedTemplates[] = $template;
+                               } elseif (isset($this->varStack['config'][$template])) {
+                                       // Use that content here
+                                       $this->loadedRawData[$template] = $this->varStack['config'][$template];
+
                                        // Recursive protection:
                                        $this->loadedTemplates[] = $template;
                                } else {
                                        // Recursive protection:
                                        $this->loadedTemplates[] = $template;
                                } else {
@@ -671,7 +675,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                if (in_array($template, $this->compiledTemplates)) {
                        // Abort here...
                        return;
                if (in_array($template, $this->compiledTemplates)) {
                        // Abort here...
                        return;
-               }
+               } // END - if
 
                // Remember this template being compiled
                $this->compiledTemplates[] = $template;
 
                // Remember this template being compiled
                $this->compiledTemplates[] = $template;
@@ -703,7 +707,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
         */
        private function insertAllTemplates (array $templateMatches) {
                // Run through all loaded codes
         */
        private function insertAllTemplates (array $templateMatches) {
                // Run through all loaded codes
-               foreach ($this->loadedRawData as $template=>$code) {
+               foreach ($this->loadedRawData as $template => $code) {
 
                        // Search for the template
                        $foundIndex = array_search($template, $templateMatches[1]);
 
                        // Search for the template
                        $foundIndex = array_search($template, $templateMatches[1]);
@@ -766,7 +770,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
         */
        private function assignAllVariables (array $varMatches) {
                // Search for all variables
         */
        private function assignAllVariables (array $varMatches) {
                // Search for all variables
-               foreach ($varMatches[1] as $key=>$var) {
+               foreach ($varMatches[1] as $key => $var) {
 
                        // Detect leading equals
                        if (substr($varMatches[2][$key], 0, 1) == "=") {
 
                        // Detect leading equals
                        if (substr($varMatches[2][$key], 0, 1) == "=") {
@@ -796,7 +800,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                if (count($this->loadedRawData) > 0) {
 
                        // Then compile all!
                if (count($this->loadedRawData) > 0) {
 
                        // Then compile all!
-                       foreach ($this->loadedRawData as $template=>$code) {
+                       foreach ($this->loadedRawData as $template => $code) {
 
                                // Is this template already compiled?
                                if (in_array($template, $this->compiledTemplates)) {
 
                                // Is this template already compiled?
                                if (in_array($template, $this->compiledTemplates)) {
@@ -836,7 +840,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
         */
        private function insertRawTemplates () {
                // Load all templates
         */
        private function insertRawTemplates () {
                // Load all templates
-               foreach ($this->rawTemplates as $template=>$content) {
+               foreach ($this->rawTemplates as $template => $content) {
                        // Set the template as a variable with the content
                        $this->assignVariable($template, $content);
                }
                        // Set the template as a variable with the content
                        $this->assignVariable($template, $content);
                }
@@ -895,7 +899,8 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
         */
        public function assignConfigVariable ($var) {
                // Sweet and simple...
         */
        public function assignConfigVariable ($var) {
                // Sweet and simple...
-               $this->configVariables[$var] = $this->getConfigInstance()->readConfig($var);
+               //* DEBUG: */ echo __METHOD__.":var={$var}<br />\n";
+               $this->varStack['config'][$var] = $this->getConfigInstance()->readConfig($var);
        }
 
        /**
        }
 
        /**
@@ -916,7 +921,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
        /**
         * Load a specified code template into the engine
         *
        /**
         * Load a specified code template into the engine
         *
-        * @param               $template               The code template we shall load which is
+        * @param       $template       The code template we shall load which is
         *                                              located in "code" by default
         * @return      void
         */
         *                                              located in "code" by default
         * @return      void
         */
@@ -944,14 +949,16 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                        // Transfer it's name/value combination to the $content array
                        //* DEBUG: */ echo $currVariable['name']."=<pre>".htmlentities($currVariable['value'])."</pre>\n";
                        $dummy[$currVariable['name']] = $currVariable['value'];
                        // Transfer it's name/value combination to the $content array
                        //* DEBUG: */ echo $currVariable['name']."=<pre>".htmlentities($currVariable['value'])."</pre>\n";
                        $dummy[$currVariable['name']] = $currVariable['value'];
-
                }// END - if
 
                }// END - if
 
-               // Set the new variable (don't remove the second dollar !)
+               // Set the new variable (don't remove the second dollar!)
                $$validVar = $dummy;
 
                // Prepare all configuration variables
                $$validVar = $dummy;
 
                // Prepare all configuration variables
-               $config = $this->configVariables;
+               $config = null;
+               if (isset($this->varStack['config'])) {
+                       $config = $this->varStack['config'];
+               } // END - if
 
                // Remove some variables
                unset($idx);
 
                // Remove some variables
                unset($idx);
@@ -1184,6 +1191,9 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
 
                // Get version number and assign it
                $this->assignVariable('app_version'   , $appInstance->getAppVersion());
 
                // Get version number and assign it
                $this->assignVariable('app_version'   , $appInstance->getAppVersion());
+
+               // Assign extra application-depending data
+               $appInstance->assignExtraTemplateData($this);
        }
 
        /**
        }
 
        /**
index 4c306dd1a19e91c3e06e78faf315e00bd41ac369..cdda5d45d68ad99a3d723d59c9d2cf946193d822 100644 (file)
@@ -200,7 +200,7 @@ class WernisApi extends BaseFrameworkSystem {
 
                // Construct the request string
                $requestString = $this->config['api_url'] . $scriptName."?api_id=".$this->config['wernis_api_id']."&api_key=".$this->config['wernis_api_key'];
 
                // Construct the request string
                $requestString = $this->config['api_url'] . $scriptName."?api_id=".$this->config['wernis_api_id']."&api_key=".$this->config['wernis_api_key'];
-               foreach ($requestData as $key=>$value) {
+               foreach ($requestData as $key => $value) {
                        $requestString .= "&".$key."=".$value;
                }
 
                        $requestString .= "&".$key."=".$value;
                }
 
index 8f25248f9dcb10370ba8a73f1632ca8f714c97e9..d50782a1daac0c90a0eb5d57dd1d1ec9749ee8fe 100644 (file)
@@ -42,7 +42,7 @@ $cfg->setConfigEntry('base_url', $cfg->detectBaseUrl());
 $cfg->setConfigEntry('db_type', "local");
 
 // CFG: LOCAL-DB-PATH
 $cfg->setConfigEntry('db_type', "local");
 
 // CFG: LOCAL-DB-PATH
-$cfg->setConfigEntry('local_db_path', $cfg->readConfig('base_path', "db/"));
+$cfg->setConfigEntry('local_db_path', $cfg->readConfig('base_path') . "db/");
 
 // CFG: TIME-ZONE
 $cfg->setDefaultTimezone("Europe/Berlin");
 
 // CFG: TIME-ZONE
 $cfg->setDefaultTimezone("Europe/Berlin");
@@ -84,7 +84,7 @@ $cfg->setConfigEntry('lang_base_path', "inc/language/"); // DON'T MISS THE TRAIL
 $cfg->setConfigEntry('compressor_base_path', "inc/classes/main/compressor/"); // DON'T MISS THE TRAILING SLASH!
 
 // CFG: APPLICATION-PATH
 $cfg->setConfigEntry('compressor_base_path', "inc/classes/main/compressor/"); // DON'T MISS THE TRAILING SLASH!
 
 // CFG: APPLICATION-PATH
-$cfg->setConfigEntry('application_path', "application");
+$cfg->setConfigEntry('application_path', $cfg->readConfig('base_path') . "application/");
 
 // CFG: COMPILE-OUTPUT-PATH
 $cfg->setConfigEntry('compile_output_path', "templates/_compiled/"); // DON'T MISS THE TRAILING SLASH!
 
 // CFG: COMPILE-OUTPUT-PATH
 $cfg->setConfigEntry('compile_output_path', "templates/_compiled/"); // DON'T MISS THE TRAILING SLASH!
@@ -116,9 +116,6 @@ $cfg->setConfigEntry('tpl_selector_prefix', "selector");
 // CFG: WEB-CONTENT-TYPE
 $cfg->setConfigEntry('web_content_type', "text/html");
 
 // CFG: WEB-CONTENT-TYPE
 $cfg->setConfigEntry('web_content_type', "text/html");
 
-// CFG: HEADER-CHARSET
-$cfg->setConfigEntry('header_charset', "utf-8");
-
 // CFG: VALID-TEMPLATE-VARIABLE
 $cfg->setConfigEntry('tpl_valid_var', "content");
 
 // CFG: VALID-TEMPLATE-VARIABLE
 $cfg->setConfigEntry('tpl_valid_var', "content");
 
index 7f9003a897139e76bd3ff8f31c72c1243702b8f6..03bc377ac5d781427711d319ddd2a873b9f8202a 100644 (file)
@@ -23,7 +23,7 @@
  */
 
 // Initialize layer
  */
 
 // Initialize layer
-$layer = null;
+$layerInstance = null;
 
 // Get config instance
 $cfg = FrameworkConfiguration::getInstance();
 
 // Get config instance
 $cfg = FrameworkConfiguration::getInstance();
@@ -51,7 +51,7 @@ unset($INC);
 
 // Prepare database instance
 try {
 
 // Prepare database instance
 try {
-       $db = DatabaseConnection::createDatabaseConnection(DebugMiddleware::getInstance(), $layer);
+       $db = DatabaseConnection::createDatabaseConnection(DebugMiddleware::getInstance(), $layerInstance);
 } catch (NullPointerException $e) {
        ApplicationEntryPoint::app_die(sprintf("[Main:] Database sub-system not initialized for the follwing reason: <strong>%s</strong><br />\n",
                $e->getMessage()
 } catch (NullPointerException $e) {
        ApplicationEntryPoint::app_die(sprintf("[Main:] Database sub-system not initialized for the follwing reason: <strong>%s</strong><br />\n",
                $e->getMessage()
index f9ec63e5f0ce7112d15c56a7061c27da8efb15b0..ae748c5de1024d95682c0a906b1dbaed43bfa884 100644 (file)
@@ -24,7 +24,7 @@
 
 // Zum Testen speichern wir in lokale Dateien (LocalFileDatabase)
 try {
 
 // Zum Testen speichern wir in lokale Dateien (LocalFileDatabase)
 try {
-       $layer = LocalFileDatabase::createLocalFileDatabase(FrameworkConfiguration::getInstance()->readConfig('local_db_path'), FileIoHandler::getInstance());
+       $layerInstance = LocalFileDatabase::createLocalFileDatabase(FrameworkConfiguration::getInstance()->readConfig('local_db_path'), FileIoHandler::getInstance());
 } catch (SavePathIsEmptyException $e) {
        ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: <strong>%s</strong>",
                $e->getMessage()
 } catch (SavePathIsEmptyException $e) {
        ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: <strong>%s</strong>",
                $e->getMessage()
index 5f5f97a3446db380af0842e9665b685e06cbb222..134b8c10d4af9d7a533065d105da41c4f92c09c6 100644 (file)
@@ -119,8 +119,8 @@ class ClassLoader {
 
                // Construct the FQFN for the cache
                if (!defined('DEVELOPER')) {
 
                // Construct the FQFN for the cache
                if (!defined('DEVELOPER')) {
-                       $this->listCacheFQFN  = $this->cfgInstance->readConfig('base_path') . $this->cfgInstance->readConfig('local_db_path') . "list-" . $this->cfgInstance->readConfig('app_name') . ".cache";
-                       $this->classCacheFQFN = $this->cfgInstance->readConfig('base_path') . $this->cfgInstance->readConfig('local_db_path') . "class-" . $this->cfgInstance->readConfig('app_name') . ".cache";
+                       $this->listCacheFQFN  = $this->cfgInstance->readConfig('local_db_path') . "list-" . $this->cfgInstance->readConfig('app_name') . ".cache";
+                       $this->classCacheFQFN = $this->cfgInstance->readConfig('local_db_path') . "class-" . $this->cfgInstance->readConfig('app_name') . ".cache";
                } // END - if
 
                // Set suffix and prefix from configuration
                } // END - if
 
                // Set suffix and prefix from configuration
@@ -334,7 +334,7 @@ class ClassLoader {
         */
        private function includeExtraConfigs () {
                // Run through all class names (should not be much)
         */
        private function includeExtraConfigs () {
                // Run through all class names (should not be much)
-               foreach ($this->classes as $fileName=>$fqfn) {
+               foreach ($this->classes as $fileName => $fqfn) {
                        // Is this a config?
                        if (substr($fileName, 0, $this->prefixLen) == $this->prefix) {
                                // Then include it
                        // Is this a config?
                        if (substr($fileName, 0, $this->prefixLen) == $this->prefix) {
                                // Then include it
index 69f413461e49982447cc5cf7ea9b1ceee32ec71c..ddab76926ef76f12dcc80b111927c49d7f854c08 100644 (file)
@@ -45,8 +45,7 @@ foreach ($configAppIncludes as $inc) {
        }
 
        // Generate a FQFN for the helper class
        }
 
        // Generate a FQFN for the helper class
-       $fqfn = sprintf("%s%s/%s/%s%s",
-               $cfg->readConfig('base_path'),
+       $fqfn = sprintf("%s%s/%s%s",
                $cfg->readConfig('application_path'),
                $cfg->readConfig('app_name'),
                $inc,
                $cfg->readConfig('application_path'),
                $cfg->readConfig('app_name'),
                $inc,
index f6c600516d2b1ff3c87a0f8facc82a18a0a0e3b7..5b3894a3797ad1534645ad861269651dba6c1180 100644 (file)
--- a/index.php
+++ b/index.php
@@ -93,13 +93,25 @@ class ApplicationEntryPoint {
                        // Get and prepare backtrace for output
                        $backtraceArray = debug_backtrace();
                        $backtrace = "";
                        // Get and prepare backtrace for output
                        $backtraceArray = debug_backtrace();
                        $backtrace = "";
-                       foreach ($backtraceArray as $key=>$trace) {
+                       foreach ($backtraceArray as $key => $trace) {
                                if (!isset($trace['file'])) $trace['file'] = __FILE__;
                                if (!isset($trace['line'])) $trace['line'] = __LINE__;
                                if (!isset($trace['args'])) $trace['args'] = array();
                                $backtrace .= "<span class=\"backtrace_file\">".basename($trace['file'])."</span>:".$trace['line'].", <span class=\"backtrace_function\">".$trace['function']."(".count($trace['args']).")</span><br />";
                        } // END - foreach
 
                                if (!isset($trace['file'])) $trace['file'] = __FILE__;
                                if (!isset($trace['line'])) $trace['line'] = __LINE__;
                                if (!isset($trace['args'])) $trace['args'] = array();
                                $backtrace .= "<span class=\"backtrace_file\">".basename($trace['file'])."</span>:".$trace['line'].", <span class=\"backtrace_function\">".$trace['function']."(".count($trace['args']).")</span><br />";
                        } // END - foreach
 
+                       // Init application instance
+                       $appInstance = null;
+
+                       // Is the class there?
+                       if (class_exists('ApplicationHelper')) {
+                               // Get application instance
+                               $appInstance = ApplicationHelper::getInstance();
+
+                               // Assign application data
+                               $templateInstance->assignApplicationData($appInstance);
+                       } // END - if
+
                        // Assign variables
                        $templateInstance->assignVariable('message', $message);
                        $templateInstance->assignVariable('code', $code);
                        // Assign variables
                        $templateInstance->assignVariable('message', $message);
                        $templateInstance->assignVariable('code', $code);
index 7da5dba4493d01afbacb5e9d9aee5154781931b3..c9291e94796b96e0bbf6e7c28f454e6f0a3c3e04 100644 (file)
@@ -10,7 +10,7 @@
        <meta name="keywords" content="$config[meta_keywords]" />
        <meta name="robots" content="index,follow" />
        <meta name="description" content="$config[meta_description]" />
        <meta name="keywords" content="$config[meta_keywords]" />
        <meta name="robots" content="index,follow" />
        <meta name="description" content="$config[meta_description]" />
-       <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
+       <meta http-equiv="content-type" content="text/html; charset={?header_charset?}" />
        <meta http-equiv="content-style-type" content="text/css" />
        <meta http-equiv="content-script-type" content="text/javascript" />
        <meta http-equiv="language" content="de" />
        <meta http-equiv="content-style-type" content="text/css" />
        <meta http-equiv="content-script-type" content="text/javascript" />
        <meta http-equiv="language" content="de" />