2020-05-15 18:47:41 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
require('include/glob.php');
|
|
|
|
require('include/muoribene.php');
|
|
|
|
require('include/sessionstart.php');
|
|
|
|
require('include/myconn.php');
|
|
|
|
require('include/getadmacc.php');
|
|
|
|
if ($account['Level'] == 'guest')
|
|
|
|
muoribene('Sorry, you are not authorized.', true);
|
|
|
|
require('include/menu.php');
|
|
|
|
$menu['menu']['selected'] = true;
|
|
|
|
$menu['menu']['submenu']['notifs']['selected'] = true;
|
|
|
|
buildmenu($menu);
|
|
|
|
|
|
|
|
$dbg = '';
|
|
|
|
|
|
|
|
// praticamente una macro
|
|
|
|
function hspech($str)
|
|
|
|
{
|
|
|
|
return (htmlspecialchars($str, ENT_QUOTES | ENT_HTML5, 'UTF-8'));
|
|
|
|
}
|
|
|
|
|
|
|
|
$dbg .= $dlang . '<br>' . N;
|
|
|
|
$dbg .= '<pre>' . print_r($_GET, 1) . '</pre>';
|
|
|
|
|
|
|
|
$dbg .= '<pre>' . print_r($inst, 1) . '</pre>' . N;
|
|
|
|
|
|
|
|
if ($account['Level'] != 'guest') {
|
|
|
|
require('include/notifs.php');
|
|
|
|
$notifs = notifs($link);
|
|
|
|
} else {
|
|
|
|
muoribene("Non hai i permessi per vedere questa pagina", true);
|
|
|
|
}
|
|
|
|
|
2020-05-16 02:04:41 +02:00
|
|
|
$filtordon = false;
|
|
|
|
if ($filtordon) {
|
|
|
|
$filtordimgoff = 'imgs/cerca_act_off.svg';
|
|
|
|
$filtordimgon = 'imgs/cerca_act_on.svg';
|
|
|
|
} else {
|
|
|
|
$filtordimgoff = 'imgs/cerca_off.svg';
|
|
|
|
$filtordimgon = 'imgs/cerca_on.svg';
|
|
|
|
}
|
2020-05-15 18:47:41 +02:00
|
|
|
?>
|
|
|
|
|
|
|
|
<!DOCTYPE HTML>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<title>Mustard - Notifs</title>
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
|
|
<meta name="description" content="Admin pages for Mastodon Startpage">
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
|
|
|
<link rel="icon" type="image/png" href="imgs/icona-32.png" sizes="32x32">
|
|
|
|
<link rel="icon" type="image/png" href="imgs/icona-192.png" sizes="192x192">
|
|
|
|
<link rel="icon" type="image/png" href="imgs/icona-512.png" sizes="512x512">
|
|
|
|
<link rel="apple-touch-icon-precomposed" href="imgs/icona-180.png">
|
|
|
|
<script language="JavaScript" src="js/menu.js?v=<?php echo($cjrand); ?>"></script>
|
|
|
|
<script language="JavaScript" src="js/confirma.js?v=<?php echo($cjrand); ?>"></script>
|
|
|
|
<script language="JavaScript" src="js/alerta.js?v=<?php echo($cjrand); ?>"></script>
|
|
|
|
<link rel="stylesheet" type="text/css" href="theme.css?v=<?php echo($cjrand); ?>">
|
|
|
|
<script language="JavaScript">
|
|
|
|
<!--
|
|
|
|
<?php if ($account['Level'] != 'guest') require('js/notifs.js.php'); ?>
|
2020-05-16 02:04:41 +02:00
|
|
|
function toggleState(check) {
|
|
|
|
let checkboxes = document.querySelectorAll("div#notifs-list > div > input.seen-checkbox");
|
|
|
|
checkboxes.forEach(function (box) {
|
|
|
|
box.checked = check.checked;
|
|
|
|
})
|
|
|
|
}
|
|
|
|
// -->
|
2020-05-15 18:47:41 +02:00
|
|
|
</script>
|
2020-05-16 10:47:47 +02:00
|
|
|
|
|
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/fork-awesome@1.1.7/css/fork-awesome.min.css" integrity="sha256-gsmEoJAws/Kd3CjuOQzLie5Q3yshhvmo7YNtBG7aaEY=" crossorigin="anonymous">
|
2020-05-15 18:47:41 +02:00
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<nav>
|
|
|
|
<div id="hmenu">
|
|
|
|
<ul>
|
|
|
|
<?php echo($menuout); ?>
|
|
|
|
</ul>
|
|
|
|
<div class="mtit">Notifiche</div>
|
|
|
|
<div id="rightdiv">
|
|
|
|
<?php if ($account['Level'] != 'guest') echo('<img src="' . $notifs['imgoff'] . '" id="bell" class="rlinks" title="Show notifications" onclick="shidenotifs();">' . N); ?>
|
|
|
|
<img src="imgs/esci.svg" class="rlinks" title="Logout" onclick="document.location.href='logout.php';">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</nav>
|
|
|
|
|
2020-05-15 20:09:31 +02:00
|
|
|
<?php echo($notifs['div']); ?>
|
|
|
|
|
2020-05-15 18:47:41 +02:00
|
|
|
<div id="fullscreen">
|
|
|
|
<div id="middlerow">
|
2020-05-16 02:04:41 +02:00
|
|
|
<div id="notifs-list-controls">
|
|
|
|
<input id="global-selector" type="checkbox" onclick="toggleState(this)">
|
2020-05-16 10:47:47 +02:00
|
|
|
<button onclick="applyAllSelected(markread)"><i class="fa fa-envelope-open-o" aria-hidden="true"></i>Segna come letto</button>
|
|
|
|
<button onclick="applyAllSelected(markdeleted)"><i class="fa fa-trash-o" aria-hidden="true"></i>Cancella</button>
|
2020-05-16 02:04:41 +02:00
|
|
|
</div>
|
2020-05-15 18:47:41 +02:00
|
|
|
<div id="notifs-list">
|
|
|
|
<?php
|
|
|
|
if ($account['Level'] != 'guest') {
|
2020-05-16 02:04:41 +02:00
|
|
|
// Questi valori sono un po' a naso,
|
|
|
|
// dovrebbero avere senso ma non ho
|
|
|
|
// indagato troppo
|
2020-05-15 18:47:41 +02:00
|
|
|
$sev_classes = array(
|
|
|
|
1 => "sev-normal",
|
|
|
|
2 => "sev-warning",
|
|
|
|
3 => "sev-error"
|
|
|
|
);
|
2020-05-15 20:09:31 +02:00
|
|
|
$seen_class = array(
|
|
|
|
0 => "unseen",
|
|
|
|
1 => "seen"
|
|
|
|
);
|
2020-05-15 18:47:41 +02:00
|
|
|
foreach ($notifs['notifs'] as $n) {
|
2020-05-15 20:09:31 +02:00
|
|
|
echo("<div id=\"notif-" . $n["ID"] .
|
|
|
|
"\" class=\"" . $sev_classes[$n["Severity"]] . " " . $seen_class[$n["Seen"]] . "\">" .
|
2020-05-16 02:04:41 +02:00
|
|
|
"<input type=\"checkbox\" class=\"seen-checkbox\">" .
|
2020-05-15 20:09:31 +02:00
|
|
|
$n["Notification"] .
|
|
|
|
"<button type='button' onclick='markread(this.parentElement)'>✕</button>" .
|
|
|
|
"</div>\n");
|
2020-05-15 18:47:41 +02:00
|
|
|
}
|
|
|
|
} ?>
|
|
|
|
</div>
|
2020-05-16 02:04:41 +02:00
|
|
|
|
2020-05-15 18:47:41 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
|
|
|
|
mysqli_close($link);
|
|
|
|
|
|
|
|
?>
|