From 0a79b2300c531ac632f7005c674f278f0936eb71 Mon Sep 17 00:00:00 2001 From: Fabrixxm Date: Fri, 15 Feb 2013 06:34:32 -0500 Subject: [PATCH] delete item page respond with json if called via ajax. --- mod/item.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mod/item.php b/mod/item.php index a037681dcb..612ac3a3c8 100644 --- a/mod/item.php +++ b/mod/item.php @@ -929,8 +929,13 @@ function item_content(&$a) { $o = ''; if(($a->argc == 3) && ($a->argv[1] === 'drop') && intval($a->argv[2])) { - require_once('include/items.php'); - $o = drop_item($a->argv[2]); + require_once('include/items.php'); + $o = drop_item($a->argv[2], !is_ajax()); + if (is_ajax()){ + // ajax return: [, 0 (no perm) | ] + echo json_encode(array(intval($a->argv[2]), intval($o))); + kllme(); + } } return $o; } -- 2.39.5