1
0
Fork 0

Moved functions out of boot.php into class

- z_root() => $a->getBaseURL()
- absurl() => removed because no usage
- is_ajax() => $a->isAjax()
- current_load() => System::currentLoad()
- argc() => $a->argc
- argv($x) => $a->getArgumentValue($x)
This commit is contained in:
Philipp Holzer 2018-10-13 18:57:31 +02:00
commit 2c541afd47
No known key found for this signature in database
GPG key ID: 517BE60E2CE5C8A5
8 changed files with 66 additions and 90 deletions

View file

@ -876,13 +876,13 @@ function item_content(App $a)
$o = '';
if (($a->argc == 3) && ($a->argv[1] === 'drop') && intval($a->argv[2])) {
if (is_ajax()) {
if ($a->isAjax()) {
$o = Item::deleteForUser(['id' => $a->argv[2]], local_user());
} else {
$o = drop_item($a->argv[2]);
}
if (is_ajax()) {
if ($a->isAjax()) {
// ajax return: [<item id>, 0 (no perm) | <owner id>]
echo json_encode([intval($a->argv[2]), intval($o)]);
killme();