38 public function __construct(
int $a_calendar_id,
int $a_ref_id = 0)
42 $this->cal_id = $a_calendar_id;
43 $this->ref_id = $a_ref_id;
44 $this->
user = $DIC->user();
45 $this->
ctrl = $DIC->ctrl();
46 $this->
lng = $DIC->language();
47 $this->tpl = $DIC->ui()->mainTemplate();
48 $this->ui_factory = $DIC->ui()->factory();
49 $this->ui_renderer = $DIC->ui()->renderer();
54 $next_class = $this->
ctrl->getNextClass($this);
55 switch ($next_class) {
57 $cmd = $this->
ctrl->getCmd(
"show");
66 protected function show(): void
68 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
'cal_subscription_info'));
71 $info->setFormAction(
$GLOBALS[
'DIC'][
'ilCtrl']->getFormAction($this));
73 if ($this->cal_id > 0) {
76 } elseif ($this->ref_id > 0) {
79 $id = $category->getCategoryID();
86 $url = ILIAS_HTTP_PATH .
'/calendar.php?client_id=' .
CLIENT_ID .
'&token=' . $hash;
87 $info->addSection($this->
lng->txt(
"cal_subscription"));
88 $info->addProperty($this->
lng->txt(
'cal_ical_url'),
$url,
$url);
90 $this->tpl->setContent($info->getHTML());
100 $token->setSelectionType($selection);
108 'tpl.subscription_dialog.html',
111 'components/ILIAS/Calendar' 114 $tpl->
setVariable(
'TXT_SUBSCRIPTION_INFO', $this->
lng->txt(
'cal_subscription_info'));
116 if ($this->cal_id > 0) {
119 } elseif ($this->ref_id > 0) {
122 $id = $category->getCategoryID();
128 $url = ILIAS_HTTP_PATH .
'/calendar.php?client_id=' .
CLIENT_ID .
'&token=' . $hash;
133 $tpl->
setVariable(
'LINK_LIMITED', $url .
'&limited=1');
134 $tpl->
setVariable(
'TXT_PERMA_LIMITED', $this->
lng->txt(
'cal_ical_url_google'));
136 $roundtrip = $this->ui_factory->modal()->roundtrip(
137 $this->
lng->txt(
'cal_calendar_subscription_modal_title'),
138 $this->ui_factory->legacy()->content($tpl->
get())
140 echo $this->ui_renderer->render($roundtrip);
getModalForSubscription()
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.
This is how the factory for UI elements looks.
createToken($user_id, $selection, $id)
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
__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
exit
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
show()
Show subscription info.