Menu engine heavily extended, misc rewrites:
[core.git] / inc / classes / main / template / image / class_ImageTemplateEngine.php
index 19b83c77f90b69991f616afe0c6f322e935c6276..908e4265edf767cfbdc66bfb272c00a69a6e405d 100644 (file)
@@ -51,11 +51,6 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl
                'text'
        );
 
-       /**
-        * Image instance
-        */
-       private $imageInstance = null;
-
        /**
         * Current main node
         */
@@ -217,7 +212,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl
                $methodName = 'finish' . $this->convertToClassName($nodeName);
 
                // Call the corresponding method
-               call_user_func_array(array($this->imageInstance, $methodName), array());
+               call_user_func_array(array($this->getImageInstance(), $methodName), array());
        }
 
        /**
@@ -269,7 +264,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl
                $className = $this->convertToClassName($imageType.'_image');
 
                // And try to initiate it
-               $this->imageInstance = ObjectFactory::createObjectByName($className, array($this));
+               $this->setImageInstance(ObjectFactory::createObjectByName($className, array($this)));
 
                // Set current main node to type
                $this->currMainNode = 'type';
@@ -283,7 +278,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl
         */
        private function setImageResolution () {
                // Call the image class
-               $this->imageInstance->initResolution();
+               $this->getImageInstance()->initResolution();
 
                // Current main node is resolution
                $this->currMainNode = 'resolution';
@@ -297,7 +292,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl
         */
        private function setImageBase () {
                // Call the image class
-               $this->imageInstance->initBase();
+               $this->getImageInstance()->initBase();
 
                // Current main node is resolution
                $this->currMainNode = 'base';
@@ -311,7 +306,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl
         */
        private function setImageBackgroundColor () {
                // Call the image class
-               $this->imageInstance->initBackgroundColor();
+               $this->getImageInstance()->initBackgroundColor();
 
                // Current main node is background-color
                $this->currMainNode = 'background-color';
@@ -325,7 +320,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl
         */
        private function setImageForegroundColor () {
                // Call the image class
-               $this->imageInstance->initForegroundColor();
+               $this->getImageInstance()->initForegroundColor();
 
                // Current main node is foreground-color
                $this->currMainNode = 'foreground-color';
@@ -340,7 +335,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl
         */
        private function setImageImageString ($groupable = 'single') {
                // Call the image class
-               $this->imageInstance->initImageString($groupable);
+               $this->getImageInstance()->initImageString($groupable);
 
                // Current main node is foreground-color
                $this->currMainNode = 'image-string';
@@ -354,7 +349,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl
         */
        private function setImagePropertyName ($imageName) {
                // Call the image class
-               $this->imageInstance->setImageName($imageName);
+               $this->getImageInstance()->setImageName($imageName);
        }
 
        /**
@@ -365,7 +360,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl
         */
        private function setImagePropertyWidth ($width) {
                // Call the image class
-               $this->imageInstance->setWidth($width);
+               $this->getImageInstance()->setWidth($width);
        }
 
        /**
@@ -376,7 +371,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl
         */
        private function setImagePropertyHeight ($height) {
                // Call the image class
-               $this->imageInstance->setHeight($height);
+               $this->getImageInstance()->setHeight($height);
        }
 
        /**
@@ -387,7 +382,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl
         */
        private function setImagePropertyRed ($red) {
                // Call the image class
-               $this->imageInstance->setRed($red);
+               $this->getImageInstance()->setRed($red);
        }
 
        /**
@@ -398,7 +393,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl
         */
        private function setImagePropertyGreen ($green) {
                // Call the image class
-               $this->imageInstance->setGreen($green);
+               $this->getImageInstance()->setGreen($green);
        }
 
        /**
@@ -409,7 +404,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl
         */
        private function setImagePropertyBlue ($blue) {
                // Call the image class
-               $this->imageInstance->setBlue($blue);
+               $this->getImageInstance()->setBlue($blue);
        }
 
        /**
@@ -420,7 +415,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl
         */
        private function setImagePropertyStringName ($stringName) {
                // Call the image class
-               $this->imageInstance->setStringName($stringName);
+               $this->getImageInstance()->setStringName($stringName);
        }
 
        /**
@@ -431,7 +426,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl
         */
        private function setImagePropertyFontSize ($fontSize) {
                // Call the image class
-               $this->imageInstance->setFontSize($fontSize);
+               $this->getImageInstance()->setFontSize($fontSize);
        }
 
        /**
@@ -442,7 +437,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl
         */
        private function setImagePropertyText ($imageString) {
                // Call the image class
-               $this->imageInstance->setString($imageString);
+               $this->getImageInstance()->setString($imageString);
        }
 
        /**
@@ -453,7 +448,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl
         */
        private function setImagePropertyX ($x) {
                // Call the image class
-               $this->imageInstance->setX($x);
+               $this->getImageInstance()->setX($x);
        }
 
        /**
@@ -464,7 +459,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl
         */
        private function setImagePropertyY ($y) {
                // Call the image class
-               $this->imageInstance->setY($y);
+               $this->getImageInstance()->setY($y);
        }
 
        /**
@@ -479,9 +474,9 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl
                        $this->getGenericBasePath(),
                        'images/_cache',
                        md5(
-                               $this->imageInstance->getImageName() . ':' . $this->__toString() . ':' . $this->imageInstance->__toString()
+                               $this->getImageInstance()->getImageName() . ':' . $this->__toString() . ':' . $this->getImageInstance()->__toString()
                        ),
-                       $this->imageInstance->getImageType()
+                       $this->getImageInstance()->getImageType()
                );
 
                // Return it
@@ -496,7 +491,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl
         */
        public function transferToResponse (Responseable $responseInstance) {
                // Set the image instance
-               $responseInstance->setImageInstance($this->imageInstance);
+               $responseInstance->setImageInstance($this->getImageInstance());
        }
 
        /**