private function getMenu($active) { $language = OW::getLanguage(); $list = BOL_FlagService::getInstance()->findTypeList(); $mil = array(); $i = 0; foreach ($list as $type) { $mi = new BASE_MenuItem(); $c = BOL_FlagService::getInstance()->countFlaggedItems($type['type']); $a = explode('+', $type['langKey']); $mi->setLabel($language->text($a[0], $a[1]) . ($c > 0 ? " ({$c})" : ''))->setKey($type['type'])->setOrder($i++)->setUrl(OW::getRouter()->urlFor('BASE_CTRL_Flags', 'index', array('type' => $type['type']))); if ($active == $type) { $mi->isActive(true); } $mil[] = $mi; } return new BASE_CMP_ContentMenu($mil); }
protected function getItemViewData(BASE_MenuItem $menuItem) { return array('label' => $menuItem->getLabel(), 'url' => $menuItem->getUrl(), 'class' => $menuItem->getPrefix() . '_' . $menuItem->getKey(), 'iconClass' => $menuItem->getIconClass(), 'active' => $menuItem->isActive(), 'new_window' => $menuItem->getNewWindow(), 'prefix' => $menuItem->getPrefix(), 'key' => $menuItem->getKey()); }