当前位置: 首页>>代码示例>>PHP>>正文


PHP MenuItem::setCurrMenuElem方法代码示例

本文整理汇总了PHP中MenuItem::setCurrMenuElem方法的典型用法代码示例。如果您正苦于以下问题:PHP MenuItem::setCurrMenuElem方法的具体用法?PHP MenuItem::setCurrMenuElem怎么用?PHP MenuItem::setCurrMenuElem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MenuItem的用法示例。


在下文中一共展示了MenuItem::setCurrMenuElem方法的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) {
        $countLinks++;
    }
开发者ID:aagusti,项目名称:padl-tng,代码行数:31,代码来源:displaymenu.php

示例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");
//.........这里部分代码省略.........
开发者ID:kcallow,项目名称:MatchMe,代码行数:101,代码来源:xtempl.php


注:本文中的MenuItem::setCurrMenuElem方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。