Now all base paths are relative and constructed in BaseTemplateEngine genericly,...
[core.git] / inc / classes / main / template / class_BaseTemplateEngine.php
index 21234b81e8295b2e6eac43680f543a7068202fb8..60fa5f54e3c9fc997af5ce9f906ba71598c6379d 100644 (file)
@@ -27,7 +27,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
         * templates are stored. We will internally determine the language plus
         * "html" for web templates or "emails" for email templates
         */
-       private $basePath = '';
+       private $templateBasePath = '';
 
        /**
         * Template type
@@ -45,9 +45,14 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
        private $codeExtension = '.ctp';
 
        /**
-        * Path relative to $basePath and language code for compiled code-templates
+        * Path relative to $templateBasePath and language code for compiled code-templates
         */
-       private $compileOutputPath = 'templates/_compiled';
+       private $compileOutputPath = 'templates/_compiled/';
+
+       /**
+        * The path name for all templates
+        */
+       private $genericBasePath = 'templates/';
 
        /**
         * The raw (maybe uncompiled) template
@@ -327,22 +332,22 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
        /**
         * Setter for base path
         *
-        * @param               $basePath               The local base path for all templates
+        * @param               $templateBasePath               The relative base path for all templates
         * @return      void
         */
-       public final function setBasePath ($basePath) {
+       public final function setTemplateBasePath ($templateBasePath) {
                // And set it
-               $this->basePath = (string) $basePath;
+               $this->templateBasePath = (string) $templateBasePath;
        }
 
        /**
         * Getter for base path
         *
-        * @return      $basePath               The local base path for all templates
+        * @return      $templateBasePath               The relative base path for all templates
         */
-       public final function getBasePath () {
+       public final function getTemplateBasePath () {
                // And set it
-               return $this->basePath;
+               return $this->templateBasePath;
        }
 
        /**
@@ -523,10 +528,10 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                } // END - if
 
                // Construct the FQFN for the template by honoring the current language
-               $fqfn = sprintf("%s%s/%s%s/%s/%s%s",
-                       $this->getConfigInstance()->readConfig('application_path'),
-                       Registry::getRegistry()->getInstance('application')->getAppShortName(),
-                       $this->getBasePath(),
+               $fqfn = sprintf("%s%s%s%s/%s/%s%s",
+                       $this->getConfigInstance()->readConfig('base_path'),
+                       $this->getTemplateBasePath(),
+                       $this->genericBasePath,
                        $this->getLanguageInstance()->getLanguageCode(),
                        $this->getTemplateType(),
                        (string) $template,