$this->_navigationFactory->setGateway($this->_pageGateway);
$this->mainNav = $this->_getMainNav($this->_catid);
$this->sideNav = $this->_getSideNav($this->_catid);
+ // main Navigation output
+ $this->mainNavigationUl = $this->_getMainNavigation();
$this->newsletterAction = Toolkit_Template_Page::getSeoUrl(
$this->_pageGateway, 10
*/
private function _getMainNav($catid)
{
- $nav = $this->_navigationFactory->createMainNav();
- $mainNavArray = $nav->getNavStructure($this->_pageGateway, $catid);
-
- return $nav->renderPageNav($mainNavArray, 'tree');
+ $sideNav = new Toolkit_Template_Navigation_AllInOneSideNav(
+ $this->_pageGateway
+ );
+ $nav = $sideNav->getNavigation();
+ $html = $this->_arrayToListHTML($nav);
+ return ($html) ? $html : '';
}
- private function _getArrayToListNav($catid)
+ private function _getMainNavigation()
{
+ if (defined('MAIN_LEVEL_NAV_ARRAY') && MAIN_LEVEL_NAV_ARRAY) {
+ $mainNavArray = unserialize(MAIN_LEVEL_NAV_ARRAY);
+ }
$sideNav = new Toolkit_Template_Navigation_AllInOneSideNav(
$this->_pageGateway
);
$nav = $sideNav->getNavigation();
- $html = $this->_arrayToListHTML($nav, 0, "mainNav");
+ $newNav = array();
+ foreach ($nav as $key => $item) {
+ if (in_array($item['id'], $mainNavArray)) {
+ $key = array_search($item['id'], $mainNavArray);
+ if ($key !== false) {
+ $item['class'] = $key;
+ }
+ $newNav[] = $item;
+ }
+ }
+// echo '<pre>'.print_r($newNav, true).'</pre>';exit;
+ $html = $this->_arrayToListHTML($newNav, 0, 'left');
return ($html) ? $html : '';
}
return;
}
$tabs = str_repeat($tab, $level * 2);
- $mainClass = ($level == 0 && $className) ? ' class="'.$className.'"': '';
+ $mainClass = ($level == 0 && $className)
+ ? ' class="'.$className.'"'
+ : ' class="dropdown"';
$result = "{$tabs}<ul{$mainClass}>\n";
foreach ($array as $i => $node) {
- $class
- = ($node['class'] == 'current')
- ? ' class="'.$node['class'].'"'
- : '';
- $parent
- = ($node['class'] == 'parent')
- ? ' class="'.$node['class'].'"'
- : '';
+ $classes = array();
+// $class
+// = ($node['class'] == 'current')
+// ? ' class="'.$node['class'].'"'
+// : '';
+ if ($node['class']) {
+ $classes[] = $node['class'];
+ }
+ if (!empty($node['pages'])) {
+ $classes[] = 'has-dropdown';
+ }
+ $parent = ' class="'.implode(' ', $classes).'"';
+// $parent
+// = ($node['class'] == 'parent')
+// ? ' class="'.$node['class'].'"'
+// : ' class="not-click"';
$link = sprintf(
$format,
$node['uri'],