3 declare(strict_types=1);
37 $this->
user = $DIC->user();
39 if ($this->
user->getId() !== $a_user_id) {
53 if (isset(self::$instances[$a_user_id])) {
54 return self::$instances[$a_user_id];
64 return self::_getInstanceByUserId(
$ilUser->getId());
74 $this->timezone = $a_tz;
84 $this->export_tz_type = $a_type;
90 case self::CAL_EXPORT_TZ_TZ:
93 case self::CAL_EXPORT_TZ_UTC:
101 $this->weekstart = $a_weekstart;
111 $this->day_start = $a_start;
121 $this->day_end = $a_end;
131 $this->date_format = $a_format;
141 $this->time_format = $a_format;
165 $this->calendar_selection_type = $a_type;
170 $this->show_weeks = $a_val;
187 $this->
user->writePref(
'day_end', (
string) $this->
getDayEnd());
191 protected function read(): void
193 $this->timezone = (string) $this->
user->getTimeZone();
194 $this->export_tz_type = (
int) (
195 ($this->
user->getPref(
'export_tz_type') !==
false) ?
196 $this->
user->getPref(
'export_tz_type') :
199 $this->date_format = (
int) $this->
user->getDateFormat();
200 $this->time_format = (
int) $this->
user->getTimeFormat();
201 if (($weekstart = $this->
user->getPref(
'weekstart')) ===
false) {
202 $weekstart = $this->
settings->getDefaultWeekStart();
204 $this->calendar_selection_type = (
int) $this->
user->getPref(
'calendar_selection_type') ?
205 (
int) $this->
user->getPref(
'calendar_selection_type') :
206 self::CAL_SELECTION_MEMBERSHIP;
208 $this->weekstart = (
int) $weekstart;
211 $this->
user->getPref(
'day_start') ?
212 (
int) $this->
user->getPref(
'day_start') :
213 $this->
settings->getDefaultDayStart()
216 $this->
user->getPref(
'day_end') ?
217 (
int) $this->
user->getPref(
'day_end') :
221 $this->
user->getPref(
'show_weeks') !== null ?
222 (bool) $this->
user->getPref(
'show_weeks') :
setTimeFormat(int $a_format)
const CAL_SELECTION_MEMBERSHIP
setDayStart(int $a_start)
setCalendarSelectionType(int $a_type)
set calendar selection type
setShowWeeks(bool $a_val)
static _getInstanceByUserId(int $a_user_id)
getCalendarSelectionType()
get calendar selection type ("MyMembership" or "Selected Items")
const CAL_SELECTION_ITEMS
ilCalendarSettings $settings
__construct(int $a_user_id)
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
int $calendar_selection_type
setWeekStart(int $a_weekstart)
setTimeZone(string $a_tz)
setExportTimeZoneType(int $a_type)
setDateFormat(int $a_format)