mirror of
https://github.com/OPSnet/Gazelle.git
synced 2026-10-10 01:13:02 -04:00
19 lines
496 B
PHP
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(),
|
|
]);
|