ILIAS  Release_4_1_x_branch Revision 61804
 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 51 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 112 of file class.ilCalendarUserSettingsGUI.php.

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

Execute command.

public

Definition at line 75 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 152 of file class.ilCalendarUserSettingsGUI.php.

References ilCalendarUtil\_getShortTimeZoneList(), ilCalendarSettings\DATE_FORMAT_DMY, ilCalendarSettings\DATE_FORMAT_MDY, ilCalendarSettings\DATE_FORMAT_YMD, ilCalendarUtil\getHourSelection(), 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);
$year = date("Y");
$select = new ilSelectInputGUI($this->lng->txt('cal_user_date_format'),'date_format');
$select->setOptions(array(
$select->setInfo($this->lng->txt('cal_date_format_info'));
$select->setValue($this->user_settings->getDateFormat());
$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);
// Week/Month View
$week_month = new ilFormSectionHeaderGUI();
$week_month->setTitle($this->lng->txt('cal_week_month_view'));
$this->form->addItem($week_month);
$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);
// Day/Week View
$week_month = new ilFormSectionHeaderGUI();
$week_month->setTitle($this->lng->txt('cal_day_week_view'));
$this->form->addItem($week_month);
$day_start = new ilSelectInputGUI($this->lng->txt('cal_day_start'),'dst');
$day_start->setOptions(
ilCalendarUtil::getHourSelection($this->user_settings->getTimeFormat())
);
$day_start->setValue($this->user_settings->getDayStart());
$this->form->addItem($day_start);
$day_end = new ilSelectInputGUI($this->lng->txt('cal_day_end'),'den');
$day_end->setOptions(
ilCalendarUtil::getHourSelection($this->user_settings->getTimeFormat())
);
$day_end->setValue($this->user_settings->getDayEnd());
$this->form->addItem($day_end);
}

+ 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 123 of file class.ilCalendarUserSettingsGUI.php.

References $_POST, ilUtil\sendFailure(), ilUtil\sendSuccess(), and show().

{
$this->user_settings->setTimeZone($_POST['timezone']);
$this->user_settings->setWeekStart((int) $_POST['weekstart']);
$this->user_settings->setDateFormat((int) $_POST['date_format']);
$this->user_settings->setTimeFormat((int) $_POST['time_format']);
$this->user_settings->setDayStart((int) $_POST['dst']);
$this->user_settings->setDayEnd((int) $_POST['den']);
if(((int) $_POST['den']) < (int) $_POST['dst'])
{
ilUtil::sendFailure($this->lng->txt('cal_dstart_dend_warn'));
$this->show();
return false;
}
$this->user_settings->save();
ilUtil::sendSuccess($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 99 of file class.ilCalendarUserSettingsGUI.php.

References initSettingsForm().

Referenced by save().

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

+ Here is the caller graph for this function:

Field Documentation

ilCalendarUserSettingsGUI::$lng
protected

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

Referenced by __construct().

ilCalendarUserSettingsGUI::$settings
protected

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

ilCalendarUserSettingsGUI::$tpl
protected

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

Referenced by __construct().

ilCalendarUserSettingsGUI::$user
protected

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


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