本文整理汇总了PHP中item::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP item::delete方法的具体用法?PHP item::delete怎么用?PHP item::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类item
的用法示例。
在下文中一共展示了item::delete方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: timetodate
$r['editdate'] = timetodate($r['edittime'], 5);
$r['alt'] = $r['title'];
$r['title'] = set_style($r['title'], $r['style']);
if (strpos($r['linkurl'], '://') === false) {
$r['linkurl'] = $MODULE[$mid]['linkurl'] . $r['linkurl'];
}
$lists[] = $r;
}
$tname = $MODULE[$mid]['name'] . '列表';
}
include tpl('item_batch', $module);
}
break;
case 'delete':
$itemid or msg('请选择信息');
isset($recycle) ? $do->recycle($itemid) : $do->delete($itemid);
dmsg('删除成功', $forward);
break;
case 'level':
$itemid or msg('请选择信息');
$level = intval($level);
$do->level($itemid, $level);
dmsg('级别设置成功', $forward);
break;
case 'type':
$itemid or msg('请选择信息');
$typeid = intval($typeid);
$do->type($itemid, $typeid);
dmsg('分类设置成功', $forward);
break;
default:
示例2: urldecode
require 'path.php';
init_cobalt('Delete item');
if (isset($_GET['item_id'])) {
$item_id = urldecode($_GET['item_id']);
require_once 'form_data_item.php';
}
if (xsrf_guard()) {
init_var($_POST['btn_cancel']);
init_var($_POST['btn_delete']);
require 'components/query_string_standard.php';
if ($_POST['btn_cancel']) {
log_action('Pressed cancel button');
redirect("listview_item.php?{$query_string}");
} elseif ($_POST['btn_delete']) {
log_action('Pressed delete button');
require_once 'subclasses/item.php';
$dbh_item = new item();
$object_name = 'dbh_item';
require 'components/create_form_data.php';
$dbh_item->delete($arr_form_data);
redirect("listview_item.php?{$query_string}");
}
}
require 'subclasses/item_html.php';
$html = new item_html();
$html->draw_header('Delete Item', $message, $message_type);
$html->draw_listview_referrer_info($filter_field_used, $filter_used, $page_from, $filter_sort_asc, $filter_sort_desc);
$html->draw_hidden('item_id');
$html->detail_view = TRUE;
$html->draw_controls('delete');
$html->draw_footer();
示例3: run
function run()
{
global $layout;
global $DB;
global $website;
global $theme;
global $user;
$out = '';
$item = new item();
switch ($_REQUEST['act']) {
case 'json':
case 1:
// json data retrieval & operations
switch ($_REQUEST['oper']) {
case 'del':
// remove rows
$ids = $_REQUEST['ids'];
foreach ($ids as $id) {
$item->load($id);
$item->delete();
}
echo json_encode(true);
break;
default:
// list or search
// translation of request search & order fields
switch ($_REQUEST['searchField']) {
case 'id':
$_REQUEST['searchField'] = 'i.id';
break;
case 'title':
$_REQUEST['searchField'] = 'd.text';
break;
case 'language':
$_REQUEST['searchField'] = 'd.lang';
break;
case 'category':
$_REQUEST['searchField'] = 'i.category';
break;
case 'dates':
$_REQUEST['searchField'] = 'i.date_published';
break;
case 'permission':
$_REQUEST['searchField'] = 'i.permission';
break;
default:
}
if ($_REQUEST['sidx'] == 'dates') {
$_REQUEST['sidx'] = 'i.date_published';
}
$page = intval($_REQUEST['page']);
$max = intval($_REQUEST['rows']);
$offset = ($page - 1) * $max;
$orderby = $_REQUEST['sidx'] . ' ' . $_REQUEST['sord'];
$where = ' i.website = ' . $website->id;
if ($_REQUEST['_search'] == 'true' || isset($_REQUEST['quicksearch'])) {
if (isset($_REQUEST['quicksearch'])) {
$where .= $item->quicksearch($_REQUEST['quicksearch']);
} else {
if (isset($_REQUEST['filters'])) {
if (is_array($_REQUEST['filters'])) {
$filters = json_decode(json_encode($_REQUEST['filters']), FALSE);
} else {
$filters = json_decode($_REQUEST['filters']);
}
for ($r = 0; $r < count($filters->rules); $r++) {
switch ($filters->rules[$r]->field) {
case 'id':
$filters->rules[$r]->field = 'i.id';
break;
case 'title':
$filters->rules[$r]->field = 'd.text';
break;
case 'language':
$filters->rules[$r]->field = 'd.lang';
break;
case 'category':
$filters->rules[$r]->field = 'i.category';
break;
case 'dates':
$filters->rules[$r]->field = 'i.date_published';
break;
case 'permission':
$filters->rules[$r]->field = 'i.permission';
break;
default:
}
}
$where .= navitable::jqgridsearch(json_encode($filters));
} else {
// single search
$where .= ' AND ' . navitable::jqgridcompare($_REQUEST['searchField'], $_REQUEST['searchOper'], $_REQUEST['searchString']);
}
}
}
$sql = ' SELECT SQL_CALC_FOUND_ROWS
i.*, d.text as title, d.lang as language,
u.username as author_username,
( SELECT COUNT(*)
FROM nv_comments cm
//.........这里部分代码省略.........
示例4: item
}
if ($_POST["update_item"]) {
$item = new item();
$item->set_id($_POST["update_itemID"]);
$item->select();
$item->set_value("itemName", $_POST["update_itemName"]);
$item->set_value("itemNotes", $_POST["update_itemNotes"]);
$item->set_value("itemType", $_POST["update_itemType"]);
$item->save();
}
if ($_POST["remove_items"]) {
for ($i = 0; $i < count($_POST["itemID"]); $i++) {
$item = new item();
$item->set_id($_POST["itemID"][$i]);
$item->select();
$item->delete();
}
}
//so that the user can edit the item later
$TPL["personID"] = $current_user->get_id();
// item types
$itemType = new meta("itemType");
$TPL["itemTypes"] = page::select_options($itemType->get_assoc_array("itemTypeID", "itemTypeID"), $item->get_value("itemType"));
// setup item list (for removals)
$item_list = array();
$db = new db_alloc();
$db->query("SELECT * FROM item ORDER BY itemName");
while ($db->next_record()) {
$item = new item();
$item->read_db_record($db);
$item_list[$item->get_id()] = $item->get_value('itemName');