From 3e50a610d5dab47ee44fa50893c65b92efdce612 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Thu, 10 Jul 2014 11:57:36 -0400 Subject: [PATCH] setup template add navigation Taken from SooLocks mobile nav. removed the class applied to the main ul --- Toolkit/Page.php | 42 +++++++++++++++++++++++++++++++++++++--- templates/template.html | 43 +---------------------------------------- 2 files changed, 40 insertions(+), 45 deletions(-) diff --git a/Toolkit/Page.php b/Toolkit/Page.php index 9ff395e..b0ce188 100755 --- a/Toolkit/Page.php +++ b/Toolkit/Page.php @@ -564,10 +564,46 @@ class Toolkit_Page */ private function _getMainNav($catid) { - $nav = $this->_navigationFactory->createMainNav(); - $mainNavArray = $nav->getNavStructure($this->_pageGateway, $catid); + $sideNav = new Toolkit_Template_Navigation_AllInOneSideNav( + $this->_pageGateway + ); + $nav = $sideNav->getNavigation(); + unset($nav[0]); + $html = $this->_arrayToListHTML($nav); + return ($html) ? $html : ''; + } - return $nav->renderPageNav($mainNavArray, 'tree'); + private function _arrayToListHTML($array, $level = 0) + { + static $tab = "\t", $format = '%s'; + + if (empty($array)) { + return; + } + $tabs = str_repeat($tab, $level * 2); + $result = "{$tabs}\n"; + return $result; } /** diff --git a/templates/template.html b/templates/template.html index 2fed859..0260366 100644 --- a/templates/template.html +++ b/templates/template.html @@ -16,48 +16,7 @@
{if:rotatingImages}
-- 2.17.1