ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Notifications\ilNotificationOSDGUI Class Reference
+ Collaboration diagram for ILIAS\Notifications\ilNotificationOSDGUI:

Public Member Functions

 __construct (protected ilGlobalTemplateInterface $page, protected ilLanguage $lng)
 
 populatePage ()
 

Data Fields

final const DEFAULT_POLLING_INTERVAL = 60000
 

Protected Attributes

ilObjUser $user
 

Detailed Description

Author
Michael Jansen mjans.nosp@m.en@d.nosp@m.ataba.nosp@m.y.de

Definition at line 33 of file ilNotificationOSDGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Notifications\ilNotificationOSDGUI::__construct ( protected ilGlobalTemplateInterface  $page,
protected ilLanguage  $lng 
)

Definition at line 39 of file ilNotificationOSDGUI.php.

40 {
41 global $DIC;
42
43 $this->user = $DIC->user();
44 }
global $DIC
Definition: shib_login.php:26

References $DIC, and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ populatePage()

ILIAS\Notifications\ilNotificationOSDGUI::populatePage ( )

Definition at line 46 of file ilNotificationOSDGUI.php.

46 : void
47 {
48 if ($this->user->isAnonymous() || 0 === $this->user->getId()) {
49 return;
50 }
51
52 $notificationSettings = new ilSetting('notifications');
53 if ($notificationSettings->get('enable_osd', '0') !== '1') {
54 return;
55 }
56
57 $osdTemplate = new ilTemplate('tpl.osd_notifications.js', true, true, 'components/ILIAS/Notifications');
58
59 $osdTemplate->setVariable(
60 'OSD_INTERVAL',
61 $notificationSettings->get('osd_interval', (string) self::DEFAULT_POLLING_INTERVAL)
62 );
63 $osdTemplate->setVariable(
64 'OSD_PLAY_SOUND',
65 $notificationSettings->get('osd_play_sound') && $this->user->getPref('osd_play_sound') ? 'true' : 'false'
66 );
67
68 iljQueryUtil::initjQuery($this->page);
69
70 $this->page->addJavaScript('assets/js/notifications.js');
71 $this->page->addCSS('assets/css/osd.css');
72 $this->page->addOnLoadCode($osdTemplate->get());
73 }
ILIAS Setting Class.
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

References iljQueryUtil\initjQuery(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Field Documentation

◆ $user

ilObjUser ILIAS\Notifications\ilNotificationOSDGUI::$user
protected

Definition at line 37 of file ilNotificationOSDGUI.php.

◆ DEFAULT_POLLING_INTERVAL

final const ILIAS\Notifications\ilNotificationOSDGUI::DEFAULT_POLLING_INTERVAL = 60000

Definition at line 35 of file ilNotificationOSDGUI.php.


The documentation for this class was generated from the following file: