ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilCalendarSubscriptionGUI Class Reference

Show calendar subscription info. More...

+ Collaboration diagram for ilCalendarSubscriptionGUI:

Public Member Functions

 __construct ($a_calendar_id, $a_ref_id=0)
 Constructor. More...
 
 executeCommand ()
 Execute command. More...
 

Protected Member Functions

 show ()
 Show subscription info. More...
 

Private Member Functions

 createToken ($user_id, $selection, $id)
 Create calendar token. More...
 

Private Attributes

 $cal_id = 0
 
 $calendar = null
 

Detailed Description

Show calendar subscription info.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e $Id$

Definition at line 12 of file class.ilCalendarSubscriptionGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilCalendarSubscriptionGUI::__construct (   $a_calendar_id,
  $a_ref_id = 0 
)

Constructor.

Parameters
int$a_clendar_id

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

References $DIC, and user().

22  {
23  global $DIC;
24 
25  $this->cal_id = $a_calendar_id;
26  $this->ref_id = $a_ref_id;
27  $this->user = $DIC->user();
28  $this->lng = $DIC->language();
29  $this->tpl = $DIC["tpl"];
30 
31  include_once './Services/Calendar/classes/class.ilCalendarCategory.php';
32  }
global $DIC
Definition: saml.php:7
user()
Definition: user.php:4
+ Here is the call graph for this function:

Member Function Documentation

◆ createToken()

ilCalendarSubscriptionGUI::createToken (   $user_id,
  $selection,
  $id 
)
private

Create calendar token.

Definition at line 86 of file class.ilCalendarSubscriptionGUI.php.

References $id, and ilCalendarAuthenticationToken\lookupAuthToken().

Referenced by show().

87  {
88  include_once './Services/Calendar/classes/class.ilCalendarAuthenticationToken.php';
89  $hash = ilCalendarAuthenticationToken::lookupAuthToken($user_id, $selection, $id);
90  if (strlen($hash)) {
91  return $hash;
92  }
93  $token = new ilCalendarAuthenticationToken($user_id);
94  $token->setSelectionType($selection);
95  $token->setCalendar($id);
96  return $token->add();
97  }
if(!array_key_exists('StateId', $_REQUEST)) $id
static lookupAuthToken($a_user_id, $a_selection, $a_calendar=0)
Handles calendar authentication tokens for external calendar subscriptions.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilCalendarSubscriptionGUI::executeCommand ( )

Execute command.

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

References $ilCtrl.

38  {
39  global $ilCtrl;
40 
41  $next_class = $ilCtrl->getNextClass($this);
42  switch ($next_class) {
43  default:
44  $cmd = $ilCtrl->getCmd("show");
45 
46  $this->$cmd();
47  break;
48  }
49  return true;
50  }
global $ilCtrl
Definition: ilias.php:18

◆ show()

ilCalendarSubscriptionGUI::show ( )
protected

Show subscription info.

Definition at line 55 of file class.ilCalendarSubscriptionGUI.php.

References $cal_id, $GLOBALS, $id, $info, $url, ilCalendarCategory\_getInstanceByObjId(), ilObject\_lookupObjId(), createToken(), ilCalendarAuthenticationToken\SELECTION_CALENDAR, ilCalendarAuthenticationToken\SELECTION_PD, ilUtil\sendInfo(), and user().

56  {
57  ilUtil::sendInfo($this->lng->txt('cal_subscription_info'));
58 
59  include_once './Services/InfoScreen/classes/class.ilInfoScreenGUI.php';
60  $info = new ilInfoScreenGUI($this);
61  $info->setFormAction($GLOBALS['ilCtrl']->getFormAction($this));
62 
63  if ($this->cal_id > 0) {
66  } elseif ($this->ref_id > 0) {
69  $id = $category->getCategoryID();
70  } else {
72  $id = 0;
73  }
74 
75  $hash = $this->createToken($this->user->getID(), $selection, $id);
76  $url = ILIAS_HTTP_PATH . '/calendar.php?client_id=' . CLIENT_ID . '&token=' . $hash;
77  $info->addSection($this->lng->txt("cal_subscription"));
78  $info->addProperty($this->lng->txt('cal_ical_url'), $url, $url);
79 
80  $this->tpl->setContent($info->getHTML());
81  }
Class ilInfoScreenGUI.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
if(!array_key_exists('StateId', $_REQUEST)) $id
user()
Definition: user.php:4
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static _lookupObjId($a_id)
static _getInstanceByObjId($a_obj_id)
get instance by obj_id
createToken($user_id, $selection, $id)
Create calendar token.
$url
$info
Definition: index.php:5
+ Here is the call graph for this function:

Field Documentation

◆ $cal_id

ilCalendarSubscriptionGUI::$cal_id = 0
private

Definition at line 14 of file class.ilCalendarSubscriptionGUI.php.

Referenced by show().

◆ $calendar

ilCalendarSubscriptionGUI::$calendar = null
private

Definition at line 15 of file class.ilCalendarSubscriptionGUI.php.


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