Продолжение запила API
Создание постов, новые настройки в конфиге
This commit is contained in:
@ -3,20 +3,20 @@
|
||||
|
||||
|
||||
|
||||
// Notices stack
|
||||
$NTFY_NoticesStack = array();
|
||||
// Notices queue
|
||||
$NTFY_NoticesQueue = array();
|
||||
|
||||
|
||||
|
||||
// Add new notice with selected type
|
||||
function NTFY_AddNotice (string $text, string $type = "fail") {
|
||||
global $NTFY_NoticesStack;
|
||||
global $NTFY_NoticesQueue;
|
||||
switch ($type) {
|
||||
case "fail":
|
||||
$NTFY_NoticesStack[] = "<div class=\"notification_fail\"><p>$text</p></div>";
|
||||
$NTFY_NoticesQueue[] = "<div class=\"notification_fail\"><p>$text</p></div>";
|
||||
break;
|
||||
case "success":
|
||||
$NTFY_NoticesStack[] = "<div class=\"notification_success\"><p>$text</p></div>";
|
||||
$NTFY_NoticesQueue[] = "<div class=\"notification_success\"><p>$text</p></div>";
|
||||
break;
|
||||
default:
|
||||
die("invalid notification type: $type");
|
||||
@ -25,8 +25,8 @@ function NTFY_AddNotice (string $text, string $type = "fail") {
|
||||
|
||||
// Echo all notifications
|
||||
function NTFY_EchoAllNotices () {
|
||||
global $NTFY_NoticesStack;
|
||||
foreach ($NTFY_NoticesStack as $notice) {
|
||||
global $NTFY_NoticesQueue;
|
||||
foreach ($NTFY_NoticesQueue as $notice) {
|
||||
echo "$notice\n";
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user