ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ILIAS\Notifications\ilNotificationOSDGUI Class Reference
+ Collaboration diagram for ILIAS\Notifications\ilNotificationOSDGUI:

Public Member Functions

 __construct (ilGlobalTemplateInterface $page, ilLanguage $language)
 
 populatePage ()
 

Data Fields

const DEFAULT_POLLING_INTERVAL = 60000
 

Protected Attributes

ilObjUser $user
 
ilGlobalTemplateInterface $page
 
ilLanguage $lng
 

Detailed Description

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

Definition at line 35 of file ilNotificationOSDGUI.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 43 of file ilNotificationOSDGUI.php.

References $DIC, ILIAS\Notifications\ilNotificationOSDGUI\$page, ILIAS\Repository\lng(), and ILIAS\Repository\user().

44  {
45  global $DIC;
46 
47  $this->user = $DIC->user();
48  $this->page = $page;
49  $this->lng = $language;
50  }
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 52 of file ilNotificationOSDGUI.php.

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

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 
72  iljQueryUtil::initjQuery($this->page);
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 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

◆ $lng

ilLanguage ILIAS\Notifications\ilNotificationOSDGUI::$lng
protected

Definition at line 41 of file ilNotificationOSDGUI.php.

◆ $page

ilGlobalTemplateInterface ILIAS\Notifications\ilNotificationOSDGUI::$page
protected

◆ $user

ilObjUser ILIAS\Notifications\ilNotificationOSDGUI::$user
protected

Definition at line 39 of file ilNotificationOSDGUI.php.

◆ DEFAULT_POLLING_INTERVAL

const ILIAS\Notifications\ilNotificationOSDGUI::DEFAULT_POLLING_INTERVAL = 60000

Definition at line 37 of file ilNotificationOSDGUI.php.


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