1
1
Fork 0

Redirect to previous page after NON-AJAX Post delete via second parameter in /item/drop

This commit is contained in:
Jonny Tischbein 2018-10-25 23:57:26 +02:00
commit b66bcb20da
4 changed files with 15 additions and 6 deletions

View file

@ -345,7 +345,7 @@ function drop_items(array $items)
}
}
function drop_item($id)
function drop_item($id, $return)
{
$a = BaseObject::getApp();
@ -409,8 +409,16 @@ function drop_item($id)
// delete the item
Item::deleteForUser(['id' => $item['id']], local_user());
$a->internalRedirect('network');
//NOTREACHED
$return_url = hex2bin($return);
notice("RETURN: " + $return_url);
if (empty($return_url) || strpos($return_url, 'display') ) {
$a->internalRedirect('network');
//NOTREACHED
}
else {
$a->internalRedirect($return_url);
//NOTREACHED
}
} else {
notice(L10n::t('Permission denied.') . EOL);
$a->internalRedirect('display/' . $item['guid']);