From: Roland Häder Date: Wed, 22 Aug 2012 21:20:11 +0000 (+0000) Subject: Also missed this to rename to loadXmlTemplate() :( X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d7119e5294e6926bf6b8e59f687d0d70ad6486ca;p=hub.git Also missed this to rename to loadXmlTemplate() :( --- diff --git a/application/hub/main/tags/package/class_PackageTags.php b/application/hub/main/tags/package/class_PackageTags.php index 27b2a0588..0ffd0a59e 100644 --- a/application/hub/main/tags/package/class_PackageTags.php +++ b/application/hub/main/tags/package/class_PackageTags.php @@ -81,7 +81,7 @@ class PackageTags extends BaseTags implements Tagable { $this->setTemplateInstance($templateInstance); // Read the XML file - $this->getTemplateInstance()->loadObjectRegistryTemplate('object_registry'); + $this->getTemplateInstance()->loadXmlTemplate('object_registry'); // Render the XML content $this->getTemplateInstance()->renderXmlContent(); diff --git a/application/hub/main/template/class_BaseXmlTemplateEngine.php b/application/hub/main/template/class_BaseXmlTemplateEngine.php index 58b990edc..761dd62b5 100644 --- a/application/hub/main/template/class_BaseXmlTemplateEngine.php +++ b/application/hub/main/template/class_BaseXmlTemplateEngine.php @@ -129,11 +129,18 @@ class BaseXmlTemplateEngine extends BaseTemplateEngine { /** * Load a specified XML template into the engine * + * @param $templateName Optional name of template * @return void */ - public function loadXmlTemplate () { + public function loadXmlTemplate ($templateName = '') { + // Is the template name empty? + if (empty($templateName)) { + // Set generic template name + $templateName = $this->typePrefix . '_' . $this->xmlTemplateType . '_template_type'; + } // END - if + // Set template type - $this->setTemplateType($this->getConfigInstance()->getConfigEntry($this->typePrefix . '_' . $this->xmlTemplateType . '_template_type')); + $this->setTemplateType($this->getConfigInstance()->getConfigEntry($templateName)); // Load the special template $this->loadTemplate($this->xmlTemplateType); @@ -204,11 +211,8 @@ class BaseXmlTemplateEngine extends BaseTemplateEngine { // Get a temporay template instance $templateInstance = XmlTemplateEngineFactory::createXmlTemplateEngineInstance($this->typePrefix . '__' . $this->xmlTemplateType . '_template_class'); - // Create method name - $methodName = 'load' . $this->convertToClassName($this->xmlTemplateType) . 'Template'; - // Then load it - call_user_func(array($templateInstance, $methodName), $templateDependency); + $templateInstance->loadXmlTemplate($templateDependency); // Parse the XML content $templateInstance->renderXmlContent();