ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilCalendarUserSettings Class Reference
+ Collaboration diagram for ilCalendarUserSettings:

Public Member Functions

 getTimeZone ()
 get Time zone More...
 
 setTimeZone ($a_tz)
 set timezone More...
 
 getExportTimeZoneType ()
 Get export timezone setting. More...
 
 setExportTimeZoneType ($a_type)
 Set export timezone type. More...
 
 getExportTimeZone ()
 Get export timezone. More...
 
 setWeekStart ($a_weekstart)
 set week start More...
 
 getWeekStart ()
 get weekstart More...
 
 setDayStart ($a_start)
 Set start of day. More...
 
 getDayStart ()
 get start of day More...
 
 setDayEnd ($a_end)
 Set day end. More...
 
 getDayEnd ()
 Get end of day. More...
 
 setDateFormat ($a_format)
 set date format More...
 
 getDateFormat ()
 get date format More...
 
 setTimeFormat ($a_format)
 set time format More...
 
 getTimeFormat ()
 get time format More...
 
 getCalendarSelectionType ()
 get calendar selection type ("MyMembership" or "Selected Items") More...
 
 setCalendarSelectionType ($a_type)
 set calendar selection type More...
 
 setShowWeeks ($a_val)
 Set show weeks. More...
 
 getShowWeeks ()
 Get show weeks. More...
 
 save ()
 save More...
 

Static Public Member Functions

static _getInstanceByUserId ($a_user_id)
 get singleton instance More...
 
static _getInstance ()
 get instance for logged in user More...
 

Data Fields

const CAL_SELECTION_MEMBERSHIP = 1
 
const CAL_SELECTION_ITEMS = 2
 
const CAL_EXPORT_TZ_TZ = 1
 
const CAL_EXPORT_TZ_UTC = 2
 

Static Public Attributes

static $instances = array()
 

Protected Member Functions

 read ()
 read More...
 

Protected Attributes

 $user
 
 $settings
 

Private Member Functions

 __construct ($a_user_id)
 Constructor. More...
 

Private Attributes

 $calendar_selection_type = 1
 
 $timezone
 
 $export_tz_type = self::CAL_EXPORT_TZ_TZ
 
 $weekstart
 
 $time_format
 
 $date_format
 
 $day_start
 
 $day_end
 
 $show_weeks = true
 

Detailed Description

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 11 of file class.ilCalendarUserSettings.php.

Constructor & Destructor Documentation

◆ __construct()

ilCalendarUserSettings::__construct (   $a_user_id)
private

Constructor.

@access private

Parameters

return

Definition at line 46 of file class.ilCalendarUserSettings.php.

47 {
48 global $DIC;
49
50 $ilUser = $DIC['ilUser'];
51
52 if ($ilUser->getId() == $a_user_id) {
53 $this->user = $ilUser;
54 } else {
55 $this->user = ilObjectFactory::getInstanceByObjId($a_user_id, false);
56 }
58 $this->read();
59 }
user()
Definition: user.php:4
static _getInstance()
get singleton instance
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
global $DIC
Definition: saml.php:7
settings()
Definition: settings.php:2
$ilUser
Definition: imgupload.php:18

References $DIC, $ilUser, ilCalendarSettings\_getInstance(), ilObjectFactory\getInstanceByObjId(), read(), settings(), and user().

+ Here is the call graph for this function:

Member Function Documentation

◆ _getInstance()

static ilCalendarUserSettings::_getInstance ( )
static

get instance for logged in user

Returns
object ilCalendarUserSettings

Definition at line 83 of file class.ilCalendarUserSettings.php.

84 {
85 global $DIC;
86
87 $ilUser = $DIC['ilUser'];
88
89 return self::_getInstanceByUserId($ilUser->getId());
90 }
static _getInstanceByUserId($a_user_id)
get singleton instance

References $DIC, $ilUser, and _getInstanceByUserId().

