mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-17 04:05:16 +02:00
The delete function is now changed to the new function
This commit is contained in:
parent
000e6457b4
commit
2d66242b4f
8 changed files with 42 additions and 212 deletions
|
@ -15,6 +15,7 @@ use Friendica\Database\DBM;
|
|||
use Friendica\Database\DBStructure;
|
||||
use Friendica\Model\Contact;
|
||||
use Friendica\Model\User;
|
||||
use Friendica\Model\Item;
|
||||
use Friendica\Module\Login;
|
||||
|
||||
require_once 'include/enotify.php';
|
||||
|
@ -492,7 +493,7 @@ function admin_page_deleteitem_post(App $a)
|
|||
// associated threads.
|
||||
$r = dba::select('item', ['id'], ['guid' => $guid]);
|
||||
while ($row = dba::fetch($r)) {
|
||||
drop_item($row['id'], false);
|
||||
Item::delete($row['id']);
|
||||
}
|
||||
dba::close($r);
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ use Friendica\Core\System;
|
|||
use Friendica\Core\Worker;
|
||||
use Friendica\Database\DBM;
|
||||
use Friendica\Model\Profile;
|
||||
use Friendica\Model\Item;
|
||||
|
||||
require_once 'include/bbcode.php';
|
||||
require_once 'include/datetime.php';
|
||||
|
@ -547,7 +548,7 @@ function events_content(App $a) {
|
|||
|
||||
// Delete only real events (no birthdays)
|
||||
if (DBM::is_result($ev) && $ev[0]['type'] == 'event') {
|
||||
$del = drop_item($ev[0]['itemid'], false);
|
||||
$del = Item::delete($ev[0]['itemid']);
|
||||
}
|
||||
|
||||
if ($del == 0) {
|
||||
|
|
|
@ -972,7 +972,11 @@ function item_content(App $a) {
|
|||
|
||||
$o = '';
|
||||
if (($a->argc == 3) && ($a->argv[1] === 'drop') && intval($a->argv[2])) {
|
||||
$o = drop_item($a->argv[2], !is_ajax());
|
||||
if (is_ajax()) {
|
||||
$o = Item::delete($a->argv[2]);
|
||||
} else {
|
||||
$o = drop_item($a->argv[2]);
|
||||
}
|
||||
if (is_ajax()) {
|
||||
// ajax return: [<item id>, 0 (no perm) | <owner id>]
|
||||
echo json_encode([intval($a->argv[2]), intval($o)]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue