Renamed endElement() to finishElement(), see the final implementation in BaseXmlTempl...
[core.git] / inc / classes / main / template / image / class_ImageTemplateEngine.php
index 3a692e1f2fc5c886224f75f319d33cbffa604e16..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 - 2011 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,12 +77,15 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl
         * @throws      BasePathReadProtectedException  If $templateBasePath is
         *                                                                                      read-protected
         */
-       public static final function createImageTemplateEngine (ManageableApplication $appInstance) {
+       public static final function createImageTemplateEngine () {
                // Get a new instance
                $templateInstance = new ImageTemplateEngine();
 
+               // 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)) {
@@ -183,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);
 
@@ -318,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
         */