当前位置: 首页>>代码示例>>PHP>>正文


PHP ilDateTimeInputGUI::addSubItem方法代码示例

本文整理汇总了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);
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:74,代码来源:class.ilAdvancedMDRecordGUI.php


注:本文中的ilDateTimeInputGUI::addSubItem方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。