ILIAS  Release_3_10_x_branch Revision 61812
 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
 setWeekStart ($a_weekstart)
 set week start
 getWeekStart ()
 get weekstart
 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

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
 $weekstart
 $time_format

Detailed Description

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 33 of file class.ilCalendarUserSettings.php.

References _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

get instance for logged in user

Returns

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

References _getInstanceByUserId().

Referenced by __construct(), ilCalendarCategoryGUI\appendCalendarSelection(), ilCalendarCategories\initialize(), and ilCalendarCategoryGUI\switchCalendarMode().

{
global $ilUser;
return self::_getInstanceByUserId($ilUser->getId());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilCalendarUserSettings::_getInstanceByUserId (   $a_user_id)
static

get singleton instance

public

Parameters
intuser id
Returns
ilCalendarUserSettings

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

Referenced by ilMiniCalendarGUI\__construct(), ilCalendarUserSettingsGUI\__construct(), ilCalendarInboxGUI\__construct(), ilRecurrenceInputGUI\__construct(), ilCalendarDayGUI\__construct(), ilCalendarMonthGUI\__construct(), ilCalendarWeekGUI\__construct(), ilCalendarSchedule\__construct(), _getInstance(), and ilCalendarBlockGUI\ilCalendarBlockGUI().

{
if(isset(self::$instances[$a_user_id]))
{
return self::$instances[$a_user_id];
}
return self::$instances[$a_user_id] = new ilCalendarUserSettings($a_user_id);
}

+ Here is the caller graph for this function:

ilCalendarUserSettings::getCalendarSelectionType ( )

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

Returns

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

References $calendar_selection_type.

Referenced by save().

+ Here is the caller graph for this function:

ilCalendarUserSettings::getTimeFormat ( )

get time format

public

Returns
int time format

Definition at line 144 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 86 of file class.ilCalendarUserSettings.php.

References $timezone.

Referenced by save().

{
}

+ Here is the caller graph for this function:

ilCalendarUserSettings::getWeekStart ( )

get weekstart

public

Returns

Definition at line 121 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 189 of file class.ilCalendarUserSettings.php.

References $weekstart, and CAL_SELECTION_MEMBERSHIP.

Referenced by __construct().

{
$this->timezone = $this->user->getTimeZone();
$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;
}

+ Here is the caller graph for this function:

ilCalendarUserSettings::save ( )

save

public

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

References getCalendarSelectionType(), getTimeFormat(), getTimeZone(), and getWeekStart().

{
$this->user->writePref('user_tz',$this->getTimeZone());
$this->user->writePref('weekstart',$this->getWeekStart());
$this->user->writePref('time_format',$this->getTimeFormat());
$this->user->writePref('calendar_selection_type',$this->getCalendarSelectionType());
}

+ 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 165 of file class.ilCalendarUserSettings.php.

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

set time format

public

Parameters
inttime
Returns

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

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

set timezone

public

Parameters
@return

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

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

set week start

public

Parameters
@return

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

{
$this->weekstart = $a_weekstart;
}

Field Documentation

ilCalendarUserSettings::$calendar_selection_type = 1
private

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

Referenced by getCalendarSelectionType().

ilCalendarUserSettings::$instances = array()
static

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

ilCalendarUserSettings::$settings
protected

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

ilCalendarUserSettings::$time_format
private

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

Referenced by getTimeFormat().

ilCalendarUserSettings::$timezone
private

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

Referenced by getTimeZone().

ilCalendarUserSettings::$user
protected

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

ilCalendarUserSettings::$weekstart
private

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

Referenced by getWeekStart(), and read().

const ilCalendarUserSettings::CAL_SELECTION_ITEMS = 2
const ilCalendarUserSettings::CAL_SELECTION_MEMBERSHIP = 1

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