ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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 $lng, $tpl;
36 
37  if($this->getSessionReminder()->isActive())
38  {
39  require_once 'Services/jQuery/classes/class.iljQueryUtil.php';
41 
42  require_once 'Services/YUI/classes/class.ilYuiUtil.php';
43  ilYuiUtil::initCookie();
44 
45  $tpl->addJavaScript('./Services/Authentication/js/session_reminder.js');
46 
47  $reminder_tpl = new ilTemplate('tpl.session_reminder.html', true, true, 'Services/Authentication');
48  $reminder_tpl->setVariable('DEBUG', defined('DEVMODE') && DEVMODE ? 1 : 0);
49  $reminder_tpl->setVariable('CLIENT_ID', CLIENT_ID);
50  $reminder_tpl->setVariable('SESSION_NAME', session_name());
51  $reminder_tpl->setVariable('FREQUENCY', 60);
52  $reminder_tpl->setVariable('SESSION_ID', session_id());
53  $reminder_tpl->setVariable(
54  'URL',
55  './sessioncheck.php?client_id=' . CLIENT_ID .
56  '&lang='.$lng->getLangKey()
57  );
58 
59  return $reminder_tpl->get();
60  }
61 
62  return '';
63  }
64 
70  {
71  $this->session_reminder = $session_reminder;
72  return $this;
73  }
74 
78  public function getSessionReminder()
79  {
81  }
82 }