Referenced by ilCalendarPresentationGUI\__construct(), ilCalendarSelectionBlockGUI\__construct(), ilCalendarCategoryGUI\appendCalendarSelection(), ilCalendarSelectionBlockGUI\getCalendars(), ilPDCalendarBlockGUI\initCategories(), ilCalendarCategories\initialize(), and ilCalendarCategoryGUI\switchCalendarMode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getInstanceByUserId()

◆ getCalendarSelectionType()

ilCalendarUserSettings::getCalendarSelectionType ( )

get calendar selection type ("MyMembership" or "Selected Items")

Returns

Definition at line 265 of file class.ilCalendarUserSettings.php.

References $calendar_selection_type.

Referenced by save().

+ Here is the caller graph for this function:

◆ getDateFormat()

ilCalendarUserSettings::getDateFormat ( )

get date format

@access public

Returns
int date format

Definition at line 231 of file class.ilCalendarUserSettings.php.

References $date_format.

Referenced by save().

+ Here is the caller graph for this function:

◆ getDayEnd()

ilCalendarUserSettings::getDayEnd ( )

Get end of day.

Returns

Definition at line 208 of file class.ilCalendarUserSettings.php.

References $day_end.

Referenced by save().

+ Here is the caller graph for this function:

◆ getDayStart()

ilCalendarUserSettings::getDayStart ( )

get start of day

Returns

Definition at line 189 of file class.ilCalendarUserSettings.php.

References $day_start.

Referenced by save().

+ Here is the caller graph for this function:

◆ getExportTimeZone()

ilCalendarUserSettings::getExportTimeZone ( )

Get export timezone.

Returns
type

Definition at line 138 of file class.ilCalendarUserSettings.php.

139 {
140 switch ($this->getExportTimeZoneType()) {
142 return $this->getTimeZone();
143
145 include_once './Services/Calendar/classes/class.ilTimeZone.php';
146 return ilTimeZone::UTC;
147 }
148 }
getExportTimeZoneType()
Get export timezone setting.

References CAL_EXPORT_TZ_TZ, CAL_EXPORT_TZ_UTC, getExportTimeZoneType(), getTimeZone(), and ilTimeZone\UTC.

+ Here is the call graph for this function:

◆ getExportTimeZoneType()

ilCalendarUserSettings::getExportTimeZoneType ( )

Get export timezone setting.

Returns
type

Definition at line 120 of file class.ilCalendarUserSettings.php.

References $export_tz_type.

Referenced by getExportTimeZone(), and save().

+ Here is the caller graph for this function:

◆ getShowWeeks()

ilCalendarUserSettings::getShowWeeks ( )

Get show weeks.

Returns
bool show weeks

Definition at line 295 of file class.ilCalendarUserSettings.php.

References $show_weeks.

Referenced by save().

+ Here is the caller graph for this function:

◆ getTimeFormat()

ilCalendarUserSettings::getTimeFormat ( )

get time format

@access public

Returns
int time format

Definition at line 254 of file class.ilCalendarUserSettings.php.

References $time_format.

Referenced by save().

+ Here is the caller graph for this function:

◆ getTimeZone()

ilCalendarUserSettings::getTimeZone ( )

get Time zone

@access public

Parameters

return

Definition at line 99 of file class.ilCalendarUserSettings.php.

References $timezone.

Referenced by getExportTimeZone(), and save().

+ Here is the caller graph for this function:

◆ getWeekStart()

ilCalendarUserSettings::getWeekStart ( )

get weekstart

@access public

Returns

Definition at line 170 of file class.ilCalendarUserSettings.php.

References $weekstart.

Referenced by save().

+ Here is the caller graph for this function:

◆ read()

ilCalendarUserSettings::read ( )
protected

read

@access protected

Definition at line 324 of file class.ilCalendarUserSettings.php.

