From 1fa9baa4f7aab1bbd009a062bb4e6a545c553e92 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 7 Dec 2009 22:23:11 +0000 Subject: [PATCH] Rewritten to stacker class, old lost methods removed --- .../menu/class_MenuTemplateEngine.php | 106 ++++++------------ 1 file changed, 36 insertions(+), 70 deletions(-) diff --git a/inc/classes/main/template/menu/class_MenuTemplateEngine.php b/inc/classes/main/template/menu/class_MenuTemplateEngine.php index d7c5875c..93382f9c 100644 --- a/inc/classes/main/template/menu/class_MenuTemplateEngine.php +++ b/inc/classes/main/template/menu/class_MenuTemplateEngine.php @@ -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'); } /** -- 2.39.5