本文整理汇总了PHP中ilDateTimeInputGUI::addSubItem方法的典型用法代码示例。如果您正苦于以下问题:PHP ilDateTimeInputGUI::addSubItem方法的具体用法?PHP ilDateTimeInputGUI::addSubItem怎么用?PHP ilDateTimeInputGUI::addSubItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilDateTimeInputGUI
的用法示例。
在下文中一共展示了ilDateTimeInputGUI::addSubItem方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
}