Files
ops-Gazelle/sections/bookmarks/mass_edit.php
2025-05-23 14:41:16 +02:00

23 lines
528 B
PHP

<?php
/** @phpstan-var \Gazelle\User $Viewer */
declare(strict_types=1);
namespace Gazelle;
authorize();
if ($_POST['type'] === 'torrents') {
$editor = new Editor\UserBookmark($Viewer->id());
if (isset($_POST['update']) && !empty($_POST['sort'])) {
$editor->modify($_POST['sort']);
} elseif (isset($_POST['delete'])) {
$remove = array_keys($_POST['remove']);
if (!empty($remove)) {
$editor->remove($remove);
}
}
}
header('Location: bookmarks.php?type=torrents');