19 declare(strict_types=1);
87 $this->db = $DIC->database();
95 if (self::$instance) {
96 return self::$instance;
103 if (!self::lookupCalendarActivated($obj_id)) {
106 $settings = self::_getInstance();
108 $default = $settings->isObjectCalendarVisible($type);
111 'cont_show_calendar',
123 $gl_activated =
false;
139 'cont_activation_calendar',
140 (
string) $gl_activated
146 $this->cache_enabled = $a_status;
156 $this->cache_minutes = $a_min;
166 $this->enabled = $a_enabled;
176 $this->week_start = $a_start;
206 $this->timezone = $a_zone;
216 $this->date_format = $a_format;
226 $this->time_format = $a_format;
241 $this->day_start = $a_start;
251 $this->day_end = $a_end;
261 $this->consultation_hours = $a_status;
276 $this->sync_cache_enabled = $a_status;
281 $this->sync_cache_minutes = $a_min;
306 $this->notification_user = $a_not;
311 $this->cg_registration = $a_status;
321 $this->course_cal_enabled = $a_stat;
336 $this->course_cal_visible = $status;
352 $this->group_cal_enabled = $a_stat;
367 $this->group_cal_visible = $status;
372 $this->webcal_sync = $a_stat;
382 $this->webcal_sync_hours = $a_hours;
392 $this->show_weeks = $a_val;
402 $this->batch_file_downloads = $a_stat;
412 $this->storage->set(
'enabled', (
string) (
int) $this->
isEnabled());
419 $this->storage->set(
'cache_minutes', (
string) $this->
getCacheMinutes());
422 $this->storage->set(
'cache_enabled', (
string) (
int) $this->
isCacheUsed());
433 $this->storage->set(
'show_weeks', (
string) (
int) $this->
getShowWeeks());
435 $this->storage->set(
'default_calendar_view', (
string) $this->
getDefaultCal());
441 $this->
setEnabled((
bool) $this->storage->get(
'enabled'));
443 $this->
setDefaultWeekStart((
int) $this->storage->get(
'default_week_start', (
string) self::WEEK_START_MONDAY));
444 $this->
setDefaultDateFormat((
int) $this->storage->get(
'default_date_format', (
string) self::DATE_FORMAT_DMY));
445 $this->
setDefaultTimeFormat((
int) $this->storage->get(
'default_time_format', (
string) self::TIME_FORMAT_24));
446 $this->
setDefaultDayStart((
int) $this->storage->get(
'default_day_start', (
string) self::DEFAULT_DAY_START));
447 $this->
setDefaultDayEnd((
int) $this->storage->get(
'default_day_end', (
string) self::DEFAULT_DAY_END));
448 $this->
useCache((
bool) $this->storage->get(
'cache_enabled', (
string) $this->cache_enabled));
449 $this->
setCacheMinutes((
int) $this->storage->get(
'cache_minutes', (
string) self::DEFAULT_CACHE_MINUTES));
451 'sync_cache_enabled',
452 (
string) $this->isSynchronisationCacheEnabled()
455 'sync_cache_minutes',
456 (
string) self::DEFAULT_SYNC_CACHE_MINUTES
458 $this->
enableNotification((
bool) $this->storage->get(
'notification', (
string) $this->isNotificationEnabled()));
460 'consultation_hours',
461 (
string) $this->areConsultationHoursEnabled()
465 (
string) $this->isCGRegistrationEnabled()
469 (
string) $this->isCourseCalendarEnabled()
472 'course_cal_visible',
473 (
string) $this->isCourseCalendarVisible()
475 $this->
enableGroupCalendar((
bool) $this->storage->get(
'group_cal', (
string) $this->isGroupCalendarEnabled()));
478 (
string) $this->isGroupCalendarVisible()
482 (
string) $this->isUserNotificationEnabled()
484 $this->
enableWebCalSync((
bool) $this->storage->get(
'webcal_sync', (
string) $this->isWebCalSyncEnabled()));
485 $this->
setWebCalSyncHours((
int) $this->storage->get(
'webcal_sync_hours', (
string) $this->getWebCalSyncHours()));
486 $this->
setShowWeeks((
bool) $this->storage->get(
'show_weeks', (
string) $this->getShowWeeks()));
489 (
string) $this->isBatchFileDownloadsEnabled()
491 $this->
setDefaultCal((
int) $this->storage->get(
'default_calendar_view', (
string) $this->getDefaultCal()));
492 $this->
setDefaultPeriod((
int) $this->storage->get(
'default_period', (
string) $this->getDefaultPeriod()));
497 $query =
"SELECT ref_id FROM object_reference obr " .
498 "JOIN object_data obd ON obd.obj_id = obr.obj_id " .
499 "WHERE type = 'cals'";
501 $set = $this->db->query($query);
502 $row = $this->db->fetchAssoc($set);
504 $this->cal_settings_id = (
int) $row[
"ref_id"];
509 $this->storage =
new ilSetting(
'calendar');
static _getDefaultTimeZone()
Calculate and set default time zone.
setDefaultTimeZone(string $a_zone)
static lookupCalendarActivated(int $a_obj_id)
isBatchFileDownloadsEnabled()
isCourseCalendarVisible()
isUserNotificationEnabled()
setDefaultTimeFormat(int $a_format)
enableCourseCalendar(bool $a_stat)
enableConsultationHours(bool $a_status)
const DEFAULT_SYNC_CACHE_MINUTES
enableBatchFileDownloads(bool $a_stat)
notification()
description: > Example for rendring a notification glyph.
enableSynchronisationCache(bool $a_status)
setDefaultDayStart(int $a_start)
setCacheMinutes(int $a_min)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
setWebCalSyncHours(int $a_hours)
enableGroupCalendar(bool $a_stat)
getSynchronisationCacheMinutes()
enableUserNotification(bool $a_not)
isCGRegistrationEnabled()
const DATE_FORMAT_UNDEFINED
areConsultationHoursEnabled()
enableWebCalSync(bool $a_stat)
bool $batch_file_downloads
isObjectCalendarVisible(string $type)
setCourseCalendarVisible(bool $status)
setDefaultPeriod(int $default_period)
static lookupCalendarContentPresentationEnabled(int $obj_id)
enableCGRegistration(bool $a_status)
setDefaultWeekStart(int $a_start)
setShowWeeks(bool $a_val)
static _lookupContainerSetting(int $a_id, string $a_keyword, ?string $a_default_value=null)
setDefaultDayEnd(int $a_end)
static ilCalendarSettings $instance
enableNotification(bool $a_status)
setDefaultCal(int $default_cal)
setDefaultDateFormat(int $a_format)
isCourseCalendarEnabled()
static _lookupType(int $id, bool $reference=false)
setSynchronisationCacheMinutes(int $a_min)
isSynchronisationCacheEnabled()
setGroupCalendarVisible(bool $status)
const DEFAULT_CACHE_MINUTES
setEnabled(bool $a_enabled)