ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilCalendarUserSettings Class Reference
+ Collaboration diagram for ilCalendarUserSettings:

Public Member Functions

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

Static Public Member Functions

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

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

Protected Attributes

 $user
 $settings

Private Member Functions

 __construct ($a_user_id)
 Constructor.

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

ilCalendarUserSettings::__construct (   $a_user_id)
private

Constructor.

private

Parameters
@return

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

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

{
global $ilUser;
if($ilUser->getId() == $a_user_id)
{
$this->user = $ilUser;
}
else
{
$this->user = ilObjectFactory::getInstanceByObjId($a_user_id,false);
}
$this->settings = ilCalendarSettings::_getInstance();
$this->read();
}

+ Here is the call graph for this function:

Member Function Documentation

static ilCalendarUserSettings::_getInstance ( )
static
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:

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:

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:

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:

ilCalendarUserSettings::getExportTimeZone ( )

Get export timezone.

Returns
type

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

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

{
switch($this->getExportTimeZoneType())
{
case self::CAL_EXPORT_TZ_TZ:
return $this->getTimeZone();
case self::CAL_EXPORT_TZ_UTC:
include_once './Services/Calendar/classes/class.ilTimeZone.php';
}
}

+ Here is the call graph for this function:

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:

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:

ilCalendarUserSettings::getTimeZone ( )

get Time zone

public

Parameters
@return

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

References $timezone.

Referenced by getExportTimeZone(), and save().

{
}

+ Here is the caller graph for this function:

ilCalendarUserSettings::getWeekStart ( )

get weekstart

public

Returns

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

References $weekstart.

Referenced by save().

{
return (int) $this->weekstart;
}

+ Here is the caller graph for this function:

ilCalendarUserSettings::read ( )
protected

read

protected

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

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

Referenced by __construct().

{
$this->timezone = $this->user->getTimeZone();
$this->export_tz_type = (
($this->user->getPref('export_tz_type') !== FALSE) ?
$this->user->getPref('export_tz_type') :
);
$this->date_format = $this->user->getDateFormat();
$this->time_format = $this->user->getTimeFormat();
if(($weekstart = $this->user->getPref('weekstart')) === false)
{
$weekstart = $this->settings->getDefaultWeekStart();
}
$this->calendar_selection_type = $this->user->getPref('calendar_selection_type') ?
$this->user->getPref('calendar_selection_type') :
$this->weekstart = $weekstart;
$this->setDayStart($this->user->getPref('day_start') !== false ?
$this->user->getPref('day_start') :
);
$this->setDayEnd($this->user->getPref('day_end') !== false ?
$this->user->getPref('day_end') :
);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilCalendarUserSettings::save ( )

save

public

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

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

{
$this->user->writePref('user_tz',$this->getTimeZone());
$this->user->writePref('export_tz_type',$this->getExportTimeZoneType());
$this->user->writePref('weekstart',$this->getWeekStart());
$this->user->writePref('date_format',$this->getDateFormat());
$this->user->writePref('time_format',$this->getTimeFormat());
$this->user->writePref('calendar_selection_type',$this->getCalendarSelectionType());
$this->user->writePref('day_start',$this->getDayStart());
$this->user->writePref('day_end',$this->getDayEnd());
}

+ Here is the call graph for this function:

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.

{
$this->calendar_selection_type = $a_type;
}
ilCalendarUserSettings::setDateFormat (   $a_format)

set date format

public

Parameters
intdate
Returns

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

{
$this->date_format = $a_format;
}
ilCalendarUserSettings::setDayEnd (   $a_end)

Set day end.

Returns
Parameters
int$a_end

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

Referenced by read().

{
$this->day_end = $a_end;
}

+ Here is the caller graph for this function:

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().

{
$this->day_start = $a_start;
}

+ Here is the caller graph for this function:

ilCalendarUserSettings::setExportTimeZoneType (   $a_type)

Set export timezone type.

Parameters
type$a_type

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

{
$this->export_tz_type = $a_type;
}
ilCalendarUserSettings::setTimeFormat (   $a_format)

set time format

public

Parameters
inttime
Returns

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

{
$this->time_format = $a_format;
}
ilCalendarUserSettings::setTimeZone (   $a_tz)

set timezone

public

Parameters
@return

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

{
$this->timezone = $a_tz;
}
ilCalendarUserSettings::setWeekStart (   $a_weekstart)

set week start

public

Parameters
@return

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

{
$this->weekstart = $a_weekstart;
}

Field Documentation

ilCalendarUserSettings::$calendar_selection_type = 1
private

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

Referenced by getCalendarSelectionType().

ilCalendarUserSettings::$date_format
private

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

Referenced by getDateFormat().

ilCalendarUserSettings::$day_end
private

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

Referenced by getDayEnd().

ilCalendarUserSettings::$day_start
private

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

Referenced by getDayStart().

ilCalendarUserSettings::$export_tz_type = self::CAL_EXPORT_TZ_TZ
private

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

Referenced by getExportTimeZoneType(), and read().

ilCalendarUserSettings::$instances = array()
static

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

ilCalendarUserSettings::$settings
protected

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

ilCalendarUserSettings::$time_format
private

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

Referenced by getTimeFormat().

ilCalendarUserSettings::$timezone
private

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

Referenced by getTimeZone().

ilCalendarUserSettings::$user
protected

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

ilCalendarUserSettings::$weekstart
private

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

Referenced by getWeekStart(), and read().

const ilCalendarUserSettings::CAL_EXPORT_TZ_TZ = 1
const ilCalendarUserSettings::CAL_EXPORT_TZ_UTC = 2
const ilCalendarUserSettings::CAL_SELECTION_ITEMS = 2

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