19 declare(strict_types=1);
44 $this->
user = $DIC->user();
49 if ($this->
user->isAnonymous() || 0 === $this->
user->getId()) {
53 $notificationSettings =
new ilSetting(
'notifications');
55 if ($notificationSettings->get(
'enable_osd',
'0') ===
'1') {
56 $osdTemplate =
new ilTemplate(
'tpl.osd_notifications.js',
true,
true,
'Services/Notifications');
58 $osdTemplate->setVariable(
60 $notificationSettings->get(
'osd_interval', (
string) self::DEFAULT_POLLING_INTERVAL)
62 $osdTemplate->setVariable(
64 $notificationSettings->get(
'osd_play_sound') && $this->
user->getPref(
'osd_play_sound') ?
'true' :
'false' 70 $this->page->addJavaScript(
'Services/Notifications/templates/default/notifications.js');
71 $this->page->addCSS(
'Services/Notifications/templates/default/osd.css');
72 $this->page->addOnLoadCode($osdTemplate->get());
__construct(protected ilGlobalTemplateInterface $page, protected ilLanguage $lng)
final const DEFAULT_POLLING_INTERVAL
static initjQuery(ilGlobalTemplateInterface $a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template
static initMediaElementJs(ilGlobalTemplateInterface $a_tpl=null)
Init mediaelement.js scripts.