ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilSessionReminderGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2012 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once 'Services/Authentication/classes/class.ilSessionReminder.php';
5 
12 {
16  protected $session_reminder;
17 
22  {
23  $this->setSessionReminder($session_reminder);
24  }
25 
29  public function getHtml()
30  {
35  global $DIC;
36 
37  $lng = $DIC['lng'];
38  $tpl = $DIC['tpl'];
39 
40  if ($this->getSessionReminder()->isActive()) {
41  require_once 'Services/jQuery/classes/class.iljQueryUtil.php';
43 
44  require_once 'Services/YUI/classes/class.ilYuiUtil.php';
45  ilYuiUtil::initCookie();
46 
47  $tpl->addJavaScript('./Services/Authentication/js/session_reminder.js');
48 
49  $reminder_tpl = new ilTemplate('tpl.session_reminder.html', true, true, 'Services/Authentication');
50  $reminder_tpl->setVariable('DEBUG', defined('DEVMODE') && DEVMODE ? 1 : 0);
51  $reminder_tpl->setVariable('CLIENT_ID', CLIENT_ID);
52  $reminder_tpl->setVariable('FREQUENCY', 60);
53  $reminder_tpl->setVariable('SESSION_ID_HASH', md5(session_id()));
54  $reminder_tpl->setVariable(
55  'URL',
56  './sessioncheck.php?client_id=' . CLIENT_ID .
57  '&lang=' . $lng->getLangKey()
58  );
59 
60  return $reminder_tpl->get();
61  }
62 
63  return '';
64  }
65 
71  {
72  $this->session_reminder = $session_reminder;
73  return $this;
74  }
75 
79  public function getSessionReminder()
80  {
82  }
83 }
global $DIC
Definition: saml.php:7
$tpl
Definition: ilias.php:10
$lng
special template class to simplify handling of ITX/PEAR
setSessionReminder($session_reminder)
__construct(ilSessionReminder $session_reminder)
static initjQuery($a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template