function actionPerform(&$skin, $moduleID) { $menu = new Menu($skin->main, 'siteMap', 'Tree'); $content = $menu->getMenuScript(); //Assign codeBehind variable $skin->main->controlVariables["siteMap"] = array('content' => $content); }
/** * Build menu * * @param Menu $menu * @param User $user * @return array */ function documents_handle_on_build_menu(&$menu, &$user) { if ($user->isAdministrator() || $user->getSystemPermission('can_use_documents')) { $menu->addToGroup(array(new MenuItem('documents', lang('Docs'), assemble_url('documents'), get_image_url('icon.gif', DOCUMENTS_MODULE))), 'main'); } // if }
public function testMenuRetrieval() { $menu = new Menu(); $menu->getMenu(); $returned_response = $menu->getJsonString(); $this->assertTrue($returned_response != Null, 'Menu Retrieval Unsuccessful'); }
public function common($uid) { $result = array(); $menuModel = new Menu(); //顶部菜单/底部菜单 for ($i = 1; $i < 7; $i++) { $sql = "select * from {{menu}} where sort = {$i} and position = 1 and userid = {$uid} and pid = 0 "; $data["upmenu_{$i}"] = $menuModel->findBySql($sql); $sql = "select * from {{menu}} where sort = {$i} and position = 2 and userid = {$uid} and pid = 0"; $data["downmenu_{$i}"] = $menuModel->findBySql($sql); } //下拉菜单 $sql = "select * from {{menu}} where pid = (select id from {{menu}} where position = 1 and userid = {$uid} and sort = 3 and pid = 0) and position = 1 and userid = {$uid} order by sort asc "; $data["uplistmenu_3"] = $menuModel->findAllBySql($sql); //视频列表 $mvModel = new Mv(); $sql = "select * from {{mv}} where userid = {$uid} order by sort asc "; $data['mvlist'] = $mvModel->findAllBySql($sql); //音乐列表 // $songModel = new Song(); // $sql = "select * from {{song}} where userid = $uid order by sort asc "; // $data['musiclist'] = $songModel->findAllBySql($sql); //网站个性配置 $webModel = new Config(); $sql = "select * from {{webconfig}} where userid = {$uid} "; $data['webconfig'] = $webModel->findBySql($sql); $data['url'] = "http://" . Yii::app()->params['bucket'] . "." . Yii::app()->params['domain'] . "/"; $data['uid'] = $uid; return $data; }
public static function main($args) { $pancakeHouseMenu = new Menu("PANCAKE HOUSE MENU", "Breakfast"); $dinerMenu = new Menu("DINER MENU", "Lunch"); $cafeMenu = new Menu("CAFE MENU", "Dinner"); $dessertMenu = new Menu("DESSERT MENU", "Dessert of course!"); $coffeeMenu = new Menu("COFFEE MENU", "Stuff to go with your afternoon coffee"); $allMenus = new Menu("ALL MENUS", "All menus combined"); $allMenus->add($pancakeHouseMenu); $allMenus->add($dinerMenu); $allMenus->add($cafeMenu); $pancakeHouseMenu->add(new MenuItem("K&B's Pancake Breakfast", "Pancakes with scrambled eggs, and toast", TRUE, 2.99)); $pancakeHouseMenu->add(new MenuItem("Regular Pancake Breakfast", "Pancakes with fried eggs, sausage", FALSE, 2.99)); $pancakeHouseMenu->add(new MenuItem("Blueberry Pancakes", "Pancakes made with fresh blueberries, and blueberry syrup", TRUE, 3.49)); $pancakeHouseMenu->add(new MenuItem("Waffles", "Waffles, with your choice of blueberries or strawberries", TRUE, 3.59)); $dinerMenu->add(new MenuItem("Vegetarian BLT", "(Fakin') Bacon with lettuce & tomato on whole wheat", TRUE, 2.99)); $dinerMenu->add(new MenuItem("BLT", "Bacon with lettuce & tomato on whole wheat", FALSE, 2.99)); $dinerMenu->add(new MenuItem("Soup of the day", "A bowl of the soup of the day, with a side of potato salad", FALSE, 3.29)); $dinerMenu->add(new MenuItem("Hotdog", "A hot dog, with saurkraut, relish, onions, topped with cheese", FALSE, 3.05)); $dinerMenu->add(new MenuItem("Steamed Veggies and Brown Rice", "Steamed vegetables over brown rice", TRUE, 3.99)); $dinerMenu->add(new MenuItem("Pasta", "Spaghetti with Marinara Sauce, and a slice of sourdough bread", TRUE, 3.89)); $dinerMenu->add($dessertMenu); $dessertMenu->add(new MenuItem("Apple Pie", "Apple pie with a flakey crust, topped with vanilla icecream", TRUE, 1.59)); $dessertMenu->add(new MenuItem("Cheesecake", "Creamy New York cheesecake, with a chocolate graham crust", TRUE, 1.99)); $dessertMenu->add(new MenuItem("Sorbet", "A scoop of raspberry and a scoop of lime", TRUE, 1.89)); $cafeMenu->add(new MenuItem("Veggie Burger and Air Fries", "Veggie burger on a whole wheat bun, lettuce, tomato, and fries", TRUE, 3.99)); $cafeMenu->add(new MenuItem("Soup of the day", "A cup of the soup of the day, with a side salad", FALSE, 3.69)); $cafeMenu->add(new MenuItem("Burrito", "A large burrito, with whole pinto beans, salsa, guacamole", TRUE, 4.29)); $cafeMenu->add($coffeeMenu); $coffeeMenu->add(new MenuItem("Coffee Cake", "Crumbly cake topped with cinnamon and walnuts", TRUE, 1.59)); $coffeeMenu->add(new MenuItem("Bagel", "Flavors include sesame, poppyseed, cinnamon raisin, pumpkin", FALSE, 0.6899999999999999)); $coffeeMenu->add(new MenuItem("Biscotti", "Three almond or hazelnut biscotti cookies", TRUE, 0.89)); $waitress = new Waitress($allMenus); $waitress->printMenu(); }
/** * Add options to main menu * * @param Menu $menu * @param User $user * @return null */ function timetracking_handle_on_build_menu(&$menu, &$user) { if ($user->isAdministrator() || $user->getSystemPermission('use_time_reports')) { $menu->addToGroup(array(new MenuItem('time', lang('Time'), 'https://www.healingcrystals.com/admin/timeSheets.php', get_image_url('navigation/time.gif'))), 'main'); } // if }
public function run() { DB::table('menus')->delete(); DB::table('dish_menu')->delete(); DB::table('recommendations')->delete(); $menu = new Menu(); $menu->menu_date = "2014-03-30"; $menu->save(); foreach (Dish::all() as $dish) { $menu->dishes()->save($dish); } $menu = new Menu(); $menu->menu_date = "2014-04-23"; $menu->save(); foreach (Dish::all() as $dish) { $menu->dishes()->save($dish); } $recommendation = new Recommendation(); $recommendation->menu_id = 1; $recommendation->recommendation = "Today, we has abcxyz for menu 1"; $recommendation->save(); $recommendation = new Recommendation(); $recommendation->menu_id = 2; $recommendation->recommendation = "Today, we has abcxyz for menu 2"; $recommendation->save(); }
function disp() { $t = new Template('../template/system'); $t->set_file('f', 'left.html'); $t->set_block('f', 'row', 'r'); $t->set_block('f', 'menu', 'm'); $t->set_var('addstr', $this->getAddStr('img')); //设置主菜单 $mo = new Menu(&$this->dbObj); $str = $this->loginObj->_baseRuleToStr(); $rule = $mo->cugleMenutree(0, $str); foreach ($rule as $v) { $t->set_var($v); if ($v['ruleimg']) { $t->set_var('img', '<img onMouseOver="event.cancelBubble = true;" onMouseOut="event.cancelBubble = true;" onClick="event.cancelBubble = true;" src="' . WEB_ADMIN_HTTPCOMMON . '/img/' . $v['ruleimg'] . '" align="absmiddle" border="0">'); } else { $t->set_var('img', ''); } $t->parse('m', 'menu', true); } /* $menuData = $this->menuObj->getMenuTreeArr(0); foreach ($menuData as $v){ $t -> set_var($v); $t -> set_var('updstr',$this->getUpdStr($v['importer'],$v['ruleid'],'img')); $t -> set_var('delstr',$this->getDelStr($v['importer'],$v['ruleid'],'img')); $t -> parse('r','row',true); } */ $t->set_var('path', WEB_ADMIN_HTTPPATH . '/common/'); $t->parse('out', 'f'); $t->p('out'); }
public static function create(Menu $xMenu) { if ($xMenu->hasScreen()) { throw new \RuntimeException('The menu already has an another screen'); } return new static($xMenu); }
function getMenu() { $menu = new Menu($this->getName()); $menu->addItem(new Menu_Item("?modus=news_create", "create")); $menu->addItem(new Menu_Item("?modus=news_show", "show")); return $menu->getMenu(); }
function smarty_function_links($params, &$skin) { $menuName = empty($params['menuName']) ? 'MainMenu' : $params['menuName']; $type = empty($params['type']) ? 'Horizontal' : $params['type']; $menu = new Menu($skin->main, $menuName, $type); return $menu->getMenuScript(); }
function Page() { parent::BasePage(); $role = Users::ROLE_GUEST; if ($this->userdata != null) { $role = $this->userdata["role"]; } $content = new Contents(); $menu = new Menu(); $this->smarty->assign('menulist', $menu->get($role, $this->serverurl)); $this->smarty->assign('usefulcontentlist', $content->getForMenuByTypeAndRole(Contents::TYPEUSEFUL, $role)); $this->smarty->assign('articlecontentlist', $content->getForMenuByTypeAndRole(Contents::TYPEARTICLE, $role)); $this->smarty->assign('main_menu', $this->smarty->fetch('mainmenu.tpl')); $this->smarty->assign('useful_menu', $this->smarty->fetch('usefullinksmenu.tpl')); $this->smarty->assign('article_menu', $this->smarty->fetch('articlesmenu.tpl')); $category = new Category(); if ($this->userdata != null) { $parentcatlist = $category->getForMenu($this->userdata["categoryexclusions"]); } else { $parentcatlist = $category->getForMenu(); } $this->smarty->assign('parentcatlist', $parentcatlist); $searchStr = ''; if ($this->page == 'search' && isset($_REQUEST["id"])) { $searchStr = (string) $_REQUEST["id"]; } $this->smarty->assign('header_menu_search', $searchStr); if (isset($_REQUEST["t"])) { $this->smarty->assign('header_menu_cat', $_REQUEST["t"]); } $header_menu = $this->smarty->fetch('headermenu.tpl'); $this->smarty->assign('header_menu', $header_menu); }
function llxHeader($head = '', $title='', $help_url='', $morehtml='') { global $conf,$langs,$user; $langs->load("ftp"); top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers top_menu($head, $title, $target, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers $menu = new Menu(); $MAXFTP=20; $i=1; while ($i <= $MAXFTP) { $paramkey='FTP_NAME_'.$i; //print $paramkey; if (! empty($conf->global->$paramkey)) { $link="/ftp/index.php?idmenu=".$_SESSION["idmenu"]."&numero_ftp=".$i; $menu->add($link, dol_trunc($conf->global->$paramkey,24)); } $i++; } left_menu($menu->liste, $help_url, $morehtml, '', 1); main_area(); }
/** * Function which actially fetch the data from the database * @param object $options * @return nested array of menu nodes. */ private function _fetch($options = array()) { App::import('Model', 'Cakemenu.Menu'); $menu = new Menu(); if (isset($options['subtree'])) { $parent = true; if (isset($options['subtree']['parent'])) { $parent = $options['subtree']['parent']; unset($options['subtree']['parent']); } $subtree = $menu->find('first', array('conditions' => $options['subtree'])); if ($subtree != false) { if ($parent == true) { $conditions = array('Menu.lft >=' => $subtree['Menu']['lft'], 'Menu.rght <=' => $subtree['Menu']['rght']); } else { $conditions = array('Menu.lft >' => $subtree['Menu']['lft'], 'Menu.rght <' => $subtree['Menu']['rght']); } if (isset($options['conditions'])) { $options['conditions'] = am($options['conditions'], $conditions); } else { $options['conditions'] = $conditions; } } unset($options['subtree']); } $nodes = $menu->find('threaded', am(array('order' => 'Menu.lft ASC'), $options)); return $nodes; }
function disp() { $t = new Template(WEB_ADMIN_TMPPATH); $dispObj = new DispAttachRule(&$this->dbObj, $this->getUid()); $t->set_file('f', 'pageconfig.html'); $t->set_block('f', 'row', 'r'); $p = $_GET['pageid'] + 0; $sql = "\r\n\t\t\tSELECT c.configvalue AS userdefalut,o.* FROM " . WEB_ADMIN_TABPOX . "otherrule o \r\n\t\t\t\tLEFT OUTER JOIN " . WEB_ADMIN_TABPOX . "config c ON ( (o.otherruleid = c.otherruleid) AND (c.userid = " . $this->getUid() . ") ) \r\n\t\t\tWHERE (o.isrule = 0) AND (o.issystemvar = 0) AND (o.ruleid = {$p})\r\n\t\t"; $rs = $this->dbObj->GetArray($sql); foreach ($rs as $v) { $t->set_var($dispObj->disp($v, $v['userdefalut'])); $t->parse('r', 'row', true); } $r = ''; $m = new Menu(&$this->dbObj); $s = $m->getRelating($p); for ($i = 0; $i < count($s); $i++) { if ($i == 0) { $r = $s[$i]['rulename']; } else { $r .= ' > ' . $s[$i]['rulename']; } } $t->set_var('updid', $p); $t->set_var('address', $r); $t->set_var('path', WEB_ADMIN_HTTPPATH . '/common/'); $t->parse('out', 'f'); $t->p('out'); }
public function find_menu_item_test() { $menu = new Menu(true); $menu->append(Menu::factory("link")->id("element_1"))->append(Menu::factory("dialog")->id("element_2"))->append(Menu::factory("submenu")->id("element_3")->append(Menu::factory("link")->id("element_3_1"))); $this->assert_equal("element_2", $menu->get("element_2")->id); $this->assert_equal("element_3_1", $menu->get("element_3")->get("element_3_1")->id); }
public function getCaseMenu($params) { G::LoadClass("configuration"); G::LoadClass("case"); global $G_TMP_MENU; global $sStatus; $sStatus = $params['app_status']; $oCase = new Cases(); $conf = new Configurations(); $oMenu = new Menu(); $oMenu->load('caseOptions'); $menuOptions = array(); foreach ($oMenu->Options as $i => $action) { $option = array('id' => $oMenu->Id[$i], 'label' => $oMenu->Labels[$i], 'action' => $action); switch ($option['id']) { case 'STEPS': $option['options'] = array(); break; case 'ACTIONS': $option['options'] = $this->getActionOptions(); break; case 'INFO': $option['options'] = $this->getInformationOptions(); break; } $menuOptions[] = $option; } echo G::json_encode($menuOptions); }
/** * Build menu * * @param Menu $menu * @param User $user * @return array */ function incoming_mail_handle_on_build_menu(&$menu, &$user) { if (($user->isAdministrator() || $user->getSystemPermission('can_use_incoming_mail_frontend')) && ($count_pending = IncomingMails::countPending()) > 0) { $menu->addToGroup(array(new MenuItem('incoming_mail', lang('Inbox'), assemble_url('incoming_mail'), get_image_url('icon_menu.gif', INCOMING_MAIL_MODULE), $count_pending)), 'main'); } // if }
function ProcessRequest() { $menuObj = new Menu(); // $menuObj->LoadSql('module/menu/business/'.Configuration::Instance()->GetValue( 'application',array('db_conn',0,'db_type')).'/menu.sql.php'); $menu = $menuObj->ListAvailableMenu($_SESSION['username'], 'Yes'); return $menu; }
public function actionIndex() { //lay 1 tin moi de hien thi phan tin tuc $headTab = new Menu(); $numHeadTab1 = $headTab->model()->find('alias="tin-dia-phuong"')->id; $cdbNewsLocal = new CDbCriteria(); $cdbNewsLocal->order = 'datecreate DESC'; $cdbNewsLocal->limit = 1; $cdbNewsLocal->condition = 'idmenu =' . $numHeadTab1; $modelNewsLocal = News::model()->find($cdbNewsLocal); if ($modelNewsLocal === NULL) { Yii::app()->user->setFlash('LocalEmpty', 'Dữ liệu đang cập nhật'); $modelLocalMore = Yii::app()->user->setFlash('LocalEmptyMore', 'Dữ liệu đang cập nhật'); } else { //lay 4 tin khac de hien thi phan tin tuc $cdbLocalMore = new CDbCriteria(); $cdbLocalMore->limit = 4; $cdbLocalMore->order = 'datecreate DESC'; $cdbLocalMore->condition = 'id NOT IN ("' . $modelNewsLocal->id . '") AND idmenu=' . $modelNewsLocal->idmenu; $modelLocalMore = News::model()->findAll($cdbLocalMore); } //lay 1 tin moi de hien thi phan Tin cong nghe $numHeadTab2 = $headTab->model()->find('alias="tin-cong-nghe"')->id; $cdbNewsTech = new CDbCriteria(); $cdbNewsTech->order = 'datecreate DESC'; $cdbNewsTech->limit = 1; $cdbNewsTech->condition = 'idmenu =' . $numHeadTab2; $modelNewsTech = News::model()->find($cdbNewsTech); if ($modelNewsTech === NULL) { Yii::app()->user->setFlash('emptyData', 'Dữ liệu đang cập nhật'); $modelTechMore = Yii::app()->user->setFlash('emptyDataMore', 'Dữ liệu đang cập nhật'); } else { //lay 2 tin khac de hien thi phan Tin cong nghe $cdbTechMore = new CDbCriteria(); $cdbTechMore->limit = 2; $cdbTechMore->order = 'datecreate DESC'; $cdbTechMore->condition = 'id NOT IN ("' . $modelNewsTech->id . '") AND idmenu=' . $modelNewsTech->idmenu; $modelTechMore = News::model()->findAll($cdbTechMore); } //lay 1 tin moi de hien thi phan Thong bao $numHeadTab3 = $headTab->model()->find('alias="thong-bao"')->id; $cdbNewsNotify = new CDbCriteria(); $cdbNewsNotify->order = 'datecreate DESC'; $cdbNewsNotify->limit = 1; $cdbNewsNotify->condition = 'idmenu =' . $numHeadTab3; $modelNewsNotify = News::model()->find($cdbNewsNotify); if ($modelNewsNotify === NULL) { Yii::app()->user->setFlash('NofifyEmpty', 'Dữ liệu đang cập nhật'); $modelNotifyMore = Yii::app()->user->setFlash('MoreNofifyEmpty', 'Dữ liệu đang cập nhật'); } else { //lay 2 tin khac de hien thi phan Tin cong nghe $cdbNotifyMore = new CDbCriteria(); $cdbNotifyMore->limit = 2; $cdbNotifyMore->order = 'datecreate DESC'; $cdbNotifyMore->condition = 'id NOT IN ("' . $modelNewsNotify->id . '") AND idmenu=' . $modelNewsNotify->idmenu; $modelNotifyMore = News::model()->findAll($cdbNotifyMore); } $this->render('index', array('modelNewsLocal' => $modelNewsLocal, 'modelLocalMore' => $modelLocalMore, 'modelNewsTech' => $modelNewsTech, 'modelTechMore' => $modelTechMore, 'modelNewsNotify' => $modelNewsNotify, 'modelNotifyMore' => $modelNotifyMore)); }
function s_menu_replace(array $matches) { if (isset($matches[1])) { $dD = new DataStore(); $o_Menu = new Menu($dD->get_menu_data_from_name($matches[1])); return $o_Menu->render(); } }
function ProcessRequest() { $menuObj = new Menu(); $menuObj->LoadSql('module/menu/business/' . Configuration::Instance()->GetValue('application', array('db_conn', 0, 'db_type')) . '/menu.sql.php'); $menu = $menuObj->ListAllAvailableSubMenuForGroup($_SESSION['username'], $_GET['dmmid']); //print_r($menu);exit; return $menu; }
/** * @param $id * * @return bool */ public function hasChildItems($id) { $count = $this->menu->where('parent_id', $id)->where('is_published', 1)->where('lang', $this->getLang())->get()->count(); if ($count === 0) { return false; } return true; }
/** * Build menu * * @param Menu $menu * @param User $user * @return array */ function status_handle_on_build_menu(&$menu, &$user) { if ($user->isAdministrator() || $user->getSystemPermission('can_use_status_updates')) { $last_visit = UserConfigOptions::getValue('status_update_last_visited', $user); $menu->addToGroup(array(new MenuItem('status', lang('Status'), assemble_url('status_updates'), get_image_url('icon_menu.gif', STATUS_MODULE), StatusUpdates::countNewMessagesForUser($user, $last_visit))), 'main'); } // if }
public function __construct() { parent::__construct(); $role = Users::ROLE_GUEST; if ($this->userdata != null) { $role = $this->userdata["role"]; } $content = new Contents(['Settings' => $this->settings]); $menu = new Menu($this->settings); $this->smarty->assign('menulist', $menu->get($role, $this->serverurl)); $this->smarty->assign('usefulcontentlist', $content->getForMenuByTypeAndRole(Contents::TYPEUSEFUL, $role)); $this->smarty->assign('articlecontentlist', $content->getForMenuByTypeAndRole(Contents::TYPEARTICLE, $role)); $this->smarty->assign('main_menu', $this->smarty->fetch('mainmenu.tpl')); $this->smarty->assign('useful_menu', $this->smarty->fetch('usefullinksmenu.tpl')); $this->smarty->assign('article_menu', $this->smarty->fetch('articlesmenu.tpl')); $category = new Category(['Settings' => $content->pdo]); if ($this->userdata != null) { $parentcatlist = $category->getForMenu($this->userdata["categoryexclusions"]); } else { $parentcatlist = $category->getForMenu(); } // Add in system types to console categories to make the boot strap drop down list less long. $consoleCatList = array(); foreach ($parentcatlist as $parent) { if ($parent['title'] === 'Console') { foreach ($parent['subcatlist'] as $consoleCat) { if (preg_match('/^XBOX/i', $consoleCat['title'])) { $consoleCatList['Microsoft'][] = $consoleCat; } else { if (preg_match('/^([3N]DS|N?GC)$|^WII/i', $consoleCat['title'])) { $consoleCatList['Nintendo'][] = $consoleCat; } else { if (preg_match('/PS[\\dXP ]/i', $consoleCat['title'])) { $consoleCatList['Sony'][] = $consoleCat; } else { $consoleCatList['Other'][] = $consoleCat; } } } } break; } } $this->smarty->assign('consolecatlist', $consoleCatList); $this->smarty->assign('parentcatlist', $parentcatlist); $searchStr = ''; if ($this->page == 'search' && isset($_REQUEST["id"])) { $searchStr = (string) $_REQUEST["id"]; } $this->smarty->assign('header_menu_search', $searchStr); if (isset($_REQUEST["t"])) { $this->smarty->assign('header_menu_cat', $_REQUEST["t"]); } else { $this->smarty->assign('header_menu_cat', ''); } $header_menu = $this->smarty->fetch('headermenu.tpl'); $this->smarty->assign('header_menu', $header_menu); }
public function actionManage() { $model = new Menu(ActiveRecord::SCENARIO_SEARCH); $model->unsetAttributes(); if (isset($_GET['Menu'])) { $model->attributes = $_GET['Menu']; } $this->render('manage', ['model' => $model]); }
public function node($title, $prefix = null, $route = null, $role = null, array $attributes = array()) { $node = $this->menu->newNode($title, $prefix, $route, $role, $attributes); if (!$node instanceof MenuNode) { return null; } $node->setParent($this); $this->children[$node->title] = $node; }
function menu_loader($menuname) { $menucour = ""; if ($this->includer->include_pratikclass("menu")) { $instanceMenu = new Menu($this->db, $this->lang, $this->droit); $menucour = $instanceMenu->menu_loader($menuname); } return $menucour; }
/** * Draw a teaser defined with the teaser plugin * @id internal id of the teaser. matched pgn_teaser.fkid. */ function drawPGNTeaser($id) { global $cds, $db; $result = ''; $query = new query($db, "Select * FROM pgn_teaser Where FKID=" . $id); if ($query->getrow()) { $href = $query->field("HREF"); if (substr($href, 0, 4) == "www.") { $href = 'http://' . $href; } $popup = $href != ""; $spid = $query->field('SPID'); if ($spid != "0" && $href == "") { $menu = new Menu(null, $spid, $cds->variation, $cds->level); $href = $menu->getLink(); } $imageid = $query->field("IMAGEID"); $aTag = '<a href="' . $href . '"'; if ($popup) { $aTag .= ' target="_blank"'; } $aTag .= '>'; // image teaser if ($query->field("ISIMAGETEASER") == "1") { $result = $aTag . $cds->content->getById($imageid) . '</a>'; } else { // usual teaser $headline = $query->field("HEADLINE"); $body = $query->field("BODY"); $linktext = $query->field("LINKTEXT"); if ($linktext == "") { $linktext = "read more"; } $result = '<div class="teaser">'; if ($headline != "") { $result .= '<b>' . $headline . '</b><br>'; } if ($imageid != "0") { $result .= $aTag . $cds->content->getById($imageid) . '</a><br>'; } if ($body != "") { $result .= $body; } if ($query->field("RESOLVECHILDS") != "1" || $spid == "0" && $href == "") { $result .= ' ' . $aTag . $linktext . '</a>'; } else { $childs = $menu->lowerLevel(); for ($i = 0; $i < count($childs); $i++) { $result .= '<br/>'; $result .= $childs[$i]->getTag(); } } $result .= '</div>'; } } return $result; }
public function render(Menu $menu) { $html = '<ul class="nav navbar-nav">'; foreach ($menu->getChildren() as $menu_elem) { $html .= $this->renderElem($menu_elem); } $html .= '</ul>'; return $html; }