本文整理汇总了PHP中ilDateTimeInputGUI::setDisabled方法的典型用法代码示例。如果您正苦于以下问题:PHP ilDateTimeInputGUI::setDisabled方法的具体用法?PHP ilDateTimeInputGUI::setDisabled怎么用?PHP ilDateTimeInputGUI::setDisabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilDateTimeInputGUI
的用法示例。
在下文中一共展示了ilDateTimeInputGUI::setDisabled方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addCustomEditForm
protected function addCustomEditForm(ilPropertyFormGUI $a_form)
{
$radio_grp = new ilRadioGroupInputGUI($this->lng->txt('grp_visibility'), 'activation_type');
$radio_grp->setValue($this->object->getAvailabilityType());
$radio_grp->setDisabled(true);
$radio_opt = new ilRadioOption($this->lng->txt('grp_visibility_unvisible'), ilObjRemoteTest::ACTIVATION_OFFLINE);
$radio_grp->addOption($radio_opt);
$radio_opt = new ilRadioOption($this->lng->txt('grp_visibility_limitless'), ilObjRemoteTest::ACTIVATION_UNLIMITED);
$radio_grp->addOption($radio_opt);
// :TODO: not supported in ECS yet
$radio_opt = new ilRadioOption($this->lng->txt('grp_visibility_until'), ilObjRemoteTest::ACTIVATION_LIMITED);
$start = new ilDateTimeInputGUI($this->lng->txt('grp_start'), 'start');
$start->setDate(new ilDateTime(time(), IL_CAL_UNIX));
$start->setDisabled(true);
$start->setShowTime(true);
$radio_opt->addSubItem($start);
$end = new ilDateTimeInputGUI($this->lng->txt('grp_end'), 'end');
$end->setDate(new ilDateTime(time(), IL_CAL_UNIX));
$end->setDisabled(true);
$end->setShowTime(true);
$radio_opt->addSubItem($end);
$radio_grp->addOption($radio_opt);
$a_form->addItem($radio_grp);
}
示例2: createAndSetDateTimeInput
/**
* Generate and set date time input field
*
* @param string $a_title
* @param string $a_postvar
* @param string $a_date in the format YYYY-MM-DD HH:MM:SS
*
* @return \ilDateTimeInputGUI
*/
private function createAndSetDateTimeInput($a_title, $a_postvar, $a_date)
{
$date_time_input = new ilDateTimeInputGUI($a_title, $a_postvar);
if (isset($a_date)) {
$date_time_input->setDate(new ilDateTime($a_date, IL_CAL_DATETIME));
}
$date_time_input->setMinuteStepSize(5);
$date_time_input->setShowTime(true);
if ($this->mode == 'show') {
$date_time_input->setDisabled(true);
}
return $date_time_input;
}
示例3: showECSStart
/**
* Show special form for ecs start
*
* @access private
* @param object ilAdvMDFieldDefinition
*/
private function showECSStart($def)
{
global $ilUser;
$this->lng->loadLanguageModule('ecs');
include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDValue.php';
$value_start = ilAdvancedMDValue::_getInstance($this->obj_id, $def->getFieldId());
$unixtime = $value_start->getValue() ? $value_start->getValue() : mktime(8, 0, 0, date('m'), date('d'), date('Y'));
$time = new ilDateTimeInputGUI($this->lng->txt('ecs_event_appointment'), 'md[' . $def->getFieldId() . ']');
$time->setShowTime(true);
$time->setDate(new ilDateTime($unixtime, IL_CAL_UNIX));
$time->enableDateActivation($this->lng->txt('enabled'), 'md_activated[' . $def->getFieldId() . ']', $value_start->getValue() ? true : false);
$time->setDisabled($value_start->isDisabled());
$mapping = ilECSDataMappingSettings::_getInstance();
if ($field_id = $mapping->getMappingByECSName('end')) {
$value_end = ilAdvancedMDValue::_getInstance($this->obj_id, $field_id);
list($hours, $minutes) = $this->parseDuration($value_start->getValue(), $value_end->getValue());
$duration = new ilDurationInputGUI($this->lng->txt('ecs_duration'), 'ecs_duration');
$duration->setHours($hours);
$duration->setMinutes($minutes);
#$duration->setInfo($this->lng->txt('ecs_duration_info'));
$duration->setShowHours(true);
$duration->setShowMinutes(true);
$time->addSubItem($duration);
}
if ($field_id = $mapping->getMappingByECSName('cycle')) {
$value = ilAdvancedMDValue::_getInstance($this->obj_id, $field_id);
$cycle_def = ilAdvancedMDFieldDefinition::getInstance($field_id);
switch ($cycle_def->getFieldType()) {
case ilAdvancedMDFieldDefinition::TYPE_TEXT:
$text = new ilTextInputGUI($cycle_def->getTitle(), 'md[' . $cycle_def->getFieldId() . ']');
$text->setValue($value->getValue());
$text->setSize(20);
$text->setMaxLength(512);
$text->setDisabled($value->isDisabled());
$time->addSubItem($text);
break;
case ilAdvancedMDFieldDefinition::TYPE_SELECT:
$select = new ilSelectInputGUI($cycle_def->getTitle(), 'md[' . $cycle_def->getFieldId() . ']');
$select->setOptions($cycle_def->getFieldValuesForSelect());
$select->setValue($value->getValue());
$select->setDisabled($value->isDisabled());
$time->addSubItem($select);
break;
}
}
if ($field_id = $mapping->getMappingByECSName('room')) {
$value = ilAdvancedMDValue::_getInstance($this->obj_id, $field_id);
$room_def = ilAdvancedMDFieldDefinition::getInstance($field_id);
switch ($room_def->getFieldType()) {
case ilAdvancedMDFieldDefinition::TYPE_TEXT:
$text = new ilTextInputGUI($room_def->getTitle(), 'md[' . $room_def->getFieldId() . ']');
$text->setValue($value->getValue());
$text->setSize(20);
$text->setMaxLength(512);
$text->setDisabled($value->isDisabled());
$time->addSubItem($text);
break;
case ilAdvancedMDFieldDefinition::TYPE_SELECT:
$select = new ilSelectInputGUI($room_def->getTitle(), 'md[' . $room_def->getFieldId() . ']');
$select->setOptions($cycle_def->getFieldValuesForSelect());
$select->setValue($value->getValue());
$select->setDisabled($value->isDisabled());
$time->addSubItem($select);
break;
}
}
$this->form->addItem($time);
}