]> git.mxchange.org Git - friendica.git/commitdiff
delete item page respond with json if called via ajax.
authorFabrixxm <fabrix.xm@gmail.com>
Fri, 15 Feb 2013 11:34:32 +0000 (06:34 -0500)
committerFabrixxm <fabrix.xm@gmail.com>
Fri, 15 Feb 2013 11:34:32 +0000 (06:34 -0500)
mod/item.php

index a037681dcb4469854b02697a181dbcd5fa4ee383..612ac3a3c8beb91505e0aa7eb4f7ad3650549f27 100644 (file)
@@ -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: [<item id>, 0 (no perm) | <owner id>] 
+                       echo json_encode(array(intval($a->argv[2]), intval($o)));
+                       kllme();
+               }
        }
        return $o;
 }