325 {
326 $this->timezone = $this->user->getTimeZone();
327 $this->export_tz_type = (
328 ($this->user->getPref('export_tz_type') !== false) ?
329 $this->user->getPref('export_tz_type') :
331 );
332 $this->date_format = $this->user->getDateFormat();
333 $this->time_format = $this->user->getTimeFormat();
334 if (($weekstart = $this->user->getPref('weekstart')) === false) {
335 $weekstart = $this->settings->getDefaultWeekStart();
336 }
337 $this->calendar_selection_type = $this->user->getPref('calendar_selection_type') ?
338 $this->user->getPref('calendar_selection_type') :
340
341 $this->weekstart = $weekstart;
342
343 $this->setDayStart(
344 $this->user->getPref('day_start') !== false ?
345 $this->user->getPref('day_start') :
346 $this->settings->getDefaultDayStart()
347 );
348 $this->setDayEnd(
349 $this->user->getPref('day_end') !== false ?
350 $this->user->getPref('day_end') :
351 $this->settings->getDefaultDayEnd()
352 );
353 $this->setShowWeeks(
354 $this->user->getPref('show_weeks') !== false ?
355 $this->user->getPref('show_weeks') :
356 $this->settings->getShowWeeks()
357 );
358 }
setDayStart($a_start)
Set start of day.

References $export_tz_type, $weekstart, CAL_SELECTION_MEMBERSHIP, setDayEnd(), setDayStart(), setShowWeeks(), settings(), and user().

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilCalendarUserSettings::save ( )

save

@access public

Definition at line 305 of file class.ilCalendarUserSettings.php.

306 {
307 $this->user->writePref('user_tz', $this->getTimeZone());
308 $this->user->writePref('export_tz_type', $this->getExportTimeZoneType());
309 $this->user->writePref('weekstart', $this->getWeekStart());
310 $this->user->writePref('date_format', $this->getDateFormat());
311 $this->user->writePref('time_format', $this->getTimeFormat());
312 $this->user->writePref('calendar_selection_type', $this->getCalendarSelectionType());
313 $this->user->writePref('day_start', $this->getDayStart());
314 $this->user->writePref('day_end', $this->getDayEnd());
315 $this->user->writePref('show_weeks', $this->getShowWeeks());
316 }
getCalendarSelectionType()
get calendar selection type ("MyMembership" or "Selected Items")

References getCalendarSelectionType(), getDateFormat(), getDayEnd(), getDayStart(), getExportTimeZoneType(), getShowWeeks(), getTimeFormat(), getTimeZone(), getWeekStart(), and user().

+ Here is the call graph for this function:

◆ setCalendarSelectionType()

ilCalendarUserSettings::setCalendarSelectionType (   $a_type)

set calendar selection type

Parameters
int$typeself::CAL_SELECTION_MEMBERSHIP | self::CAL_SELECTION_ITEM
Returns
void

Definition at line 275 of file class.ilCalendarUserSettings.php.

276 {
277 $this->calendar_selection_type = $a_type;
278 }
$a_type
Definition: workflow.php:92

References $a_type.

◆ setDateFormat()

ilCalendarUserSettings::setDateFormat (   $a_format)

set date format

@access public

Parameters
intdate
Returns

Definition at line 220 of file class.ilCalendarUserSettings.php.

221 {
222 $this->date_format = $a_format;
223 }

◆ setDayEnd()

ilCalendarUserSettings::setDayEnd (   $a_end)

Set day end.

Returns
Parameters
int$a_end

Definition at line 199 of file class.ilCalendarUserSettings.php.

