ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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.

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());
100 $token->setCalendar($this->getCalendarId());
101 return $token->add();
102 }
Handles calendar authentication tokens for external calendar subscriptions.
static lookupAuthToken($a_user_id, $a_selection, $a_calendar=0)
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
Definition: CAS.php:276

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

Referenced by show().

+ 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.

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 }
global $ilCtrl
Definition: ilias.php:18
$cmd
Definition: sahs_server.php:35

References $cmd, and $ilCtrl.

◆ getCalendar()

ilCalendarSubscriptionGUI::getCalendar ( )

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

38 {
39 return $this->calendar ? $this->calendar : new ilCalendarCategory();
40 }

Referenced by show().

+ 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.

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.
$info
Definition: example_052.php:80
$url
Definition: shib_logout.php:72

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

+ 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: