ILIAS  release_4-4 Revision
ilCalendarSubscriptionGUI Class Reference

Show calendar subscription info. More...

+ Collaboration diagram for ilCalendarSubscriptionGUI:

Public Member Functions

 __construct ($a_calendar_id)
 Constructor. More...
 
 getCalendarId ()
 Get current calendar id. More...
 
 getCalendar ()
 
 executeCommand ()
 Execute command. More...
 

Protected Member Functions

 show ()
 Show subscription info. More...
 

Private Member Functions

 createToken ()
 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)

Constructor.

Parameters
int$a_clendar_id

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

22  {
23  $this->cal_id = $a_calendar_id;
24  include_once './Services/Calendar/classes/class.ilCalendarCategory.php';
25  $this->calendar = new ilCalendarCategory($this->cal_id);
26  }
Stores calendar categories.

Member Function Documentation

◆ createToken()

ilCalendarSubscriptionGUI::createToken ( )
private

Create calendar token.

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

References $GLOBALS, getCalendarId(), ilCalendarAuthenticationToken\lookupAuthToken(), and ilCalendarAuthenticationToken\SELECTION_CALENDAR.

Referenced by show().

86  {
87  include_once './Services/Calendar/classes/class.ilCalendarAuthenticationToken.php';
89  $GLOBALS['ilUser']->getId(),
91  $this->getCalendarId()
92  );
93  if(strlen($hash))
94  {
95  return $hash;
96  }
97 
98  $token = new ilCalendarAuthenticationToken($GLOBALS['ilUser']->getId());
99  $token->setSelectionType(ilCalendarAuthenticationToken::SELECTION_CALENDAR);
100  $token->setCalendar($this->getCalendarId());
101  return $token->add();
102  }
getCalendarId()
Get current calendar id.
$GLOBALS['ct_recipient']
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 45 of file class.ilCalendarSubscriptionGUI.php.

References $cmd, and $ilCtrl.

46  {
47  global $ilCtrl;
48 
49  $next_class = $ilCtrl->getNextClass($this);
50  switch($next_class)
51  {
52  default:
53  $cmd = $ilCtrl->getCmd("show");
54 
55  $this->$cmd();
56  break;
57  }
58  return true;
59  }
$cmd
Definition: sahs_server.php:35
global $ilCtrl
Definition: ilias.php:18

◆ getCalendar()

ilCalendarSubscriptionGUI::getCalendar ( )

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

Referenced by show().

38  {
39  return $this->calendar ? $this->calendar : new ilCalendarCategory();
40  }
Stores calendar categories.
+ Here is the caller graph for this function:

◆ getCalendarId()

ilCalendarSubscriptionGUI::getCalendarId ( )

Get current calendar id.

Returns
<type>

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

References $cal_id.

Referenced by createToken().

+ Here is the caller graph for this function:

◆ show()

ilCalendarSubscriptionGUI::show ( )
protected

Show subscription info.

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

References $GLOBALS, createToken(), getCalendar(), and ilUtil\sendInfo().

65  {
66  $token = $this->createToken();
67 
68  ilUtil::sendInfo($GLOBALS['lng']->txt('cal_subscription_info'));
69 
70  include_once './Services/InfoScreen/classes/class.ilInfoScreenGUI.php';
71  $info = new ilInfoScreenGUI($this);
72  $info->setFormAction($GLOBALS['ilCtrl']->getFormAction($this));
73 
74  $hash = $this->createToken();
75  $url = ILIAS_HTTP_PATH.'/calendar.php?client_id='.CLIENT_ID.'&token='.$hash;
76  $info->addSection($this->getCalendar()->getTitle());
77  $info->addProperty($GLOBALS['lng']->txt('cal_ical_url'), $url, $url);
78 
79  $GLOBALS['tpl']->setContent($info->getHTML());
80  }
Class ilInfoScreenGUI.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$GLOBALS['ct_recipient']
+ 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 getCalendarId().

◆ $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: