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


PHP MenuItem::delete方法代码示例

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


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

示例1: ajaxDeleteAction

 /**
  * Delete Menu Item
  */
 public function ajaxDeleteAction()
 {
     $menuId = (int) $this->_getParam('menuId');
     if ($menuId === 0) {
         $msg = __("Deleting root menu is not allowed!");
     } else {
         // TODO: execute deletion of menu id, temporarily placed it here
         //       since ORM DELETE is not fully implemented
         $objMenu = new MenuItem();
         $objMenu->menuId = $menuId;
         if ($objMenu->delete()) {
             $msg = __("Successfully deleted Menu Item: {$menuId}");
         } else {
             $msg = __("Failed to deleted Menu Item: {$menuId}");
         }
     }
     $data = array('msg' => $msg);
     $json = Zend_Controller_Action_HelperBroker::getStaticHelper('json');
     $json->suppressExit = true;
     $json->direct($data);
 }
开发者ID:dragonlet,项目名称:clearhealth,代码行数:24,代码来源:MenuManagerController.php

示例2: delete

 /**
  * Deletes self and passes the call to parent class
  * @see solidbase/lib/MenuItem#delete()
  */
 function delete()
 {
     global $DB;
     if ($this->mayI(DELETE)) {
         $DB->metadata->delete($this->ID);
         $DB->content->delete($this->ID, false);
         $DB->spine->delete($this->ID);
         return parent::delete();
     } else {
         return false;
     }
 }
开发者ID:jonatanolofsson,项目名称:solidba.se,代码行数:16,代码来源:Page.php

示例3: MenuItem

<?php

ini_set('display_errors', 'On');
error_reporting(E_ALL | E_STRICT);
require 'config.php';
require 'models/menu-item.class.php';
$menuItem = new MenuItem();
if (isset($_POST["delete_id"])) {
    $id = $_POST['delete_id'];
    $menuItem->delete($id);
} else {
    if (isset($_POST['id'])) {
        $name = $_POST['name'];
        $description = $_POST['description'];
        $price = $_POST['price'];
        $id = $_POST['id'];
        $menuItem->update($id, $name, $description, $price, 'lunch');
    } else {
        if (isset($_POST['add'])) {
            $name = $_POST['name'];
            $description = $_POST['description'];
            $price = $_POST['price'];
            $menuItem->create($name, $description, $price, 'lunch');
        }
    }
}
开发者ID:psrivongse,项目名称:echizen-php,代码行数:26,代码来源:update-menu-item.php

示例4: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy(MenuItem $menuItem)
 {
     /*$menuItem = MenuItem::findOrFail($id);*/
     $menuItem->delete();
     return Redirect::route('admin.menu.index')->withMessage("L'onglet a été supprimé");
 }
开发者ID:jeremy6680,项目名称:easy-peasy-cms,代码行数:12,代码来源:MenuItemController.php

示例5: ConsoleOption

$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) {
            				$('#menuSection_".$refreshSection."').html(data);		
            			});
            		
            		});
            	
开发者ID:nsystem1,项目名称:clanscripts,代码行数:30,代码来源:delete_item.php


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