ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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 34 of file ilNotificationOSDGUI.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 40 of file ilNotificationOSDGUI.php.

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

41  {
42  global $DIC;
43 
44  $this->user = $DIC->user();
45  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ populatePage()

ILIAS\Notifications\ilNotificationOSDGUI::populatePage ( )

Definition at line 47 of file ilNotificationOSDGUI.php.

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

47  : void
48  {
49  if ($this->user->isAnonymous() || 0 === $this->user->getId()) {
50  return;
51  }
52 
53  $notificationSettings = new ilSetting('notifications');
54 
55  if ($notificationSettings->get('enable_osd', '0') === '1') {
56  $osdTemplate = new ilTemplate('tpl.osd_notifications.js', true, true, 'Services/Notifications');
57 
58  $osdTemplate->setVariable(
59  'OSD_INTERVAL',
60  $notificationSettings->get('osd_interval', (string) self::DEFAULT_POLLING_INTERVAL)
61  );
62  $osdTemplate->setVariable(
63  'OSD_PLAY_SOUND',
64  $notificationSettings->get('osd_play_sound') && $this->user->getPref('osd_play_sound') ? 'true' : 'false'
65  );
66 
67  iljQueryUtil::initjQuery($this->page);
69 
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());
73  }
74  }
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.
+ Here is the call graph for this function:

Field Documentation

◆ $user

ilObjUser ILIAS\Notifications\ilNotificationOSDGUI::$user
protected

Definition at line 38 of file ilNotificationOSDGUI.php.

◆ DEFAULT_POLLING_INTERVAL

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

Definition at line 36 of file ilNotificationOSDGUI.php.


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