200 {
201 $this->day_end = $a_end;
202 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setDayStart()

ilCalendarUserSettings::setDayStart (   $a_start)

Set start of day.

Returns
Parameters
int$a_start

Definition at line 180 of file class.ilCalendarUserSettings.php.

181 {
182 $this->day_start = $a_start;
183 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setExportTimeZoneType()

ilCalendarUserSettings::setExportTimeZoneType (   $a_type)

Set export timezone type.

Parameters
type$a_type

Definition at line 129 of file class.ilCalendarUserSettings.php.

130 {
131 $this->export_tz_type = $a_type;
132 }

References $a_type.

◆ setShowWeeks()

ilCalendarUserSettings::setShowWeeks (   $a_val)

Set show weeks.

Parameters
bool$a_valshow weeks

Definition at line 285 of file class.ilCalendarUserSettings.php.

286 {
287 $this->show_weeks = $a_val;
288 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setTimeFormat()

ilCalendarUserSettings::setTimeFormat (   $a_format)

set time format

@access public

Parameters
inttime
Returns

Definition at line 243 of file class.ilCalendarUserSettings.php.

244 {
245 $this->time_format = $a_format;
246 }

◆ setTimeZone()

ilCalendarUserSettings::setTimeZone (   $a_tz)

set timezone

@access public

Parameters

return

Definition at line 111 of file class.ilCalendarUserSettings.php.

112 {
113 $this->timezone = $a_tz;
114 }

◆ setWeekStart()

ilCalendarUserSettings::setWeekStart (   $a_weekstart)

set week start

@access public

Parameters

return

Definition at line 159 of file class.ilCalendarUserSettings.php.

160 {
161 $this->weekstart = $a_weekstart;
162 }

Field Documentation

◆ $calendar_selection_type

ilCalendarUserSettings::$calendar_selection_type = 1
private

Definition at line 24 of file class.ilCalendarUserSettings.php.

Referenced by getCalendarSelectionType().

◆ $date_format

ilCalendarUserSettings::$date_format
private

Definition at line 29 of file class.ilCalendarUserSettings.php.

Referenced by getDateFormat().

◆ $day_end

ilCalendarUserSettings::$day_end
private

Definition at line 32 of file class.ilCalendarUserSettings.php.

Referenced by getDayEnd().

◆ $day_start

ilCalendarUserSettings::$day_start
private

Definition at line 31 of file class.ilCalendarUserSettings.php.

Referenced by getDayStart().

◆ $export_tz_type

ilCalendarUserSettings::$export_tz_type = self::CAL_EXPORT_TZ_TZ
private

Definition at line 26 of file class.ilCalendarUserSettings.php.

Referenced by getExportTimeZoneType(), and read().

◆ $instances

ilCalendarUserSettings::$instances = array()
static

Definition at line 19 of file class.ilCalendarUserSettings.php.

◆ $settings

ilCalendarUserSettings::$settings
protected

Definition at line 22 of file class.ilCalendarUserSettings.php.

◆ $show_weeks

ilCalendarUserSettings::$show_weeks = true
private

Definition at line 37 of file class.ilCalendarUserSettings.php.

Referenced by getShowWeeks().

◆ $time_format

ilCalendarUserSettings::$time_format
private

Definition at line 28 of file class.ilCalendarUserSettings.php.

Referenced by getTimeFormat().

◆ $timezone

ilCalendarUserSettings::$timezone
private

Definition at line 25 of file class.ilCalendarUserSettings.php.

Referenced by getTimeZone().

◆ $user

ilCalendarUserSettings::$user
protected

Definition at line 21 of file class.ilCalendarUserSettings.php.

◆ $weekstart

ilCalendarUserSettings::$weekstart
private

Definition at line 27 of file class.ilCalendarUserSettings.php.

Referenced by getWeekStart(), and read().

◆ CAL_EXPORT_TZ_TZ

const ilCalendarUserSettings::CAL_EXPORT_TZ_TZ = 1

◆ CAL_EXPORT_TZ_UTC

const ilCalendarUserSettings::CAL_EXPORT_TZ_UTC = 2

◆ CAL_SELECTION_ITEMS

const ilCalendarUserSettings::CAL_SELECTION_ITEMS = 2

◆ CAL_SELECTION_MEMBERSHIP


The documentation for this class was generated from the following file: