本文整理汇总了PHP中MenuItem::setCurrent方法的典型用法代码示例。如果您正苦于以下问题:PHP MenuItem::setCurrent方法的具体用法?PHP MenuItem::setCurrent怎么用?PHP MenuItem::setCurrent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MenuItem
的用法示例。
在下文中一共展示了MenuItem::setCurrent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Menu
function __construct($page_object, $array_menu)
{
parent::__construct();
$this->render = new Menu();
$wsp_admin_url = WSP_ADMIN_URL;
$menu_items = new MenuItems();
foreach ($array_menu['MenuItems']['MenuItem'] as $menuitems) {
eval("\$page_icon_16 = \"" . $menuitems['Menu_attr']['icon_16'] . "\";");
if (find($menuitems['Menu_attr']['name'], "__(", 0, 0) > 0) {
eval("\$page_title = " . $menuitems['Menu_attr']['name'] . ";");
} else {
eval("\$page_title = \"" . $menuitems['Menu_attr']['name'] . "\";");
}
eval("\$page_link = \"" . $menuitems['Menu_attr']['url'] . "\";");
if ($menuitems['Menu_attr']['url'] == "\$wsp_admin_url/admin.html") {
$page_title = "";
}
$menu_item = new MenuItem($page_title, $page_link, $page_icon_16);
if (isset($_GET['menu'])) {
if ($page_link == $wsp_admin_url . "/admin.html?menu=" . $_GET['menu']) {
$menu_item->setCurrent();
}
}
$menu_items->add($menu_item);
$sub_menu_items = new MenuItems();
if (!isset($menuitems['MenuItems']['MenuItem'][0])) {
$sub_menuitems = $menuitems['MenuItems'];
} else {
$sub_menuitems = $menuitems['MenuItems']['MenuItem'];
}
$nb_sub_menu = 0;
foreach ($sub_menuitems as $menuitem) {
eval("\$page_icon_16 = \"" . $menuitem['Menu_attr']['icon_16'] . "\";");
if (find($menuitem['Menu_attr']['name'], "__(", 0, 0) > 0) {
eval("\$page_title = " . $menuitem['Menu_attr']['name'] . ";");
} else {
eval("\$page_title = \"" . $menuitem['Menu_attr']['name'] . "\";");
}
eval("\$page_link = \"" . $menuitem['Menu_attr']['url'] . "\";");
$sub_menu_item = new MenuItem($page_title, $page_link, $page_icon_16);
if ($page_link == $_GET['p'] . ".html") {
$sub_menu_item->setCurrent();
$menu_item->setCurrent();
}
$sub_menu_items->add($sub_menu_item);
$nb_sub_menu++;
}
if ($nb_sub_menu > 0) {
$menu_item->setMenuItems($sub_menu_items);
}
}
$this->render->setMenuItems($menu_items);
$this->render->activateSupersubs();
list($strAdminLogin, $strAdminPasswd, $strAdminRights) = getWspUserRightsInfo("admin");
if ($strAdminLogin == "admin" && $strAdminPasswd == sha1("admin")) {
$modalbox = new DialogBox(__(CHANGE_PASSWD), new Url($page_object->getBaseLanguageURL() . "wsp-admin/change-passwd.call"));
$modalbox->modal()->setWidth(400);
$page_object->addObject($modalbox);
}
}
示例2: array
$enablePerformMenu = true;
}
$subs = array();
if ($arrAllRights[Perform]['add'] && $_SESSION['isAdmin'] == 'Yes') {
$subs[] = new MenuItem('definekpi', $i18n->__("KPI List"), "index.php?uniqcode=KPI&menu_no_top=performance&uri=performance/listDefineKpi");
$subs[] = new MenuItem('definekpi', $i18n->__("Add KPI"), "index.php?uniqcode=KPI&menu_no_top=performance&uri=performance/saveKpi");
$subs[] = new MenuItem('definekpi', $i18n->__("Copy KPI"), "index.php?uniqcode=KPI&menu_no_top=performance&uri=performance/copyKpi");
$subs[] = new MenuItem('definekpi', $i18n->__("Add Review"), "index.php?uniqcode=KPI&menu_no_top=performance&uri=performance/saveReview");
}
$subs[] = new MenuItem('definekpi', $i18n->__("Reviews"), "index.php?uniqcode=KPI&menu_no_top=performance&uri=performance/viewReview/mode/new");
$menuItem->setSubMenuItems($subs);
$menu[] = $menuItem;
/* Start ESS menu */
if ($_SESSION['isAdmin'] != 'Yes') {
$menuItem = new MenuItem("ess", $i18n->__('My Info'), './symfony/web/index.php/pim/viewPersonalDetails?empNumber=' . $_SESSION['empID'], "rightMenu");
$menuItem->setCurrent($_GET['menu_no_top'] == "ess");
$enableEssMenu = false;
if ($_GET['menu_no_top'] == "ess") {
$enableEssMenu = true;
}
$menu[] = $menuItem;
}
/* Disabling Benefits module: Begins
if (($_SESSION['empID'] != null) || $arrAllRights[Benefits]['view']) {
$menuItem = new MenuItem("benefits", $lang_Menu_Benefits, "./index.php?menu_no_top=benefits");
$menuItem->setCurrent($_GET['menu_no_top'] == "benefits");
$subs = array();
if ($_SESSION['isAdmin'] == "Yes" && $arrAllRights[Benefits]['view']) {
$yearVal = date('Y');