From b9150fa200886f629ea33f37e06690ee56292972 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Sun, 5 Apr 2015 22:25:03 +0200 Subject: [PATCH] Basicly finished menu rendering (wow). MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- inc/classes/main/menu/class_BaseMenu.php | 5 +++-- .../template/menu/class_MenuTemplateEngine.php | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/inc/classes/main/menu/class_BaseMenu.php b/inc/classes/main/menu/class_BaseMenu.php index fa32207b..1f3512b6 100644 --- a/inc/classes/main/menu/class_BaseMenu.php +++ b/inc/classes/main/menu/class_BaseMenu.php @@ -79,8 +79,9 @@ class BaseMenu extends BaseFrameworkSystem { * @return void */ public function transferContentToTemplateEngine (CompileableTemplate $templateInstance) { - $this->debugInstance(); - $this->partialStub('templateInstance=' . $templateInstance->__toString()); + // Assign menu content to variable + $templateInstance->assignVariable('menu_content', $this->getTemplateInstance()->getMenuContent()); + //* DEBUG */ $templateInstance->debugInstance(); } } diff --git a/inc/classes/main/template/menu/class_MenuTemplateEngine.php b/inc/classes/main/template/menu/class_MenuTemplateEngine.php index e11548fb..d118bae7 100644 --- a/inc/classes/main/template/menu/class_MenuTemplateEngine.php +++ b/inc/classes/main/template/menu/class_MenuTemplateEngine.php @@ -828,6 +828,22 @@ class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTempla $this->menuEntries = array(); } + /** + * "Getter" for menu content + * + * @return $menuContent Returned menu content + */ + public function getMenuContent () { + // Implode menuBlocks + $menuContent = implode('', $this->menuBlocks); + + // Clean variable + $this->menuBlocks = array(); + + // And return it + return $menuContent; + } + /** * Getter for menu cache file (FQFN) * -- 2.39.5