ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilCalendarUserSettingsGUI Class Reference
+ Collaboration diagram for ilCalendarUserSettingsGUI:

Public Member Functions

 __construct ()
 Constructor.
 executeCommand ()
 Execute command.
 show ()
 show settings
 cancel ()
 cancel editing
 save ()
 save settings
 initSettingsForm ()
 show settings table

Protected Attributes

 $tpl
 $lng
 $user
 $settings

Detailed Description

Constructor & Destructor Documentation

ilCalendarUserSettingsGUI::__construct ( )

Constructor.

public

Parameters

Definition at line 52 of file class.ilCalendarUserSettingsGUI.php.

References $ilCtrl, $lng, $tpl, ilCalendarSettings\_getInstance(), and ilCalendarUserSettings\_getInstanceByUserId().

{
global $ilUser,$tpl,$lng,$ilCtrl;
$this->tpl = $tpl;
$this->lng = $lng;
$this->lng->loadLanguageModule('dateplaner');
$this->lng->loadLanguageModule('jscalendar');
$this->ctrl = $ilCtrl;
$this->user = $ilUser;
$this->settings = ilCalendarSettings::_getInstance();
$this->user_settings = ilCalendarUserSettings::_getInstanceByUserId($this->user->getId());
}

+ Here is the call graph for this function:

Member Function Documentation

ilCalendarUserSettingsGUI::cancel ( )

cancel editing

public

Definition at line 113 of file class.ilCalendarUserSettingsGUI.php.

{
$this->ctrl->returnToParent($this);
}
ilCalendarUserSettingsGUI::executeCommand ( )

Execute command.

public

Definition at line 76 of file class.ilCalendarUserSettingsGUI.php.

References $cmd, and $ilSetting.

{
global $ilUser, $ilSetting;
$next_class = $this->ctrl->getNextClass();
switch($next_class)
{
default:
$cmd = $this->ctrl->getCmd("show");
$this->$cmd();
break;
}
return true;
}
ilCalendarUserSettingsGUI::initSettingsForm ( )

show settings table

public

Returns

Definition at line 141 of file class.ilCalendarUserSettingsGUI.php.

References ilCalendarUtil\_getShortTimeZoneList(), ilSelectInputGUI\setOptions(), ilRadioGroupInputGUI\setValue(), ilCalendarSettings\TIME_FORMAT_12, and ilCalendarSettings\TIME_FORMAT_24.

Referenced by show().

{
if(is_object($this->form))
{
return true;
}
include_once('Services/Calendar/classes/class.ilCalendarUtil.php');
include_once('Services/Form/classes/class.ilPropertyFormGUI.php');
$this->form = new ilPropertyFormGUI();
$this->form->setFormAction($this->ctrl->getFormAction($this,'save'));
$this->form->setTitle($this->lng->txt('cal_user_settings'));
$this->form->addCommandButton('save',$this->lng->txt('save'));
$this->form->addCommandButton('cancel',$this->lng->txt('cancel'));
$select = new ilSelectInputGUI($this->lng->txt('cal_user_timezone'),'timezone');
$select->setInfo($this->lng->txt('cal_timezone_info'));
$select->setValue($this->user_settings->getTimeZone());
$this->form->addItem($select);
$select = new ilSelectInputGUI($this->lng->txt('cal_user_time_format'),'time_format');
$select->setOptions(array(
$select->setInfo($this->lng->txt('cal_time_format_info'));
$select->setValue($this->user_settings->getTimeFormat());
$this->form->addItem($select);
$radio = new ilRadioGroupInputGUI($this->lng->txt('cal_week_start'),'weekstart');
$radio->setValue($this->user_settings->getWeekStart());
$option = new ilRadioOption($this->lng->txt('l_su'),0);
$radio->addOption($option);
$option = new ilRadioOption($this->lng->txt('l_mo'),1);
$radio->addOption($option);
$this->form->addItem($radio);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilCalendarUserSettingsGUI::save ( )

save settings

public

Returns

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

References ilUtil\sendInfo().

{
$this->user_settings->setTimeZone($_POST['timezone']);
$this->user_settings->setWeekStart((int) $_POST['weekstart']);
$this->user_settings->setTimeFormat((int) $_POST['time_format']);
$this->user_settings->save();
ilUtil::sendInfo($this->lng->txt('settings_saved'),true);
$this->ctrl->returnToParent($this);
}

+ Here is the call graph for this function:

ilCalendarUserSettingsGUI::show ( )

show settings

public

Parameters
@return

Definition at line 100 of file class.ilCalendarUserSettingsGUI.php.

References initSettingsForm().

{
$this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.user_settings.html','Services/Calendar');
$this->initSettingsForm();
$this->tpl->setVariable('CAL_SETTINGS',$this->form->getHTML());
}

+ Here is the call graph for this function:

Field Documentation

ilCalendarUserSettingsGUI::$lng
protected

Definition at line 40 of file class.ilCalendarUserSettingsGUI.php.

Referenced by __construct().

ilCalendarUserSettingsGUI::$settings
protected

Definition at line 42 of file class.ilCalendarUserSettingsGUI.php.

ilCalendarUserSettingsGUI::$tpl
protected

Definition at line 39 of file class.ilCalendarUserSettingsGUI.php.

Referenced by __construct().

ilCalendarUserSettingsGUI::$user
protected

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


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