24 public function __construct(
int $a_calendar_id,
int $a_ref_id = 0)
28 $this->cal_id = $a_calendar_id;
29 $this->ref_id = $a_ref_id;
30 $this->
user = $DIC->user();
31 $this->
ctrl = $DIC->ctrl();
32 $this->
lng = $DIC->language();
33 $this->tpl = $DIC->ui()->mainTemplate();
34 $this->ui_factory = $DIC->ui()->factory();
35 $this->ui_renderer = $DIC->ui()->renderer();
40 $next_class = $this->
ctrl->getNextClass($this);
41 switch ($next_class) {
43 $cmd = $this->
ctrl->getCmd(
"show");
52 protected function show(): void
54 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
'cal_subscription_info'));
57 $info->setFormAction(
$GLOBALS[
'DIC'][
'ilCtrl']->getFormAction($this));
59 if ($this->cal_id > 0) {
62 } elseif ($this->ref_id > 0) {
65 $id = $category->getCategoryID();
72 $url = ILIAS_HTTP_PATH .
'/calendar.php?client_id=' .
CLIENT_ID .
'&token=' . $hash;
73 $info->addSection($this->
lng->txt(
"cal_subscription"));
74 $info->addProperty($this->
lng->txt(
'cal_ical_url'),
$url,
$url);
76 $this->tpl->setContent($info->getHTML());
86 $token->setSelectionType($selection);
94 'tpl.subscription_dialog.html',
100 $tpl->
setVariable(
'TXT_SUBSCRIPTION_INFO', $this->
lng->txt(
'cal_subscription_info'));
102 if ($this->cal_id > 0) {
105 } elseif ($this->ref_id > 0) {
108 $id = $category->getCategoryID();
114 $url = ILIAS_HTTP_PATH .
'/calendar.php?client_id=' .
CLIENT_ID .
'&token=' . $hash;
119 $tpl->
setVariable(
'LINK_LIMITED', $url .
'&limited=1');
120 $tpl->
setVariable(
'TXT_PERMA_LIMITED', $this->
lng->txt(
'cal_ical_url_google'));
122 $roundtrip = $this->ui_factory->modal()->roundtrip(
123 $this->
lng->txt(
'cal_calendar_subscription_modal_title'),
124 $this->ui_factory->legacy($tpl->
get())
126 echo $this->ui_renderer->render($roundtrip);
An entity that renders components to a string output.
getModalForSubscription()
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
static _getInstanceByObjId(int $a_obj_id)
get instance by obj_id
setVariable(string $variable, $value='')
Sets the given variable to the given value.
static lookupAuthToken(int $a_user_id, int $a_selection, int $a_calendar=0)
static _lookupObjId(int $ref_id)
Show calendar subscription info.
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
createToken($user_id, $selection, $id)
__construct(int $a_calendar_id, int $a_ref_id=0)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Handles calendar authentication tokens for external calendar subscriptions.
ilGlobalTemplateInterface $tpl
show()
Show subscription info.