From 6efe73fc37d258a0f7a5ff1e95048cadd7632f30 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Sun, 16 Aug 2015 10:59:15 +0200 Subject: [PATCH] Code templates needs to be configured separately for HTML and console. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- inc/classes/main/template/class_BaseTemplateEngine.php | 6 +++--- inc/config.php | 7 +++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/inc/classes/main/template/class_BaseTemplateEngine.php b/inc/classes/main/template/class_BaseTemplateEngine.php index 012e4673..543bd88f 100644 --- a/inc/classes/main/template/class_BaseTemplateEngine.php +++ b/inc/classes/main/template/class_BaseTemplateEngine.php @@ -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. diff --git a/inc/config.php b/inc/config.php index 03c1b9a2..c04c0256 100644 --- a/inc/config.php +++ b/inc/config.php @@ -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'); -- 2.39.5