Renamed endElement() to finishElement(), see the final implementation in BaseXmlTempl...
[core.git] / inc / classes / main / template / image / class_ImageTemplateEngine.php
index 2c6cb376638bcf68150bda46032cf601f04c4dc6..22262c0952d2ab8ac972b52dc1573a74477f9cf0 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -69,8 +69,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl
        /**
         * Creates an instance of the class TemplateEngine and prepares it for usage
         *
-        * @param       $appInstance    A manageable application
-        * @return      $templateInstance       An instance of TemplateEngine
+        * @return      $templateInstance               An instance of TemplateEngine
         * @throws      BasePathIsEmptyException                If the provided $templateBasePath is empty
         * @throws      InvalidBasePathStringException  If $templateBasePath is no string
         * @throws      BasePathIsNoDirectoryException  If $templateBasePath is no
@@ -78,16 +77,15 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl
         * @throws      BasePathReadProtectedException  If $templateBasePath is
         *                                                                                      read-protected
         */
-       public final static function createImageTemplateEngine (ManageableApplication $appInstance) {
+       public static final function createImageTemplateEngine () {
                // Get a new instance
                $templateInstance = new ImageTemplateEngine();
 
-               // Get language and file I/O instances from application
-               $langInstance = $appInstance->getLanguageInstance();
-               $ioInstance = $appInstance->getFileIoInstance();
+               // Get the application instance from registry
+               $applicationInstance = Registry::getRegistry()->getInstance('app');
 
                // Determine base path
-               $templateBasePath = $templateInstance->getConfigInstance()->getConfigEntry('application_base_path') . $appInstance->getRequestInstance()->getRequestElement('app') . '/';
+               $templateBasePath = $templateInstance->getConfigInstance()->getConfigEntry('application_base_path') . $applicationInstance->getRequestInstance()->getRequestElement('app') . '/';
 
                // Is the base path valid?
                if (empty($templateBasePath)) {
@@ -107,10 +105,6 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl
                // Set the base path
                $templateInstance->setTemplateBasePath($templateBasePath);
 
-               // Set the language and IO instances
-               $templateInstance->setLanguageInstance($langInstance);
-               $templateInstance->setFileIoInstance($ioInstance);
-
                // Set template extensions
                $templateInstance->setRawTemplateExtension($templateInstance->getConfigInstance()->getConfigEntry('raw_template_extension'));
                $templateInstance->setCodeTemplateExtension($templateInstance->getConfigInstance()->getConfigEntry('code_template_extension'));
@@ -191,7 +185,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl
         * @return      void
         * @throws      XmlNodeMismatchException        If current main node mismatches the closing one
         */
-       public function endElement ($resource, $nodeName) {
+       public function finishElement ($resource, $nodeName) {
                // Make all lower-case
                $nodeName = strtolower($nodeName);
 
@@ -326,7 +320,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl
        /**
         * "Setter" for image-string. For more details see above method!
         *
-        * @param       $groupable      Wether this image string is groupable
+        * @param       $groupable      Whether this image string is groupable
         * @return      void
         * @see         ImageTemplateEngine::setImageResolution
         */