本文整理汇总了PHP中MenuItem::setMenuSession方法的典型用法代码示例。如果您正苦于以下问题:PHP MenuItem::setMenuSession方法的具体用法?PHP MenuItem::setMenuSession怎么用?PHP MenuItem::setMenuSession使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MenuItem
的用法示例。
在下文中一共展示了MenuItem::setMenuSession方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
}
}
if ($pageType == PAGE_MENU && IsAdmin() && !isMobile()) {
$xt->assign("adminarea_link", true);
}
} else {
//Admin Area menu items
$xt->assign("adminAreaTypeMenu", true);
}
// need to predefine vars
$nullParent = NULL;
$rootInfoArr = array("id" => 0, "href" => "");
// create treeMenu instance
$menuRoot = new MenuItem($rootInfoArr, $pageObject->menuNodes, $nullParent);
// call xtempl assign, set session params
$menuRoot->setMenuSession();
$menuRoot->assignMenuAttrsToTempl($xt);
$menuRoot->setCurrMenuElem($xt);
// $menuRoot->clearMenuSession();
$xt->assign("mainmenu_block", true);
$rOrder = $xt->getReadingOrder();
$mainmenu = array();
if (isEnableSection508()) {
$mainmenu["begin"] = "<a name=\"skipmenu\"></a>";
}
$mainmenu["end"] = '';
//$mainmenu["end"]='<script type="text/javascript" language="javascript" src="include/jquery.dropshadow.js"></script>';
$countLinks = 0;
$countGroups = 0;
foreach ($menuRoot->children as $ind => $val) {
if ($val->showAsLink) {
示例2: array
function xt_displaymenu($params)
{
global $strTableName, $pageName;
$menuparams = array();
foreach ($params as $p) {
$menuparams[] = $p;
}
$menuId = $menuparams[0];
$ProjectSettings = new ProjectSettings();
$menuName = $ProjectSettings->getMenuName($this->template_file, $menuId, $menuparams[1]);
$menuStyle = $ProjectSettings->getMenuStyle($this->template_file, $menuId, $menuparams[1]);
$isMobyleLayout = isMobile();
array_shift($menuparams);
global $pageObject;
$pageType = "";
$pageMode = 0;
$menuNodes = array();
$isAdminTable = false;
if (isset($pageObject)) {
$pageObject->getMenuNodes();
$pageType = $pageObject->pageType;
$pageMode = $pageObject->mode;
$isAdminTable = $pageObject->isAdminTable();
if ($isAdminTable) {
$menuName = "adminarea";
}
$menuNodes = $pageObject->getMenuNodes($menuName);
}
$xt = new Xtempl();
$xt->assign("menuName", $menuName);
$xt->assign("menustyle", $menuStyle ? "second" : "main");
$quickjump = false;
$horizontal = false;
if (count($menuparams)) {
if ($menuparams[0] == "horizontal") {
$horizontal = true;
} elseif ($menuparams[0] == "quickjump") {
$quickjump = true;
}
}
if (!$isAdminTable) {
if (!$quickjump) {
if (!$isMobyleLayout) {
$xt->assign("simpleTypeMenu", true);
} else {
$xt->assign("treeLikeTypeMenu", true);
}
}
if ($pageType == PAGE_MENU && IsAdmin() && !$isMobyleLayout) {
$xt->assign("adminarea_link", true);
}
} else {
//Admin Area menu items
$xt->assign("adminAreaTypeMenu", true);
}
// need to predefine vars
$nullParent = NULL;
$rootInfoArr = array("id" => 0, "href" => "");
// create treeMenu instance
$menuNodesIndex = 0;
$menuMap = array();
$menuRoot = new MenuItem($rootInfoArr, $menuNodes, $nullParent, $menuMap);
// call xtempl assign, set session params
$menuRoot->setMenuSession();
$menuRoot->assignMenuAttrsToTempl($xt);
$menuRoot->setCurrMenuElem($xt);
$xt->assign("mainmenu_block", true);
$mainmenu = array();
if (isEnableSection508()) {
$mainmenu["begin"] = "<a name=\"skipmenu\"></a>";
}
$mainmenu["end"] = '';
$countLinks = 0;
$countGroups = 0;
$showMenuCollapseExpandAll = false;
foreach ($menuRoot->children as $ind => $val) {
if ($val->showAsLink) {
$countLinks++;
}
if ($val->showAsGroup) {
if (count($val->children)) {
$showMenuCollapseExpandAll = true;
}
$countGroups++;
}
}
$xt->assign("menu_collapse_expand_all", $showMenuCollapseExpandAll);
if ($pageType == PAGE_MENU || $countLinks > 1 || $countGroups > 0) {
$xt->assignbyref("mainmenu_block", $mainmenu);
if ($this->layout->version == 1) {
$menuName = "old" . $menuName;
}
if ($quickjump) {
$xt->display($menuName . "_" . "mainmenu_quickjump.htm");
} else {
if ($horizontal) {
$xt->display($menuName . "_" . "mainmenu_horiz.htm");
} else {
if ($isMobyleLayout && $this->layout->version != 1) {
$xt->display($menuName . "_" . "mainmenu_m.htm");
//.........这里部分代码省略.........