本文整理汇总了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();
}
}
示例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'] . "'> " . $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'] . "'> " . $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'] . "'> " . $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'] . "'> " . $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 {
//.........这里部分代码省略.........
示例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;
示例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;
}
示例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
示例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;
?>
示例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» <a href='" . $MAIN_ROOT . "members/console.php?cID=" . $intAddNewMenuItemID . "'>Add New Menu Item</a> «<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";
}
示例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);
示例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'];
示例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) {