ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilNotificationOSDGUI Class Reference

Class ilNotificationOSDGUI. More...

+ Collaboration diagram for ilNotificationOSDGUI:

Public Member Functions

 __construct (\ilObjUser $user, \ilTemplate $mainTemplate, \ilLanguage $lng)
 ilNotificationOSDGUI constructor. More...
 
 render ()
 

Protected Attributes

 $user
 
 $mainTemplate
 
 $lng
 

Detailed Description

Class ilNotificationOSDGUI.

Definition at line 6 of file class.ilNotificationOSDGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilNotificationOSDGUI::__construct ( \ilObjUser  $user,
\ilTemplate  $mainTemplate,
\ilLanguage  $lng 
)

ilNotificationOSDGUI constructor.

Parameters
\ilObjUser$user
\ilTemplate$mainTemplate
\ilLanguage$lng

Definition at line 29 of file class.ilNotificationOSDGUI.php.

References $lng, $mainTemplate, $user, and user().

30  {
31  $this->user = $user;
32  $this->mainTemplate = $mainTemplate;
33  $this->lng = $lng;
34  }
user()
Definition: user.php:4
+ Here is the call graph for this function:

Member Function Documentation

◆ render()

ilNotificationOSDGUI::render ( )

Definition at line 36 of file class.ilNotificationOSDGUI.php.

References ilGlyphGUI\CLOSE, ilGlyphGUI\get(), ilNotificationOSDHandler\getNotificationsForUser(), iljQueryUtil\initjQuery(), ilPlayerUtil\initMediaElementJs(), and user().

37  {
38  $notificationSettings = new \ilSetting('notifications');
39  $chatSettings = new \ilSetting('chatroom');
40 
41  $osdTemplate = new \ilTemplate('tpl.osd_notifications.js', true, true, 'Services/Notifications');
42 
43  require_once 'Services/Notifications/classes/class.ilNotificationOSDHandler.php';
44  require_once 'Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php';
45 
46  $notifications = \ilNotificationOSDHandler::getNotificationsForUser($this->user->getId());
47  $osdTemplate->setVariable('NOTIFICATION_CLOSE_HTML', json_encode(ilGlyphGUI::get(ilGlyphGUI::CLOSE, $this->lng->txt('close'))));
48  $osdTemplate->setVariable('INITIAL_NOTIFICATIONS', json_encode($notifications));
49  $osdTemplate->setVariable('OSD_POLLING_INTERVALL', $notificationSettings->get('osd_polling_intervall') ? $notificationSettings->get('osd_polling_intervall') : '60');
50  $osdTemplate->setVariable('OSD_PLAY_SOUND', $chatSettings->get('play_invitation_sound') && $this->user->getPref('chat_play_invitation_sound') ? 'true' : 'false');
51 
52  require_once "Services/jQuery/classes/class.iljQueryUtil.php";
54 
55  require_once 'Services/MediaObjects/classes/class.ilPlayerUtil.php';
57 
58  $this->mainTemplate->addJavaScript('Services/Notifications/templates/default/notifications.js');
59  $this->mainTemplate->addCSS('Services/Notifications/templates/default/osd.css');
60  $this->mainTemplate->addOnLoadCode($osdTemplate ->get());
61  }
static get($a_glyph, $a_text="")
Get glyph html.
user()
Definition: user.php:4
static initMediaElementJs($a_tpl=null)
Init mediaelement.js scripts.
static getNotificationsForUser($user_id, $append_osd_id_to_link=true, $max_age_seconds=0)
static initjQuery($a_tpl=null)
Init jQuery.
+ Here is the call graph for this function:

Field Documentation

◆ $lng

ilNotificationOSDGUI::$lng
protected

Definition at line 21 of file class.ilNotificationOSDGUI.php.

Referenced by __construct().

◆ $mainTemplate

ilNotificationOSDGUI::$mainTemplate
protected

Definition at line 16 of file class.ilNotificationOSDGUI.php.

Referenced by __construct().

◆ $user

ilNotificationOSDGUI::$user
protected

Definition at line 11 of file class.ilNotificationOSDGUI.php.

Referenced by __construct().


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