ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f87
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...
 
 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
 

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.

private

Parameters

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

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

42  {
43  global $ilUser;
44 
45  if($ilUser->getId() == $a_user_id)
46  {
47  $this->user = $ilUser;
48  }
49  else
50  {
51  $this->user = ilObjectFactory::getInstanceByObjId($a_user_id,false);
52  }
53  $this->settings = ilCalendarSettings::_getInstance();
54  $this->read();
55  }
static _getInstance()
get singleton instance
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

Member Function Documentation

◆ _getInstance()

static ilCalendarUserSettings::_getInstance ( )
static

◆ _getInstanceByUserId()

static ilCalendarUserSettings::_getInstanceByUserId (   $a_user_id)
static

◆ getCalendarSelectionType()

ilCalendarUserSettings::getCalendarSelectionType ( )

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

Returns

Definition at line 261 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

public

Returns
int date format

Definition at line 227 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 204 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 185 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 133 of file class.ilCalendarUserSettings.php.

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

134  {
135  switch($this->getExportTimeZoneType())
136  {
137  case self::CAL_EXPORT_TZ_TZ:
138  return $this->getTimeZone();
139 
140  case self::CAL_EXPORT_TZ_UTC:
141  include_once './Services/Calendar/classes/class.ilTimeZone.php';
142  return ilTimeZone::UTC;
143  }
144  }
getExportTimeZoneType()
Get export timezone setting.
+ Here is the call graph for this function:

◆ getExportTimeZoneType()

ilCalendarUserSettings::getExportTimeZoneType ( )

Get export timezone setting.

Returns
type

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

References $export_tz_type.

Referenced by getExportTimeZone(), and save().

+ Here is the caller graph for this function:

◆ getTimeFormat()

ilCalendarUserSettings::getTimeFormat ( )

get time format

public

Returns
int time format

Definition at line 250 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

public

Parameters

Definition at line 94 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

public

Returns

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

References $weekstart.

Referenced by save().

167  {
168  return (int) $this->weekstart;
169  }
+ Here is the caller graph for this function:

◆ read()

ilCalendarUserSettings::read ( )
protected

read

protected

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

References $export_tz_type, $weekstart, ilCalendarSettings\DEFAULT_DAY_END, ilCalendarSettings\DEFAULT_DAY_START, setDayEnd(), and setDayStart().

Referenced by __construct().

300  {
301 
302 
303  $this->timezone = $this->user->getTimeZone();
304  $this->export_tz_type = (
305  ($this->user->getPref('export_tz_type') !== FALSE) ?
306  $this->user->getPref('export_tz_type') :
308  );
309  $this->date_format = $this->user->getDateFormat();
310  $this->time_format = $this->user->getTimeFormat();
311  if(($weekstart = $this->user->getPref('weekstart')) === false)
312  {
313  $weekstart = $this->settings->getDefaultWeekStart();
314  }
315  $this->calendar_selection_type = $this->user->getPref('calendar_selection_type') ?
316  $this->user->getPref('calendar_selection_type') :
317  self::CAL_SELECTION_MEMBERSHIP;
318 
319  $this->weekstart = $weekstart;
320 
321  $this->setDayStart($this->user->getPref('day_start') !== false ?
322  $this->user->getPref('day_start') :
324  );
325  $this->setDayEnd($this->user->getPref('day_end') !== false ?
326  $this->user->getPref('day_end') :
328  );
329  }
setDayStart($a_start)
Set start of day.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilCalendarUserSettings::save ( )

save

public

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

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

282  {
283  $this->user->writePref('user_tz',$this->getTimeZone());
284  $this->user->writePref('export_tz_type',$this->getExportTimeZoneType());
285  $this->user->writePref('weekstart',$this->getWeekStart());
286  $this->user->writePref('date_format',$this->getDateFormat());
287  $this->user->writePref('time_format',$this->getTimeFormat());
288  $this->user->writePref('calendar_selection_type',$this->getCalendarSelectionType());
289  $this->user->writePref('day_start',$this->getDayStart());
290  $this->user->writePref('day_end',$this->getDayEnd());
291  }
getCalendarSelectionType()
get calendar selection type ("MyMembership" or "Selected Items")
getExportTimeZoneType()
Get export timezone setting.
+ 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 271 of file class.ilCalendarUserSettings.php.

272  {
273  $this->calendar_selection_type = $a_type;
274  }

◆ setDateFormat()

ilCalendarUserSettings::setDateFormat (   $a_format)

set date format

public

Parameters
intdate
Returns

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

217  {
218  $this->date_format = $a_format;
219  }

◆ setDayEnd()

ilCalendarUserSettings::setDayEnd (   $a_end)

Set day end.

Returns
Parameters
int$a_end

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

Referenced by read().

196  {
197  $this->day_end = $a_end;
198  }
+ 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 176 of file class.ilCalendarUserSettings.php.

Referenced by read().

177  {
178  $this->day_start = $a_start;
179  }
+ Here is the caller graph for this function:

◆ setExportTimeZoneType()

ilCalendarUserSettings::setExportTimeZoneType (   $a_type)

Set export timezone type.

Parameters
type$a_type

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

125  {
126  $this->export_tz_type = $a_type;
127  }

◆ setTimeFormat()

ilCalendarUserSettings::setTimeFormat (   $a_format)

set time format

public

Parameters
inttime
Returns

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

240  {
241  $this->time_format = $a_format;
242  }

◆ setTimeZone()

ilCalendarUserSettings::setTimeZone (   $a_tz)

set timezone

public

Parameters

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

107  {
108  $this->timezone = $a_tz;
109  }

◆ setWeekStart()

ilCalendarUserSettings::setWeekStart (   $a_weekstart)

set week start

public

Parameters

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

156  {
157  $this->weekstart = $a_weekstart;
158  }

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.

◆ $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: