3 declare(strict_types=1);
49 $this->tpl = $DIC->ui()->mainTemplate();
50 $this->
lng = $DIC->language();
51 $this->
lng->loadLanguageModule(
'dateplaner');
52 $this->
lng->loadLanguageModule(
'jscalendar');
54 $this->
ctrl = $DIC->ctrl();
55 $this->
user = $DIC->user();
62 $next_class = $this->
ctrl->getNextClass();
63 switch ($next_class) {
65 $cmd = $this->
ctrl->getCmd(
"show");
76 $this->tpl->setContent($form->getHTML());
81 $this->
ctrl->returnToParent($this);
87 if ($form->checkInput()) {
88 $this->user_settings->setTimeZone($form->getInput(
'timezone'));
89 $this->user_settings->setExportTimeZoneType((
int) $form->getInput(
'export_tz'));
90 $this->user_settings->setWeekStart((
int) $form->getInput(
'weekstart'));
91 $this->user_settings->setDateFormat((
int) $form->getInput(
'date_format'));
92 $this->user_settings->setTimeFormat((
int) $form->getInput(
'time_format'));
93 $this->user_settings->setDayStart((
int) $form->getInput(
'dst'));
94 $this->user_settings->setDayEnd((
int) $form->getInput(
'den'));
95 $this->user_settings->setShowWeeks((
bool) $form->getInput(
'show_weeks'));
96 $this->user_settings->save();
97 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'),
true);
98 $this->
ctrl->redirect($this,
"show");
100 $form->setValuesByPost();
101 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'err_check_input'),
true);
109 $form->setFormAction($this->
ctrl->getFormAction($this,
'save'));
110 $form->setTitle($this->
lng->txt(
'cal_user_settings'));
111 $form->addCommandButton(
'save', $this->
lng->txt(
'save'));
116 $select->setInfo($this->
lng->txt(
'cal_timezone_info'));
117 $select->setValue($this->user_settings->getTimeZone());
118 $form->addItem($select);
121 $export_type->
setValue((
string) $this->user_settings->getExportTimeZoneType());
124 $this->
lng->txt(
'cal_export_timezone_tz'),
127 $export_type->addOption($export_tz);
129 $this->
lng->txt(
'cal_export_timezone_utc'),
132 $export_type->addOption($export_utc);
133 $form->addItem($export_type);
137 $select->setOptions(array(
142 $select->setInfo($this->
lng->txt(
'cal_date_format_info'));
143 $select->setValue($this->user_settings->getDateFormat());
144 $form->addItem($select);
147 $select->setOptions(array(
151 $select->setInfo($this->
lng->txt(
'cal_time_format_info'));
152 $select->setValue($this->user_settings->getTimeFormat());
153 $form->addItem($select);
157 $week_month->setTitle($this->
lng->txt(
'cal_week_month_view'));
158 $form->addItem($week_month);
161 $radio->
setValue((
string) $this->user_settings->getWeekStart());
164 $radio->addOption($option);
166 $radio->addOption($option);
167 $form->addItem($radio);
169 if ($this->
settings->getShowWeeks()) {
172 $cb->
setInfo($this->
lng->txt(
"cal_usr_show_weeks_info"));
174 $cb->setChecked($this->user_settings->getShowWeeks());
180 $week_month->setTitle($this->
lng->txt(
'cal_day_week_view'));
181 $form->addItem($week_month);
184 $day_start->setOptions(
187 $day_start->setValue($this->user_settings->getDayStart());
188 $form->addItem($day_start);
191 $day_end->setOptions(
194 $day_end->setValue($this->user_settings->getDayEnd());
195 $form->addItem($day_end);
ilCalendarSettings $settings
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilGlobalTemplateInterface $tpl
static _getShortTimeZoneList()
get short timezone list
static getHourSelection(int $a_format)
Get hour selection depending on user specific hour format.
static _getInstanceByUserId(int $a_user_id)
show(?ilPropertyFormGUI $form=null)
ilCalendarUserSettings $user_settings
__construct()
Constructor public.