52 : void
53 {
54 if ($this->
user->isAnonymous() || 0 === $this->user->getId()) {
55 return;
56 }
57
58 $notificationSettings =
new ilSetting(
'notifications');
59
60 if ($notificationSettings->get('enable_osd', '0') === '1') {
61 $osdTemplate =
new ilTemplate(
'tpl.osd_notifications.js',
true,
true,
'Services/Notifications');
62
63 $osdTemplate->setVariable(
64 'OSD_INTERVAL',
65 $notificationSettings->get('osd_interval', (string) self::DEFAULT_POLLING_INTERVAL)
66 );
67 $osdTemplate->setVariable(
68 'OSD_PLAY_SOUND',
69 $notificationSettings->get('osd_play_sound') && $this->user->getPref('osd_play_sound') ? 'true' : 'false'
70 );
71
74
75 $this->page->addJavaScript('Services/Notifications/templates/default/notifications.js');
76 $this->page->addCSS('Services/Notifications/templates/default/osd.css');
77 $this->page->addOnLoadCode($osdTemplate->get());
78 }
79 }
static initMediaElementJs(ilGlobalTemplateInterface $a_tpl=null)
Init mediaelement.js scripts.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
special template class to simplify handling of ITX/PEAR
static initjQuery(ilGlobalTemplateInterface $a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template