Rewritten to stacker class, old lost methods removed
authorRoland Häder <roland@mxchange.org>
Mon, 7 Dec 2009 22:23:11 +0000 (22:23 +0000)
committerRoland Häder <roland@mxchange.org>
Mon, 7 Dec 2009 22:23:11 +0000 (22:23 +0000)
inc/classes/main/template/menu/class_MenuTemplateEngine.php

index d7c5875ce950e2300353b4a4ed270777e2f0b173..93382f9c8c2a4aa0249bdef3eaaebbd6dfe17121 100644 (file)
@@ -328,36 +328,19 @@ class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTempla
                // Handle the dependency template
                $this->handleTemplateDependency('menu', $templateDependency);
 
-               // Code cleaned up...
-               $this->partialStub('Cleaned because we do not want templates with partly HTML code.');
-       }
-
-       /**
-        * Finishes the menu
-        *
-        * @return      void
-        */
-       private function finishMenu () {
-               $this->partialStub('Cleaned because we do not want templates with partly HTML code.');
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('current_node', 'menu');
        }
 
        /**
-        * Starts the menu entries by loading a (maybe) provided template dependency
+        * Starts the menu entries
         *
         * @param       $templateDependency     A template to load to satisfy dependencies
         * @return      void
         */
-       private function startEntryList ($templateDependency = '') {
-               $this->partialStub('Cleaned because we do not want templates with partly HTML code.');
-       }
-
-       /**
-        * Finishes the menu entries
-        *
-        * @return      void
-        */
-       private function finishEntryList () {
-               $this->partialStub('Cleaned because we do not want templates with partly HTML code.');
+       private function startEntryList () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('current_node', 'entry-list');
        }
 
        /**
@@ -366,16 +349,8 @@ class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTempla
         * @return      void
         */
        private function startBlockHeader () {
-               $this->partialStub('Cleaned because we do not want templates with partly HTML code.');
-       }
-
-       /**
-        * Finishes the menu block header
-        *
-        * @return      void
-        */
-       private function finishBlockHeader () {
-               $this->partialStub('Cleaned because we do not want templates with partly HTML code.');
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('current_node', 'block-header');
        }
 
        /**
@@ -384,16 +359,8 @@ class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTempla
         * @return      void
         */
        private function startBlockFooter () {
-               $this->partialStub('Cleaned because we do not want templates with partly HTML code.');
-       }
-
-       /**
-        * Finishes the menu block footer
-        *
-        * @return      void
-        */
-       private function finishBlockFooter () {
-               $this->partialStub('Cleaned because we do not want templates with partly HTML code.');
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('current_node', 'block-footer');
        }
 
        /**
@@ -717,44 +684,43 @@ class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTempla
        }
 
        /**
-        * Starts the menu text
+        * Finishes the menu entries
         *
         * @return      void
         */
-       private function startText () {
-               // Do we have a template instance?
-               if (is_null($this->getTemplateInstance())) {
-                       // Init template instance for underlaying web templates
-                       $templateInstance = ObjectFactory::createObjectByConfiguredName('web_template_class');
-
-                       // Set it in this template engine
-                       $this->setTemplateInstance($templateInstance);
-               } // END - if
-
-               // Load the text template for this page
-               $this->getTemplateInstance()->loadCodeTemplate('menu_text_start');
-
-               // Set the variable group to page
-               $this->setVariableGroup('menu');
-
-               // Set its content in this template instance
-               $this->assignVariable('text', $this->getTemplateInstance()->getRawTemplateData());
+       private function finishEntryList () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('current_node');
        }
 
        /**
-        * Finishes the menu text
+        * Finishes the menu block header
         *
         * @return      void
         */
-       private function finishText () {
-               // Load the text template for this page
-               $this->getTemplateInstance()->loadCodeTemplate('menu_text_end');
+       private function finishBlockHeader () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('current_node');
+       }
 
-               // Set the variable group to page
-               $this->setVariableGroup('menu');
+       /**
+        * Finishes the menu block footer
+        *
+        * @return      void
+        */
+       private function finishBlockFooter () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('current_node');
+       }
 
-               // Set its content in this template instance
-               $this->assignVariable('text_end', $this->getTemplateInstance()->getRawTemplateData());
+       /**
+        * Finishes the menu
+        *
+        * @return      void
+        */
+       private function finishMenu () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('current_node');
        }
 
        /**