class NotificationsManagerView {
private static $Settings;
public static function load_js() {
$JSIncludes = array(
'noty/noty.js',
'noty/layouts/bottomRight.js',
'noty/themes/default.js',
'user_notifications.js');
foreach ($JSIncludes as $JSInclude) {
$Path = STATIC_SERVER."functions/$JSInclude";
?>
}
}
public static function render_settings($Settings) {
self::$Settings = $Settings;
?>
News announcements
|
self::render_checkbox(NotificationsManager::NEWS); ?>
|
Blog announcements
|
self::render_checkbox(NotificationsManager::BLOG); ?>
|
Inbox messages
|
self::render_checkbox(NotificationsManager::INBOX, true); ?>
|
Staff messages
|
self::render_checkbox(NotificationsManager::STAFFPM, false, false); ?>
|
Thread subscriptions
|
self::render_checkbox(NotificationsManager::SUBSCRIPTIONS, false, false); ?>
|
Quote notifications
|
self::render_checkbox(NotificationsManager::QUOTES); ?>
|
if (check_perms('site_torrents_notify')) { ?>
Torrent notifications
|
self::render_checkbox(NotificationsManager::TORRENTS, true, false); ?>
|
} ?>
Collage subscriptions
|
self::render_checkbox(NotificationsManager::COLLAGES. false, false); ?>
|
}
private static function render_checkbox($Name, $Traditional = false) {
$Checked = self::$Settings[$Name];
$PopupChecked = $Checked == NotificationsManager::OPT_POPUP || !isset($Checked) ? ' checked="checked"' : '';
$TraditionalChecked = $Checked == NotificationsManager::OPT_TRADITIONAL ? ' checked="checked"' : '';
?>
if ($Traditional) { ?>
}
}
public static function format_traditional($Contents) {
return "$Contents[message]";
}
}