Refactor deprecated App::isAjax() to DI::mode()->isAjax()

This commit is contained in:
Philipp Holzer 2019-12-16 00:30:39 +01:00
commit 8b6e123b3f
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90
7 changed files with 12 additions and 17 deletions

View file

@ -878,7 +878,7 @@ function item_content(App $a)
$o = '';
if (($a->argc >= 3) && ($a->argv[1] === 'drop') && intval($a->argv[2])) {
if ($a->isAjax()) {
if (DI::mode()->isAjax()) {
$o = Item::deleteForUser(['id' => $a->argv[2]], local_user());
} else {
if (!empty($a->argv[3])) {
@ -889,7 +889,7 @@ function item_content(App $a)
}
}
if ($a->isAjax()) {
if (DI::mode()->isAjax()) {
// ajax return: [<item id>, 0 (no perm) | <owner id>]
echo json_encode([intval($a->argv[2]), intval($o)]);
exit();