Anchors has no longer arguments
[core.git] / inc / classes / main / template / class_BaseTemplateEngine.php
index 5a45bd71bca5f9c5401b7ccc86e58f25ca4284d4..8a58b46d1d6d4d2c4f1950861087b4a9d19a24fe 100644 (file)
@@ -145,10 +145,6 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
        protected function __construct ($className) {
                // Call parent constructor
                parent::__construct($className);
-
-               // Clean up a little
-               $this->removeNumberFormaters();
-               $this->removeSystemArray();
        }
 
        /**
@@ -954,6 +950,8 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
         * @param       $template       The email template we shall load which is located in
         *                                              'emails' by default
         * @return      void
+        * @deprecated
+        * @see         See loadCodeTemplate()
         */
        public function loadEmailTemplate ($template) {
                // Set template type
@@ -1050,7 +1048,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                        );
 
                        // Run the constructed command. This will "compile" all variables in
-                       @eval($eval);
+                       eval($eval);
 
                        // Goes something wrong?
                        if ((!isset($result)) || (empty($result))) {
@@ -1293,42 +1291,18 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
         * @return      void
         * @throws      XmlParserException      If an XML error was found
         */
-       public final function renderXmlContent ($content = null) {
+       public function renderXmlContent ($content = null) {
                // Is the content set?
                if (is_null($content)) {
                        // Get current content
                        $content = $this->getRawTemplateData();
                } // END - if
 
-               // Convert all to UTF8
-               if (function_exists('recode')) {
-                       $content = recode("html..utf8", $content);
-               } else {
-                       // @TODO We need to find a fallback solution here
-               } // END - if
-
-               // Get an XML parser
-               $xmlParser = xml_parser_create();
-
-               // Force case-folding to on
-               xml_parser_set_option($xmlParser, XML_OPTION_CASE_FOLDING, true);
-
-               // Set object
-               xml_set_object($xmlParser, $this);
-
-               // Set handler call-backs
-               xml_set_element_handler($xmlParser, 'startElement', 'endElement');
-               xml_set_character_data_handler($xmlParser, 'characterHandler');
-
-               // Now parse the XML tree
-               if (!xml_parse($xmlParser, $content)) {
-                       // Error found in XML!
-                       //die('<pre>'.htmlentities($content).'</pre>');
-                       throw new XmlParserException(array($this, $xmlParser), BaseHelper::EXCEPTION_XML_PARSER_ERROR);
-               } // END - if
+               // Get a XmlParser instance
+               $parserInstance = ObjectFactory::createObjectByConfiguredName('xml_parser_class', array($this));
 
-               // Free the parser
-               xml_parser_free($xmlParser);
+               // Parse the XML document
+               $parserInstance->parseXmlContent($content);
        }
 }