e949/front/notifications.php
shr3dd3r 62b7b68976 Функция поиска по постам
Мне это всё расписывать что-ли? Смотрите в содержание коммита, мне феерически индифферентно
2024-03-07 19:58:39 +03:00

40 lines
776 B
PHP

<?php
// Notifications
// Notices queue
$NTFY_NoticesQueue = array();
// Add new notice with selected type
function NTFY_AddNotice (string $text, string $type = "fail") {
global $NTFY_NoticesQueue;
switch ($type) {
case "fail":
$NTFY_NoticesQueue[] = "<div class=\"notification_fail\"><p>$text</p></div>";
break;
case "warning":
$NTFY_NoticesQueue[] = "<div class=\"notification_warning\"><p>$text</p></div>";
break;
case "success":
$NTFY_NoticesQueue[] = "<div class=\"notification_success\"><p>$text</p></div>";
break;
default:
die("invalid notification type: $type");
}
}
// Echo all notifications
function NTFY_EchoAllNotices () {
global $NTFY_NoticesQueue;
foreach ($NTFY_NoticesQueue as $notice) {
echo "$notice\n";
}
}
?>