Code templates needs to be configured separately for HTML and console.
authorRoland Haeder <roland@mxchange.org>
Sun, 16 Aug 2015 08:59:15 +0000 (10:59 +0200)
committerRoland Haeder <roland@mxchange.org>
Sun, 16 Aug 2015 08:59:15 +0000 (10:59 +0200)
Signed-off-by: Roland Häder <roland@mxchange.org>
inc/classes/main/template/class_BaseTemplateEngine.php
inc/config.php

index 012e46734ad2532a679aa58fed365fe54c13c0dc..543bd88f6d182e44dd549f6e6174f2a7259f33a4 100644 (file)
@@ -1232,7 +1232,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
         */
        public function loadCodeTemplate ($template) {
                // Set template type
-               $this->setTemplateType($this->getConfigInstance()->getConfigEntry('code_template_type'));
+               $this->setTemplateType($this->getConfigInstance()->getConfigEntry('code_' . self::getResponseTypeFromSystem() . '_template_type'));
 
                // Load the special template
                $this->loadTemplate($template);
@@ -1391,12 +1391,12 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
         */
        public function compileTemplate () {
                // Get code type to make things shorter
-               $codeType = $this->getConfigInstance()->getConfigEntry('code_template_type');
+               $codeType = $this->getConfigInstance()->getConfigEntry('code_' . self::getResponseTypeFromSystem() . '_template_type');
 
                // We will only work with template type "code" from configuration
                if (substr($this->getTemplateType(), 0, strlen($codeType)) != $codeType) {
                        // Abort here
-                       throw new UnexpectedTemplateTypeException(array($this, $this->getTemplateType(), $this->getConfigInstance()->getConfigEntry('code_template_type')), self::EXCEPTION_TEMPLATE_TYPE_IS_UNEXPECTED);
+                       throw new UnexpectedTemplateTypeException(array($this, $this->getTemplateType(), $this->getConfigInstance()->getConfigEntry('code_' . self::getResponseTypeFromSystem() . '_template_type')), self::EXCEPTION_TEMPLATE_TYPE_IS_UNEXPECTED);
                } // END - if
 
                // Get the raw data.
index 03c1b9a225ff00dbd1716b1b012e7c1ec021adff..c04c025630bc256e95358cae4c1500ec014bf3b5 100644 (file)
@@ -110,8 +110,11 @@ $cfg->setConfigEntry('html_template_type', 'html');
 // CFG: EMAIL-TEMPLATE-TYPE
 $cfg->setConfigEntry('email_template_type', 'emails');
 
-// CFG: CODE-TEMPLATE-TYPE
-$cfg->setConfigEntry('code_template_type', 'code');
+// CFG: CODE-HTML-TEMPLATE-TYPE
+$cfg->setConfigEntry('code_html_template_type', 'code');
+
+// CFG: CODE-CONSOLE-TEMPLATE-TYPE
+$cfg->setConfigEntry('code_console_template_type', 'xml');
 
 // CFG: IMAGE-TEMPLATE-TYPE
 $cfg->setConfigEntry('image_template_type', 'image');