34 lines
552 B
PHP
34 lines
552 B
PHP
|
<?php
|
||
|
// Notifications
|
||
|
|
||
|
|
||
|
|
||
|
// Notices stack
|
||
|
$NTFY_NoticesStack = array();
|
||
|
|
||
|
|
||
|
|
||
|
// Add new notice with selected type
|
||
|
function NTFY_AddNotice (string $text, string $type = "fail") {
|
||
|
global $NTFY_NoticesStack;
|
||
|
switch ($type) {
|
||
|
case "fail":
|
||
|
$NTFY_NoticesStack[] = "<div class=\"notification_fail\"><p>$text</p></div>";
|
||
|
break;
|
||
|
default:
|
||
|
die("invalid notification type: $type");
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// Echo all notifications
|
||
|
function NTFY_EchoAllNotices () {
|
||
|
global $NTFY_NoticesStack;
|
||
|
foreach ($NTFY_NoticesStack as $notice) {
|
||
|
echo "$notice\n";
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
?>
|