public function getTemplateVars(Kwf_Component_Renderer_Abstract $renderer) { $ret = parent::getTemplateVars($renderer); $ret['menu'] = $this->_getMenuData(); foreach ($ret['menu'] as $k => $m) { $ret['menu'][$k]['submenu'] = $this->_getMenuData($m['data'], array(), 'Kwc_Menu_Expanded_EditableItems_Component'); $ret['menu'][$k]['isFirstChildPage'] = is_instance_of($m['data']->componentClass, 'Kwc_Basic_LinkTag_FirstChildPage_Data'); } $ret['level'] = $this->_getSetting('level'); return $ret; }
public function getTemplateVars(Kwf_Component_Renderer_Abstract $renderer) { $ret = parent::getTemplateVars($renderer); $ret['menu'] = $this->_getMenuData(); if ($this->_getSetting('emptyIfSingleEntry')) { if (count($ret['menu']) == 1) { $ret['menu'] = array(); } } $ret['subMenu'] = $this->getData()->getChildComponent('-subMenu'); $ret['separator'] = $this->_getSetting('separator'); $ret['linkPrefix'] = $this->_getSetting('linkPrefix'); return $ret; }
public function getTemplateVars(Kwf_Component_Renderer_Abstract $renderer) { $ret = parent::getTemplateVars($renderer); $ret['categories'] = array(); $itemDirectory = $this->_getItemDirectory(); if ($itemDirectory) { $classes = Kwc_Abstract::getChildComponentClasses($itemDirectory->componentClass); foreach ($classes as $c) { if (Kwc_Abstract::hasSetting($c, 'categoryName')) { $name = Kwc_Abstract::getSetting($c, 'categoryName'); $parent = $itemDirectory->getChildComponent(array('componentClass' => $c)); if ($parent) { $ret['categories'][$name] = $this->_getMenuData($parent); } } } } return $ret; }
public function getTemplateVars() { $ret = parent::getTemplateVars(); $ret['separator'] = $this->_getSetting('separator'); $ret['links'] = array(); $page = $this->getData()->getPage(); do { $ret['links'][] = $page; } while ($page = $page->getParentPage()); $page = $this->getData()->getPage(); if ($this->_getSetting('showHome') && $page) { if (!isset($page->isHome) || !$page->isHome) { $home = Kwf_Component_Data_Root::getInstance()->getRecursiveChildComponents(array('home' => true, 'subRoot' => $this->getData()), array()); if ($home) { $ret['links'][] = $home[0]; } } } $ret['links'] = array_reverse($ret['links']); if (count($ret['links']) && !$this->_getSetting('showCurrentPage')) { array_pop($ret['links']); } $ret['items'] = array(); $i = 0; foreach ($ret['links'] as $l) { $class = ''; if ($i == 0) { $class .= 'first '; } if ($i == count($ret['links']) - 1) { $class .= 'last '; } $ret['items'][] = array('data' => $l, 'class' => trim($class), 'last' => $i == count($ret['links']) - 1); $i++; } return $ret; }
public function getTemplateVars() { $ret = Kwc_Menu_Abstract_Component::getTemplateVars(); $ret['menu'] = $this->_getMenuData(); return $ret; }
public function getTemplateVars(Kwf_Component_Renderer_Abstract $renderer) { $ret = Kwc_Menu_Abstract_Component::getTemplateVars($renderer); $ret['menu'] = $this->_getMenuData(); return $ret; }