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',
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;
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);
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Handles calendar authentication tokens for external calendar subscriptions.
static lookupAuthToken(int $a_user_id, int $a_selection, int $a_calendar=0)
static _getInstanceByObjId(int $a_obj_id)
get instance by obj_id
Show calendar subscription info.
createToken($user_id, $selection, $id)
getModalForSubscription()
show()
Show subscription info.
__construct(int $a_calendar_id, int $a_ref_id=0)
ilGlobalTemplateInterface $tpl
static _lookupObjId(int $ref_id)
special template class to simplify handling of ITX/PEAR
This is how the factory for UI elements looks.
An entity that renders components to a string output.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setVariable(string $variable, $value='')
Sets the given variable to the given value.
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.