3 declare(strict_types=1);
    34     public function __construct($a_data, $a_id, $a_call_by_reference = 
true, $a_prepare_output = 
true)
    42         $this->
lng->loadLanguageModule(
'dateplaner');
    43         $this->
lng->loadLanguageModule(
'jscalendar');
    48         $next_class = $this->
ctrl->getNextClass($this);
    49         $cmd = $this->
ctrl->getCmd();
    53         if (!$this->rbac_system->checkAccess(
"visible,read", $this->object->getRefId())) {
    54             $this->error->raiseError($this->
lng->txt(
'no_permission'), $this->error->WARNING);
    57         switch ($next_class) {
    58             case 'ilpermissiongui':
    59                 $this->tabs_gui->setTabActive(
'perm_settings');
    61                 $ret = $this->
ctrl->forwardCommand($perm_gui);
    65                 $this->tabs_gui->setTabActive(
'settings');
    67                 if (!$cmd || $cmd == 
'view') {
    77         if ($this->
access->checkAccess(
"read", 
'', $this->object->getRefId())) {
    78             $this->tabs_gui->addTarget(
    80                 $this->
ctrl->getLinkTarget($this, 
"settings"),
    81                 array(
"settings", 
"view")
    85         if ($this->
access->checkAccess(
'edit_permission', 
'', $this->object->getRefId())) {
    86             $this->tabs_gui->addTarget(
    88                 $this->
ctrl->getLinkTargetByClass(
'ilpermissiongui', 
"perm"),
    97         if (!$this->rbac_system->checkAccess(
"visible,read", $this->object->getRefId())) {
    98             $this->error->raiseError($this->
lng->txt(
'no_permission'), $this->error->WARNING);
   100         $this->tabs_gui->setTabActive(
'settings');
   104         $this->tpl->addBlockFile(
'ADM_CONTENT', 
'adm_content', 
'tpl.settings.html', 
'Services/Calendar');
   105         $this->tpl->setVariable(
'CAL_SETTINGS', $form->getHTML());
   117         if ($form->checkInput()) {
   118             $this->calendar_settings->setEnabled((
bool) $form->getInput(
'enable'));
   119             $this->calendar_settings->setDefaultWeekStart((
int) $form->getInput(
'default_week_start'));
   120             $this->calendar_settings->setDefaultTimeZone($form->getInput(
'default_timezone'));
   121             $this->calendar_settings->setDefaultDateFormat((
int) $form->getInput(
'default_date_format'));
   122             $this->calendar_settings->setDefaultTimeFormat((
int) $form->getInput(
'default_time_format'));
   123             $this->calendar_settings->enableCourseCalendar((
bool) $form->getInput(
'enabled_crs'));
   124             $this->calendar_settings->setCourseCalendarVisible((
bool) $form->getInput(
'visible_crs'));
   125             $this->calendar_settings->enableGroupCalendar((
bool) $form->getInput(
'enabled_grp'));
   126             $this->calendar_settings->setGroupCalendarVisible((
bool) $form->getInput(
'visible_grp'));
   127             $this->calendar_settings->setDefaultDayStart((
int) $form->getInput(
'dst'));
   128             $this->calendar_settings->setDefaultDayEnd((
int) $form->getInput(
'den'));
   129             $this->calendar_settings->enableSynchronisationCache((
bool) $form->getInput(
'sync_cache'));
   130             $this->calendar_settings->setSynchronisationCacheMinutes((
int) $form->getInput(
'sync_cache_time'));
   131             $this->calendar_settings->setCacheMinutes((
int) $form->getInput(
'cache_time'));
   132             $this->calendar_settings->useCache((
bool) $form->getInput(
'cache'));
   133             $this->calendar_settings->enableNotification((
bool) $form->getInput(
'cn'));
   134             $this->calendar_settings->enableUserNotification((
bool) $form->getInput(
'cnu'));
   135             $this->calendar_settings->enableConsultationHours((
bool) $form->getInput(
'ch'));
   136             $this->calendar_settings->enableCGRegistration((
bool) $form->getInput(
'cgr'));
   137             $this->calendar_settings->enableWebCalSync((
bool) $form->getInput(
'webcal'));
   138             $this->calendar_settings->setWebCalSyncHours((
int) $form->getInput(
'webcal_hours'));
   139             $this->calendar_settings->setShowWeeks((
bool) $form->getInput(
'show_weeks'));
   140             $this->calendar_settings->enableBatchFileDownloads((
bool) $form->getInput(
'batch_files'));
   141             $this->calendar_settings->setDefaultCal((
int) $form->getInput(
'default_calendar_view'));
   142             $this->calendar_settings->setDefaultPeriod((
int) $form->getInput(
'default_period'));
   143             $this->calendar_settings->save();
   144             $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'), 
true);
   145             $this->
ctrl->redirect($this, 
'settings');
   147         $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'err_check_input'), 
true);
   166         $form->setFormAction($this->
ctrl->getFormAction($this));
   167         $form->setTitle($this->
lng->txt(
'cal_global_settings'));
   170             $form->addCommandButton(
'save', $this->
lng->txt(
'save'));
   175         $check->setChecked($this->calendar_settings->isEnabled() ? true : 
false);
   180         $cb->setInfo($this->
lng->txt(
"cal_show_weeks_info"));
   182         $cb->setChecked($this->calendar_settings->getShowWeeks());
   192         $batch_files_download = 
new ilCheckboxInputGUI($this->
lng->txt(
'cal_batch_file_downloads'), 
"batch_files");
   193         $batch_files_download->setValue(
'1');
   194         $batch_files_download->setChecked($this->calendar_settings->isBatchFileDownloadsEnabled());
   195         $batch_files_download->setInfo($this->
lng->txt(
'cal_batch_file_downloads_info'));
   196         $form->addItem($batch_files_download);
   199         $def->setTitle($this->
lng->txt(
'cal_default_settings'));
   200         $form->addItem($def);
   204         $form->addItem($server_tz);
   208         $select->setInfo($this->
lng->txt(
'cal_def_timezone_info'));
   209         $select->setValue($this->calendar_settings->getDefaultTimeZone());
   210         $form->addItem($select);
   213         $select = 
new ilSelectInputGUI($this->
lng->txt(
'cal_def_date_format'), 
'default_date_format');
   219         $select->setInfo($this->
lng->txt(
'cal_def_date_format_info'));
   220         $select->setValue($this->calendar_settings->getDefaultDateFormat());
   221         $form->addItem($select);
   223         $select = 
new ilSelectInputGUI($this->
lng->txt(
'cal_def_time_format'), 
'default_time_format');
   228         $select->setInfo($this->
lng->txt(
'cal_def_time_format_info'));
   229         $select->setValue($this->calendar_settings->getDefaultTimeFormat());
   230         $form->addItem($select);
   234         $radio->
setValue((
string) $this->calendar_settings->getDefaultWeekStart());
   237         $radio->addOption($option);
   239         $radio->addOption($option);
   241         $form->addItem($radio);
   246         $default_cal_view->addOption($option);
   248         $default_cal_view->addOption($option);
   250         $default_cal_view->addOption($option);
   262         $list_views->setValue($this->calendar_settings->getDefaultPeriod());
   264         $default_cal_view->addOption($option);
   265         $default_cal_view->setValue((
string) $this->calendar_settings->getDefaultCal());
   267         $form->addItem($default_cal_view);
   274         $day_start->setValue($this->calendar_settings->getDefaultDayStart());
   275         $form->addItem($day_start);
   281         $day_end->setValue($this->calendar_settings->getDefaultDayEnd());
   282         $form->addItem($day_end);
   286         $con->setTitle($this->
lng->txt(
'cal_ch_form_header'));
   287         $form->addItem($con);
   290         $ch->setInfo($this->
lng->txt(
'cal_ch_form_info'));
   292         $ch->setChecked($this->calendar_settings->areConsultationHoursEnabled());
   297         $rep->setTitle(
$GLOBALS[
'DIC'][
'lng']->txt(
'cal_setting_global_vis_repos'));
   298         $form->addItem($rep);
   301             $this->
lng->txt(
'cal_setting_global_crs_act'),
   304         $crs_active->setInfo($this->
lng->txt(
'cal_setting_global_crs_act_info'));
   305         $crs_active->setValue(
'1');
   306         $crs_active->setChecked($this->calendar_settings->isCourseCalendarEnabled());
   307         $form->addItem($crs_active);
   310         $crs->setInfo(
$GLOBALS[
'DIC'][
'lng']->txt(
'cal_setting_global_crs_vis_info'));
   312         $crs->setChecked($this->calendar_settings->isCourseCalendarVisible());
   313         $crs_active->addSubItem($crs);
   316             $this->
lng->txt(
'cal_setting_global_grp_act'),
   319         $grp_active->setInfo($this->
lng->txt(
'cal_setting_global_grp_act_info'));
   320         $grp_active->setValue(
'1');
   321         $grp_active->setChecked($this->calendar_settings->isGroupCalendarEnabled());
   322         $form->addItem($grp_active);
   325         $grp->setInfo(
$GLOBALS[
'DIC'][
'lng']->txt(
'cal_setting_global_grp_vis_info'));
   327         $grp->setInfo(
$GLOBALS[
'DIC'][
'lng']->txt(
'cal_setting_global_grp_vis_info'));
   328         $grp->setChecked($this->calendar_settings->isGroupCalendarVisible());
   329         $grp_active->addSubItem($grp);
   333         $not->setTitle($this->
lng->txt(
'notifications'));
   334         $form->addItem($not);
   337         $cgn->setOptionTitle($this->
lng->txt(
'cal_notification_crsgrp'));
   339         $cgn->setChecked($this->calendar_settings->isNotificationEnabled());
   340         $cgn->setInfo($this->
lng->txt(
'cal_adm_notification_info'));
   341         $form->addItem($cgn);
   344         $cnu->setOptionTitle($this->
lng->txt(
'cal_notification_users'));
   346         $cnu->setChecked($this->calendar_settings->isUserNotificationEnabled());
   347         $cnu->setInfo($this->
lng->txt(
'cal_adm_notification_user_info'));
   348         $form->addItem($cnu);
   352         $book->setTitle($this->
lng->txt(
'cal_registrations'));
   353         $form->addItem($book);
   357         $cgn->setChecked($this->calendar_settings->isCGRegistrationEnabled());
   358         $cgn->setInfo($this->
lng->txt(
'cal_cg_registration_info'));
   359         $form->addItem($cgn);
   363         $sec->setTitle($this->
lng->txt(
'cal_cache_settings'));
   364         $form->addItem($sec);
   367         $cache->
setValue((
string) (
int) $this->calendar_settings->isSynchronisationCacheEnabled());
   368         $cache->setInfo($this->
lng->txt(
'cal_sync_cache_info'));
   369         $cache->setRequired(
true);
   372         $cache->addOption($sync_cache);
   375         $cache->addOption($sync_cache);
   378         $cache_t->setValue((
string) $this->calendar_settings->getSynchronisationCacheMinutes());
   379         $cache_t->setMinValue(0);
   380         $cache_t->setSize(3);
   381         $cache_t->setMaxLength(3);
   382         $cache_t->setSuffix($this->
lng->txt(
'form_minutes'));
   383         $sync_cache->addSubItem($cache_t);
   385         $form->addItem($cache);
   389         $cache->
setValue((
string) (
int) $this->calendar_settings->isCacheUsed());
   390         $cache->setInfo($this->
lng->txt(
'cal_cache_info'));
   391         $cache->setRequired(
true);
   393         $sync_cache = 
new ilRadioOption($this->
lng->txt(
'cal_cache_disabled'), 
'0');
   394         $cache->addOption($sync_cache);
   397         $cache->addOption($sync_cache);
   400         $cache_t->setValue((
string) $this->calendar_settings->getCacheMinutes());
   401         $cache_t->setMinValue(0);
   402         $cache_t->setSize(3);
   403         $cache_t->setMaxLength(3);
   404         $cache_t->setSuffix($this->
lng->txt(
'form_minutes'));
   405         $sync_cache->addSubItem($cache_t);
   406         $form->addItem($cache);
   412         switch ($a_form_id) {
   420                     'cal_setting_global_crs_act' => [
   421                         $this->calendar_settings->isCourseCalendarEnabled(),
   424                     'cal_setting_global_crs_vis' =>
   425                         array($this->calendar_settings->isCourseCalendarVisible(),
   430                 $fields[
'cal_setting_global_vis_repos'] = array(null, null, $subitems);
   433                     'cal_notification_crsgrp' => array($this->calendar_settings->isNotificationEnabled(),
   436                     'cal_notification_users' => array($this->calendar_settings->isUserNotificationEnabled(),
   440                 $fields[
'cal_notification'] = array(null, null, $subitems);
   442                 $fields[
'cal_cg_registrations'] = array($this->calendar_settings->isCGRegistrationEnabled(),
   446                 return array(array(
"settings", $fields));
   455                     'cal_setting_global_grp_act' => [
   456                         $this->calendar_settings->isGroupCalendarEnabled(),
   459                     'cal_setting_global_grp_vis' =>
   460                         array($this->calendar_settings->isGroupCalendarVisible(),
   466                 $fields[
'cal_setting_global_vis_repos'] = array(null, null, $subitems);
   469                     'cal_notification_crsgrp' => array($this->calendar_settings->isNotificationEnabled(),
   472                     'cal_notification_users' => array($this->calendar_settings->isUserNotificationEnabled(),
   476                 $fields[
'cal_notification'] = array(null, null, $subitems);
   478                 $fields[
'cal_cg_registrations'] = array($this->calendar_settings->isCGRegistrationEnabled(),
   482                 return array(array(
"settings", $fields));
 
static _getDefaultTimeZone()
Calculate and set default time zone. 
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
prepareOutput(bool $show_sub_objects=true)
 
static _getShortTimeZoneList()
get short timezone list 
 
static getHourSelection(int $a_format)
Get hour selection depending on user specific hour format. 
 
__construct($a_data, $a_id, $a_call_by_reference=true, $a_prepare_output=true)
Constructor  public. 
 
settings(?ilPropertyFormGUI $form=null)
 
Class ilObjectGUI Basic methods of all Output classes. 
 
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
save()
save settings  protected 
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
addToExternalSettingsForm(int $a_form_id)
 
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output. 
 
initCalendarSettings()
init calendar settings 
 
initFormSettings()
Init settings property form  protected. 
 
ilCalendarSettings $calendar_settings
 
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)