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


PHP MenuItem::select方法代码示例

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


在下文中一共展示了MenuItem::select方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: select

 /**
  * set node and all subnodes selected
  */
 public function select()
 {
     $this->selected = true;
     if ($this->parent != null) {
         $this->parent->select();
     }
 }
开发者ID:paudam,项目名称:opnsense-core,代码行数:10,代码来源:MenuItem.php

示例2: dispMenu

function dispMenu($intSectionNum)
{
    global $MAIN_ROOT, $LOGGED_IN, $mysqli, $shoutBoxPostLink, $shoutBoxDeleteLink, $shoutBoxEditLink, $arrShoutBoxIDs, $websiteInfo, $arrLoginInfo;
    echo "<div id='menuSection_" . $intSectionNum . "'>";
    $menuCatObj = new MenuCategory($mysqli);
    $menuItemObj = new MenuItem($mysqli);
    $customPageObj = new Basic($mysqli, "custompages", "custompage_id");
    $customFormObj = new CustomForm($mysqli);
    $downloadCatObj = new Basic($mysqli, "downloadcategory", "downloadcategory_id");
    $memberObj = new Member($mysqli);
    $pollObj = new Poll($mysqli);
    if ($LOGGED_IN) {
        $intMenuAccessType = 1;
    } else {
        $intMenuAccessType = 2;
    }
    $arrMenuCategories = $menuCatObj->getCategories($intSectionNum, $intMenuAccessType);
    foreach ($arrMenuCategories as $menuCatID) {
        $menuCatObj->select($menuCatID);
        $menuCatInfo = $menuCatObj->get_info();
        $arrMenuItems = $menuItemObj->getItems($menuCatInfo['menucategory_id'], $intMenuAccessType);
        if ($menuCatInfo['headertype'] == "image") {
            echo "<img src='" . $MAIN_ROOT . $menuCatInfo['headercode'] . "' class='menuHeaderImg'><br>";
        } else {
            $menuCatInfo['headercode'] = str_replace("[MAIN_ROOT]", $MAIN_ROOT, $menuCatInfo['headercode']);
            $menuCatInfo['headercode'] = str_replace("[MEMBER_ID]", $arrLoginInfo['memberID'], $menuCatInfo['headercode']);
            $menuCatInfo['headercode'] = str_replace("[MEMBERUSERNAME]", $arrLoginInfo['memberUsername'], $menuCatInfo['headercode']);
            $menuCatInfo['headercode'] = str_replace("[MEMBERRANK]", $arrLoginInfo['memberRank'], $menuCatInfo['headercode']);
            $menuCatInfo['headercode'] = str_replace("[PMLINK]", $arrLoginInfo['pmLink'], $menuCatInfo['headercode']);
            echo $menuCatInfo['headercode'];
        }
        foreach ($arrMenuItems as $menuItemID) {
            $menuItemObj->select($menuItemID);
            $menuItemInfo = $menuItemObj->get_info();
            $menuItemInfo['itemtype'] = $menuItemInfo['itemtype'] == "customcode" || $menuItemInfo['itemtype'] == "customformat" ? "customblock" : $menuItemInfo['itemtype'];
            switch ($menuItemInfo['itemtype']) {
                case "link":
                    $menuItemObj->objLink->select($menuItemInfo['itemtype_id']);
                    $menuLinkInfo = $menuItemObj->objLink->get_info();
                    $checkURL = parse_url($menuLinkInfo['link']);
                    if (!isset($checkURL['scheme']) || ($checkURL['scheme'] = "")) {
                        $menuLinkInfo['link'] = $MAIN_ROOT . $menuLinkInfo['link'];
                    }
                    echo "<div style='text-align: " . $menuLinkInfo['textalign'] . "'>&nbsp;&nbsp;" . $menuLinkInfo['prefix'] . "<a href='" . $menuLinkInfo['link'] . "' target='" . $menuLinkInfo['linktarget'] . "'>" . $menuItemInfo['name'] . "</a></div>";
                    break;
                case "top-players":
                    $dispTopPlayers = unserialize(SPECIAL_MENU_ITEM);
                    echo $dispTopPlayers['top-players'];
                    break;
                case "customform":
                    $menuItemObj->objCustomPage->select($menuItemInfo['itemtype_id']);
                    $menuCustomFormInfo = $menuItemObj->objCustomPage->get_info();
                    $customFormObj->select($menuCustomFormInfo['custompage_id']);
                    echo "<div style='text-align: " . $menuCustomFormInfo['textalign'] . "'>&nbsp;&nbsp;" . $menuCustomFormInfo['prefix'] . "<a href='" . $MAIN_ROOT . "customform.php?pID=" . $menuCustomFormInfo['custompage_id'] . "' target='" . $menuCustomFormInfo['linktarget'] . "'>" . $customFormObj->get_info_filtered("name") . "</a></div>";
                    break;
                case "custompage":
                    $menuItemObj->objCustomPage->select($menuItemInfo['itemtype_id']);
                    $menuCustomPageInfo = $menuItemObj->objCustomPage->get_info();
                    $customPageObj->select($menuCustomPageInfo['custompage_id']);
                    echo "<div style='text-align: " . $menuCustomPageInfo['textalign'] . "'>&nbsp;&nbsp;" . $menuCustomPageInfo['prefix'] . "<a href='" . $MAIN_ROOT . "custompage.php?pID=" . $menuCustomPageInfo['custompage_id'] . "' target='" . $menuCustomPageInfo['linktarget'] . "'>" . $customPageObj->get_info_filtered("pagename") . "</a></div>";
                    break;
                case "downloads":
                    $menuItemObj->objCustomPage->select($menuItemInfo['itemtype_id']);
                    $menuDownloadLinkInfo = $menuItemObj->objCustomPage->get_info();
                    $downloadCatObj->select($menuDownloadLinkInfo['custompage_id']);
                    echo "<div style='text-align: " . $menuDownloadLinkInfo['textalign'] . "'>&nbsp;&nbsp;" . $menuDownloadLinkInfo['prefix'] . "<a href='" . $MAIN_ROOT . "downloads/index.php?catID=" . $menuDownloadLinkInfo['custompage_id'] . "' target='" . $menuDownloadLinkInfo['linktarget'] . "'>" . $downloadCatObj->get_info_filtered("name") . "</a></div>";
                    break;
                case "customblock":
                    $menuItemObj->objCustomBlock->select($menuItemInfo['itemtype_id']);
                    $menuCustomBlockInfo = $menuItemObj->objCustomBlock->get_info();
                    $menuCustomBlockInfo['code'] = str_replace("[MAIN_ROOT]", $MAIN_ROOT, $menuCustomBlockInfo['code']);
                    $menuCustomBlockInfo['code'] = str_replace("[MEMBER_ID]", $arrLoginInfo['memberID'], $menuCustomBlockInfo['code']);
                    $menuCustomBlockInfo['code'] = str_replace("[MEMBERUSERNAME]", $arrLoginInfo['memberUsername'], $menuCustomBlockInfo['code']);
                    $menuCustomBlockInfo['code'] = str_replace("[MEMBERRANK]", $arrLoginInfo['memberRank'], $menuCustomBlockInfo['code']);
                    $menuCustomBlockInfo['code'] = str_replace("[PMLINK]", $arrLoginInfo['pmLink'], $menuCustomBlockInfo['code']);
                    echo $menuCustomBlockInfo['code'];
                    break;
                case "image":
                    $menuItemObj->objImage->select($menuItemInfo['itemtype_id']);
                    $menuImageInfo = $menuItemObj->objImage->get_info();
                    $checkURL = parse_url($menuItemInfo['imageurl']);
                    if (!isset($checkURL['scheme']) || ($checkURL['scheme'] = "")) {
                        $menuImageInfo['imageurl'] = $MAIN_ROOT . $menuImageInfo['imageurl'];
                    }
                    $dispSetWidth = "";
                    if ($menuImageInfo['width'] != 0) {
                        $dispSetWidth = "width: " . $menuImageInfo['width'] . "px; ";
                    }
                    $dispSetHeight = "";
                    if ($menuImageInfo['height'] != 0) {
                        $dispSetHeight = "height: " . $menuImageInfo['height'] . "px; ";
                    }
                    echo "<div style='text-align: " . $menuImageInfo['imagealign'] . "; margin-top: 15px; margin-bottom: 15px'>";
                    if ($menuImageInfo['link'] != "") {
                        $checkURL = parse_url($menuImageInfo['link']);
                        if (!isset($checkURL['scheme']) || ($checkURL['scheme'] = "")) {
                            $menuImageInfo['link'] = $MAIN_ROOT . $menuImageInfo['link'];
                        }
                        echo "<a href='" . $menuImageInfo['link'] . "' target='" . $menuImageInfo['linktarget'] . "'><img src='" . $menuImageInfo['imageurl'] . "' style='" . $dispSetWidth . $dispSetHeight . "' title='" . $menuItemInfo['name'] . "'></a>";
                    } else {
//.........这里部分代码省略.........
开发者ID:bluethrust,项目名称:clanscriptsv4,代码行数:101,代码来源:_menus.php

示例3: bootstrap_alert

			      	</div>
			    </div>
					
					<?php 
    }
} else {
    bootstrap_alert(array('error' => 'No items to display.'));
}
?>
		<br />
		<h3>Other Menu Items<a class="btn btn-default btn-sm pull-right" onclick="toggleAll('remain-menu',this)">Expand All</a></h3>
		<hr>
		<?php 
if ($all_categories) {
    foreach ($all_categories as $category) {
        $menu_items = MenuItem::select(array('category_id' => $category->id, 'available' => '0'));
        if (is_object($menu_items)) {
            $menu_items = array($menu_items);
        }
        ?>
			  	<div class="panel panel-success">
			      	<div class="panel-heading" role="tab" id="collapseDivHeadUnav-<?php 
        echo $category->id;
        ?>
">
				        <h4 class="panel-title">
				          	<a class="collapsed center-block" data-toggle="collapse" href="#collapseDivUnav-<?php 
        echo $category->id;
        ?>
" aria-expanded="false" aria-controls="collapseDivUnav-<?php 
        echo $category->id;
开发者ID:vivek201,项目名称:canteen-mgmt,代码行数:31,代码来源:menu.view.php

示例4: loadItem

 public function loadItem($id)
 {
     $menuItem = new MenuItem();
     $select = $menuItem->select();
     $select->from('MenuItemData', array('MID_Style', 'MID_Secured', 'MID_loadImage', 'MID_Show', 'MID_Image', 'MID_ImgAndTitle'))->setIntegrityCheck(false)->joinInner('MenuItemIndex', 'MID_ID = MII_MenuItemDataID', array('MII_Title', 'MII_Link', 'MII_PageID', 'MII_Placeholder'))->where('MII_LanguageID = ?', Zend_registry::get('currentEditLanguage'))->where('MID_ID = ?', $id);
     $row = $menuItem->fetchRow($select);
     if ($row) {
         $isPage = $row['MII_PageID'] != -1;
         $menuItemType = 'page';
         if ($row['MII_Placeholder']) {
             $menuItemType = 'placeholder';
         }
         if (!empty($row['MII_Link'])) {
             $menuItemType = 'external';
         }
         $tmp = array('MenuTitle' => $row['MII_Title'] != '' ? $row['MII_Title'] : '', 'MenuLink' => $row['MII_Link'] != '' ? $row['MII_Link'] : '', 'menuItemSecured' => $row['MID_Secured'], 'menuImage' => $row['MID_Image'], 'loadImage' => $row['MID_loadImage'], 'MID_Show' => $row['MID_Show'], 'menuImgAndTitle' => $row['MID_ImgAndTitle'], 'menuItemType' => $menuItemType, 'pagePicker' => $isPage ? $row['MII_PageID'] : '', 'ControllerName' => $isPage ? $this->getControllerNameByID($row['MII_PageID']) : '', 'MenuTitleStyle' => $row['MID_Style']);
     } else {
         $tmp = array('MenuTitle' => '', 'MenuLink' => '', 'menuItemSecured' => '', 'menuImage' => '', 'loadImage' => '', 'menuImgAndTitle' => '', 'MenuType' => 'external', 'pagePicker' => '', 'ControllerName' => '', 'MenuTitleStyle' => '');
     }
     return $tmp;
 }
开发者ID:anunay,项目名称:stentors,代码行数:21,代码来源:MenuObject.php

示例5: foreach

            }
            ?>
							          	</a>
							        </h4>
						      	</div>
						      	<div id="collapseListGroup<?php 
            echo $i;
            ?>
" class="panel-collapse collapse" role="tabpanel" aria-labelledby="collapseListGroupHeading<?php 
            echo $i;
            ?>
" aria-expanded="true">
							        <table class="table table-bordered">
							        	<?php 
            foreach ($orders as $order) {
                $menuItem = MenuItem::select(array('id' => $order->menu_item_id));
                ?>
							        	<tr>
							        		<td><?php 
                echo $menuItem->name;
                ?>
</td>
							        		<td class="text-right"><?php 
                echo $order->quantity;
                ?>
</td>
							        		<td class="text-right"><?php 
                echo $menuItem->cost;
                ?>
</td>
							        		<td class="text-right"><?php 
开发者ID:vivek201,项目名称:canteen-mgmt,代码行数:31,代码来源:orders.view.php

示例6: MenuItemCategory

                $menuCat = new MenuItemCategory();
                $menuCat->id = $menuItem->category_id;
                $menuCat->delete();
            }
        } else {
            redirect_to("menu.view.php?error=1");
        }
    }
}
if (!isset($_GET['id'])) {
    redirect_to('menu.view.php');
}
if (isset($_GET['error']) && $_GET['error'] == 'delete') {
    $alertArray = array('error' => 'The menu item could not be deleted!');
}
$menuItem = MenuItem::select(array('id' => $_GET['id']));
// DISPLAY THE USER DETAILS AND THEN ASK FOR CONFIRMATION
if (is_object($menuItem)) {
    $header = "menu";
    $page = "delete";
    require 'templates/navbar.php';
    require 'templates/sidebar.php';
    ?>
		<div class="row" style="margin-right: 0">
			<div class="col-md-8 col-md-offset-3 page-wrapper">
				<h2>Delete Menu Item</h2>
				<hr>
				<form class="form-horizontal" action="menu.delete.php" method="post">
					<input type="hidden" name="menu_item_id" value="<?php 
    echo $menuItem->id;
    ?>
开发者ID:vivek201,项目名称:canteen-mgmt,代码行数:31,代码来源:menu.delete.php

示例7: MenuCategory

 * Copyright 2014
 *
 * Author: Bluethrust Web Development
 * E-mail: support@bluethrust.com
 * Website: http://www.bluethrust.com
 *
 * License: http://www.bluethrust.com/license.php
 *
 */
if (!isset($member) || substr($_SERVER['PHP_SELF'], -11) != "console.php") {
    exit;
} else {
    $memberInfo = $member->get_info();
    $consoleObj->select($_GET['cID']);
    if (!$member->hasAccess($consoleObj)) {
        exit;
    }
}
$cID = $_GET['cID'];
include_once $prevFolder . "classes/btupload.php";
$menuCatObj = new MenuCategory($mysqli);
$menuItemObj = new MenuItem($mysqli);
$intAddNewMenuItemID = $consoleObj->findConsoleIDByName("Add Menu Item");
if (isset($_GET['menuID']) && $menuItemObj->select($_GET['menuID']) && $_GET['action'] == "edit") {
    $menuItemInfo = $menuItemObj->get_info();
    include "include/admin/managemenu/edit_item.php";
} else {
    echo "\n\t\t<table class='formTable'>\n\t\t\t<tr>\n\t\t\t\t<td class='main' colspan='2' align='right'>\n\t\t\t\t\t&raquo; <a href='" . $MAIN_ROOT . "members/console.php?cID=" . $intAddNewMenuItemID . "'>Add New Menu Item</a> &laquo;<br><br>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class='formTitle' style='width: 76%'>Menu Item:</td>\n\t\t\t\t<td class='formTitle' style='width: 24%'>Actions:</td>\n\t\t\t</tr>\n\t\t</table>\n\t\n\t\t\n\t\t<div id='menuItemDiv'>\n\t";
    include "include/admin/managemenu/include/menuitemlist.php";
    echo "\n\t\t</div>\n\t\t<div id='deleteMessage'></div>\n\t\t<script type='text/javascript'>\n\t\t\n\t\t\tfunction moveItem(strDir, intItemID) {\n\t\t\t\n\t\t\t\t\$(document).ready(function() {\n\t\t\t\t\t\$('#loadingSpiral').show();\n\t\t\t\t\t\$('#menuItemDiv').fadeOut(250);\n\t\t\t\t\t\n\t\t\t\t\t\$.post('" . $MAIN_ROOT . "members/include/admin/managemenu/move_item.php', { itemID: intItemID, iDir: strDir}, function(data) {\n\t\t\t\t\t\n\t\t\t\t\t\t\$('#menuItemDiv').html(data);\n\t\t\t\t\t\t\$('#loadingSpiral').hide();\n\t\t\t\t\t\t\$('#menuItemDiv').fadeIn(250);\n\t\t\t\t\t\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t});\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tfunction deleteItem(intItemID) {\n\t\t\t\t\$(document).ready(function() {\n\t\t\t\t\t\$.post('" . $MAIN_ROOT . "members/include/admin/managemenu/delete_item.php', { itemID: intItemID }, function(data) {\n\t\t\t\t\t\n\t\t\t\t\t\t\$('#deleteMessage').html(data);\n\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t});\n\t\t\t}\n\t\t\t\n\t\t\n\t\t</script>\n\t\t\n\t";
}
开发者ID:nsystem1,项目名称:clanscripts,代码行数:31,代码来源:managemenuitem.php

示例8: MenuItem

    $menu_item = new MenuItem();
    $menu_item->instantiate($_POST);
    if (isset($_POST['halfs'])) {
        $menu_item->halfs = true;
    } else {
        $menu_item->halfs = false;
    }
    if ($menu_item->update()) {
        redirect_to('menu.view.php?success=edit');
    } else {
        redirect_to('menu.view.php?error=edit');
    }
}
if (isset($_GET['id'])) {
    $id = intval($_GET['id']);
    $menu_item = MenuItem::select(array('id' => $id));
    if (!is_object($menu_item)) {
        redirect_to('menu.view.php');
    }
    ?>
<div class="row" style="margin-right: 0">
	<div class="col-md-6 col-md-offset-3 page-wrapper">
		<h2>Add New Menu Item</h2>
		<hr>
		<form action="menu.edit.php" method="post" autocomplete="off">
			<input type="hidden" name="id" value="<?php 
    echo $id;
    ?>
" />
			<?php 
    bootstrap_alert($alert);
开发者ID:vivek201,项目名称:canteen-mgmt,代码行数:31,代码来源:menu.edit.php

示例9: ConsoleOption

    $consoleObj = new ConsoleOption($mysqli);
    $menuCatObj = new MenuCategory($mysqli);
    $menuItemObj = new MenuItem($mysqli);
}
if (!isset($intAddNewMenuItemID)) {
    $intAddNewMenuItemID = $consoleObj->findConsoleIDByName("Add Menu Item");
}
if ($member->authorizeLogin($_SESSION['btPassword'])) {
    if (isset($_POST['menuCatID']) && $menuCatObj->select($_POST['menuCatID'])) {
        $orderoptions = "";
        $menuCatInfo = $menuCatObj->get_info_filtered();
        $selectItemID = "";
        if (!isset($_POST['itemID'])) {
            $_POST['itemID'] = "";
        } else {
            $menuItemObj->select($_POST['itemID']);
            $selectItemID = $menuItemObj->findBeforeAfter();
            $selectItemID = $selectItemID[0];
        }
        $lastItem = "";
        $result = $mysqli->query("SELECT * FROM " . $dbprefix . "menu_item WHERE menucategory_id = '" . $menuCatInfo['menucategory_id'] . "' ORDER BY sortnum");
        while ($row = $result->fetch_assoc()) {
            if ($_POST['itemID'] != $row['menuitem_id']) {
                $dispSelected = "";
                if ($selectItemID == $row['menuitem_id']) {
                    $dispSelected = " selected";
                }
                echo $selectItemID;
                $orderoptions .= "<option value='" . $row['menuitem_id'] . "'" . $dispSelected . ">" . filterText($row['name']) . "</option>";
            }
            $lastItem = $row['menuitem_id'];
开发者ID:nsystem1,项目名称:clanscripts,代码行数:31,代码来源:menuitemlist.php

示例10: ConsoleOption

include_once "../../../../classes/member.php";
include_once "../../../../classes/rank.php";
include_once "../../../../classes/consoleoption.php";
include_once "../../../../classes/menucategory.php";
include_once "../../../../classes/menuitem.php";
$consoleObj = new ConsoleOption($mysqli);
$member = new Member($mysqli);
$member->select($_SESSION['btUsername']);
$menuCatObj = new MenuCategory($mysqli);
$menuItemObj = new MenuItem($mysqli);
$cID = $consoleObj->findConsoleIDByName("Manage Menu Items");
$consoleObj->select($cID);
$_GET['cID'] = $cID;
if ($member->authorizeLogin($_SESSION['btPassword'])) {
    $memberInfo = $member->get_info_filtered();
    if ($member->hasAccess($consoleObj) && $menuItemObj->select($_POST['itemID'])) {
        $menuItemInfo = $menuItemObj->get_info_filtered();
        if ($_POST['confirm'] == "1") {
            $menuCatObj->select($menuItemInfo['menucategory_id']);
            $refreshSection = $menuCatObj->get_info("section");
            $menuItemObj->delete();
            $menuItemObj->resortOrder();
            include "include/menuitemlist.php";
            /*
            echo "
            
            	<script type='text/javascript'>
            
            		$(document).ready(function() {
            		
            			$.post('".$MAIN_ROOT."themes/_refreshmenus.php', { refreshSectionID: '".$refreshSection."' }, function(data) {
开发者ID:nsystem1,项目名称:clanscripts,代码行数:31,代码来源:delete_item.php


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