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";
?>
}
}
private static function render_push_settings() {
$PushService = self::$Settings['PushService'];
$PushOptions = unserialize(self::$Settings['PushOptions']);
?>
Push notifications |
|
}
public static function render_settings($Settings) {
self::$Settings = $Settings;
if (check_perms("users_mod") || G::$LoggedUser['ExtraClasses'][DELTA_TEAM]) {
self::render_push_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, $Push = true) {
$Checked = self::$Settings[$Name];
$PopupChecked = $Checked == NotificationsManager::OPT_POPUP || $Checked == NotificationsManager::OPT_POPUP_PUSH || !isset($Checked) ? ' checked="checked"' : '';
$TraditionalChecked = $Checked == NotificationsManager::OPT_TRADITIONAL || $Checked == NotificationsManager::OPT_TRADITIONAL_PUSH ? ' checked="checked"' : '';
$PushChecked = $Checked == NotificationsManager::OPT_TRADITIONAL_PUSH || $Checked == NotificationsManager::OPT_POPUP_PUSH || $Checked == NotificationsManager::OPT_PUSH ? ' checked="checked"' : '';
?>
if ($Traditional) { ?>
}
if ($Push && (check_perms("users_mod") || G::$LoggedUser['ExtraClasses'][DELTA_TEAM])) { ?>
}
}
public static function format_traditional($Contents) {
return "$Contents[message]";
}
}