ILIAS  release_8 Revision v8.23
ilSessionReminderGUI Class Reference
+ Collaboration diagram for ilSessionReminderGUI:

Public Member Functions

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

Private Attributes

ilSessionReminder $sessionReminder
 
ilGlobalTemplateInterface $page
 
ilLanguage $lng
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilSessionReminderGUI::__construct ( ilSessionReminder  $sessionReminder,
ilGlobalTemplateInterface  $page,
ilLanguage  $language 
)

Definition at line 27 of file class.ilSessionReminderGUI.php.

References $page, $sessionReminder, and ILIAS\Repository\lng().

31  {
32  $this->sessionReminder = $sessionReminder;
33  $this->page = $page;
34  $this->lng = $language;
35  }
ilGlobalTemplateInterface $page
+ Here is the call graph for this function:

Member Function Documentation

◆ populatePage()

ilSessionReminderGUI::populatePage ( )

Definition at line 37 of file class.ilSessionReminderGUI.php.

References $clientId, $url, CLIENT_ID, iljQueryUtil\initjQuery(), and ILIAS\Repository\lng().

37  : void
38  {
39  if (!$this->sessionReminder->isActive()) {
40  return;
41  }
42 
43  iljQueryUtil::initjQuery($this->page);
44 
45  $this->page->addJavaScript('./Services/Authentication/js/session_reminder.js');
46 
47  $url = './sessioncheck.php?client_id=' . CLIENT_ID . '&lang=' . $this->lng->getLangKey();
48  $devMode = defined('DEVMODE') && DEVMODE ? 1 : 0;
49  $clientId = defined('CLIENT_ID') ? CLIENT_ID : '';
50  $sessionId = session_id();
51  $sessionHash = md5($sessionId);
52 
53  $javascript = <<<JS
54 (function($) {
55  $("body").ilSessionReminder({
56  url: "$url",
57  client_id: "$clientId",
58  hash: "$sessionHash",
59  frequency: 60,
60  debug: $devMode
61  });
62 })(jQuery);
63 JS;
64 
65  $this->page->addOnLoadCode($javascript);
66  }
$clientId
Definition: ltiregend.php:27
const CLIENT_ID
Definition: constants.php:41
static initjQuery(ilGlobalTemplateInterface $a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template
$url
+ Here is the call graph for this function:

Field Documentation

◆ $lng

ilLanguage ilSessionReminderGUI::$lng
private

Definition at line 25 of file class.ilSessionReminderGUI.php.

◆ $page

ilGlobalTemplateInterface ilSessionReminderGUI::$page
private

Definition at line 24 of file class.ilSessionReminderGUI.php.

Referenced by __construct().

◆ $sessionReminder

ilSessionReminder ilSessionReminderGUI::$sessionReminder
private

Definition at line 23 of file class.ilSessionReminderGUI.php.

Referenced by __construct().


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