Files
ops-Gazelle/sections/tools/managers/global_notification.php
T
2023-02-03 11:13:48 +01:00

19 lines
496 B
PHP

<?php
if (!$Viewer->permitted('admin_global_notification')) {
error(403);
}
$global = new Gazelle\Notification\GlobalNotification;
if (isset($_POST['set'])) {
$global->create($_POST['title'], $_POST['url'], $_POST['level'], (int)$_POST['length']);
} elseif (isset($_POST['delete'])) {
$global->remove();
}
echo $Twig->render('admin/global-notification.twig', [
'alert' => $global->alert(),
'level' => $global->level(),
'remaining' => $global->remaining(),
]);