Endless recursive call fixed
authorRoland Häder <roland@mxchange.org>
Sun, 5 Apr 2009 09:20:12 +0000 (09:20 +0000)
committerRoland Häder <roland@mxchange.org>
Sun, 5 Apr 2009 09:20:12 +0000 (09:20 +0000)
inc/classes/main/template/class_BaseTemplateEngine.php

index 190e2e8054085ea72373fc576327dac03cdaf081..d6b3a15756b7ab4ddfb025b160f64934cfe8f9d1 100644 (file)
@@ -525,15 +525,19 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
         * Private loader for all template types
         *
         * @param       $template       The template we shall load
         * Private loader for all template types
         *
         * @param       $template       The template we shall load
+        * @param       $extOther       An other extension to use
         * @return      void
         * @throws      FileNotFoundException   If the template was not found
         */
         * @return      void
         * @throws      FileNotFoundException   If the template was not found
         */
-       protected function loadTemplate ($template, $ext = '') {
+       protected function loadTemplate ($template, $extOther = '') {
                // Get extension for the template if empty
                // Get extension for the template if empty
-               if (empty($ext)) {
+               if (empty($extOther)) {
                        // None provided, so get the raw one
                        $ext = $this->getRawTemplateExtension();
                        // None provided, so get the raw one
                        $ext = $this->getRawTemplateExtension();
-               } // END - if
+               } else {
+                       // Then use it!
+                       $ext = (string) $extOther;
+               }
 
                // Construct the FQFN for the template by honoring the current language
                $fqfn = sprintf("%s%s%s%s/%s/%s%s",
 
                // Construct the FQFN for the template by honoring the current language
                $fqfn = sprintf("%s%s%s%s/%s/%s%s",
@@ -552,7 +556,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                        $this->loadRawTemplateData($fqfn);
                } catch (FileNotFoundException $e) {
                        // If we shall load a code-template we need to switch the file extension
                        $this->loadRawTemplateData($fqfn);
                } catch (FileNotFoundException $e) {
                        // If we shall load a code-template we need to switch the file extension
-                       if ($this->getTemplateType() != $this->getConfigInstance()->readConfig('web_template_type')) {
+                       if (($this->getTemplateType() != $this->getConfigInstance()->readConfig('web_template_type')) && (empty($extOther))) {
                                // Switch over to the code-template extension and try it again
                                $ext = $this->getCodeTemplateExtension();
 
                                // Switch over to the code-template extension and try it again
                                $ext = $this->getCodeTemplateExtension();