ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilCalendarSettings Class Reference

Stores all calendar relevant settings. More...

+ Collaboration diagram for ilCalendarSettings:

Public Member Functions

 setEnabled ($a_enabled)
 set enabled
 isEnabled ()
 is calendar enabled
 setDefaultWeekStart ($a_start)
 set week start
 getDefaultWeekStart ()
 get default week start
 setDefaultTimeZone ($a_zone)
 set default timezone
 getDefaultTimeZone ()
 get derfault time zone
 setDefaultTimeFormat ($a_format)
 set default time format
 getDefaultTimeFormat ()
 get default time format
 getCalendarSettingsId ()
 Get calendar settings id (Used for permission checks)
 save ()
 save

Static Public Member Functions

static _getInstance ()
 get singleton instance

Data Fields

const WEEK_START_MONDAY = 1
const WEEK_START_SUNDAY = 0
const TIME_FORMAT_24 = 1
const TIME_FORMAT_12 = 2

Private Member Functions

 __construct ()
 singleton contructor
 read ()
 Read settings.
 readCalendarSettingsId ()
 Read ref_id of calendar settings.
 initStorage ()
 Init storage class (ilSetting) private.

Private Attributes

 $db = null
 $storage = null
 $timezone = null
 $time_format = null
 $week_start = 0
 $enabled = false
 $cal_settings_id = 0

Static Private Attributes

static $instance = null

Detailed Description

Stores all calendar relevant settings.

Author
Stefan Meyer smeye.nosp@m.r@da.nosp@m.tabay.nosp@m..de
Version
$Id$

Definition at line 35 of file class.ilCalendarSettings.php.

Constructor & Destructor Documentation

ilCalendarSettings::__construct ( )
private

singleton contructor

private

Definition at line 59 of file class.ilCalendarSettings.php.

References initStorage(), read(), and readCalendarSettingsId().

{
global $ilDB;
$this->db = $ilDB;
$this->initStorage();
$this->read();
}

+ Here is the call graph for this function:

Member Function Documentation

ilCalendarSettings::getCalendarSettingsId ( )

Get calendar settings id (Used for permission checks)

public

Returns

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

References $cal_settings_id.

ilCalendarSettings::getDefaultTimeFormat ( )

get default time format

public

Returns
int time format

Definition at line 168 of file class.ilCalendarSettings.php.

References $time_format.

Referenced by save().

{
}

+ Here is the caller graph for this function:

ilCalendarSettings::getDefaultTimeZone ( )

get derfault time zone

public

Definition at line 145 of file class.ilCalendarSettings.php.

References $timezone.

Referenced by save().

{
}

+ Here is the caller graph for this function:

ilCalendarSettings::getDefaultWeekStart ( )

get default week start

public

Definition at line 125 of file class.ilCalendarSettings.php.

References $week_start.

Referenced by save().

{
}

+ Here is the caller graph for this function:

ilCalendarSettings::initStorage ( )
private

Init storage class (ilSetting) private.

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

Referenced by __construct().

{
include_once('./Services/Administration/classes/class.ilSetting.php');
$this->storage = new ilSetting('calendar');
}

+ Here is the caller graph for this function:

ilCalendarSettings::isEnabled ( )

is calendar enabled

public

Definition at line 103 of file class.ilCalendarSettings.php.

References $enabled.

Referenced by save().

{
return (bool) $this->enabled;
}

+ Here is the caller graph for this function:

ilCalendarSettings::read ( )
private

Read settings.

private

Parameters

Definition at line 206 of file class.ilCalendarSettings.php.

References ilTimeZone\_getDefaultTimeZone(), setDefaultTimeFormat(), setDefaultTimeZone(), setDefaultWeekStart(), and setEnabled().

Referenced by __construct().

{
$this->setEnabled($this->storage->get('enabled'));
$this->setDefaultTimeZone($this->storage->get('default_timezone',ilTimeZone::_getDefaultTimeZone()));
$this->setDefaultWeekStart($this->storage->get('default_week_start',self::WEEK_START_MONDAY));
$this->setDefaultTimeFormat($this->storage->get('default_time_format',self::TIME_FORMAT_24));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilCalendarSettings::readCalendarSettingsId ( )
private

Read ref_id of calendar settings.

private

Parameters
@return

Definition at line 221 of file class.ilCalendarSettings.php.

References $res.

Referenced by __construct().

{
$query = "SELECT ref_id FROM object_reference AS obr ".
"JOIN object_data AS obd ON obd.obj_id = obr.obj_id ".
"WHERE type = 'cals'";
$res = $this->db->query($query);
$row = $res->fetchRow();
$this->cal_settings_id = $row[0];
return true;
}

+ Here is the caller graph for this function:

ilCalendarSettings::save ( )

save

public

Definition at line 191 of file class.ilCalendarSettings.php.

References getDefaultTimeFormat(), getDefaultTimeZone(), getDefaultWeekStart(), and isEnabled().

{
$this->storage->set('enabled',(int) $this->isEnabled());
$this->storage->set('default_timezone',$this->getDefaultTimeZone());
$this->storage->set('default_week_start',$this->getDefaultWeekStart());
$this->storage->set('default_time_format',$this->getDefaultTimeFormat());
}

+ Here is the call graph for this function:

ilCalendarSettings::setDefaultTimeFormat (   $a_format)

set default time format

public

Parameters
inttime format
Returns

Definition at line 157 of file class.ilCalendarSettings.php.

Referenced by read().

{
$this->time_format = $a_format;
}

+ Here is the caller graph for this function:

ilCalendarSettings::setDefaultTimeZone (   $a_zone)

set default timezone

public

Definition at line 135 of file class.ilCalendarSettings.php.

Referenced by read().

{
$this->timezone = $a_zone;
}

+ Here is the caller graph for this function:

ilCalendarSettings::setDefaultWeekStart (   $a_start)

set week start

public

Definition at line 114 of file class.ilCalendarSettings.php.

Referenced by read().

{
$this->week_start = $a_start;
}

+ Here is the caller graph for this function:

ilCalendarSettings::setEnabled (   $a_enabled)

set enabled

public

Definition at line 92 of file class.ilCalendarSettings.php.

Referenced by read().

{
$this->enabled = $a_enabled;
}

+ Here is the caller graph for this function:

Field Documentation

ilCalendarSettings::$cal_settings_id = 0
private

Definition at line 51 of file class.ilCalendarSettings.php.

Referenced by getCalendarSettingsId().

ilCalendarSettings::$db = null
private

Definition at line 45 of file class.ilCalendarSettings.php.

ilCalendarSettings::$enabled = false
private

Definition at line 50 of file class.ilCalendarSettings.php.

Referenced by isEnabled().

ilCalendarSettings::$instance = null
staticprivate

Definition at line 43 of file class.ilCalendarSettings.php.

Referenced by _getInstance().

ilCalendarSettings::$storage = null
private

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

ilCalendarSettings::$time_format = null
private

Definition at line 48 of file class.ilCalendarSettings.php.

Referenced by getDefaultTimeFormat().

ilCalendarSettings::$timezone = null
private

Definition at line 47 of file class.ilCalendarSettings.php.

Referenced by getDefaultTimeZone().

ilCalendarSettings::$week_start = 0
private

Definition at line 49 of file class.ilCalendarSettings.php.

Referenced by getDefaultWeekStart().

const ilCalendarSettings::WEEK_START_MONDAY = 1

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

const ilCalendarSettings::WEEK_START_SUNDAY = 0

Definition at line 38 of file class.ilCalendarSettings.php.


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