mirror of
https://github.com/friendica/friendica
synced 2025-04-26 23:10:11 +00:00
Use the item functions at many more places
This commit is contained in:
parent
68ab3764e9
commit
4714cb746b
13 changed files with 191 additions and 306 deletions
|
@ -335,17 +335,14 @@ function drop_item($id) {
|
|||
|
||||
// locate item to be deleted
|
||||
|
||||
$r = q("SELECT * FROM `item` WHERE `id` = %d LIMIT 1",
|
||||
intval($id)
|
||||
);
|
||||
$fields = ['id', 'uid', 'contact-id', 'deleted'];
|
||||
$item = Item::selectFirstForUser(local_user(), $fields, ['id' => $id]);
|
||||
|
||||
if (!DBM::is_result($r)) {
|
||||
if (!DBM::is_result($item)) {
|
||||
notice(L10n::t('Item not found.') . EOL);
|
||||
goaway(System::baseUrl() . '/' . $_SESSION['return_url']);
|
||||
}
|
||||
|
||||
$item = $r[0];
|
||||
|
||||
if ($item['deleted']) {
|
||||
return 0;
|
||||
}
|
||||
|
@ -364,7 +361,6 @@ function drop_item($id) {
|
|||
}
|
||||
|
||||
if ((local_user() == $item['uid']) || $contact_id) {
|
||||
|
||||
// Check if we should do HTML-based delete confirmation
|
||||
if ($_REQUEST['confirm']) {
|
||||
// <form> can't take arguments in its "action" parameter
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue