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


PHP ilTextInputGUI::addSubItem方法代码示例

本文整理汇总了PHP中ilTextInputGUI::addSubItem方法的典型用法代码示例。如果您正苦于以下问题:PHP ilTextInputGUI::addSubItem方法的具体用法?PHP ilTextInputGUI::addSubItem怎么用?PHP ilTextInputGUI::addSubItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ilTextInputGUI的用法示例。


在下文中一共展示了ilTextInputGUI::addSubItem方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: parseSearch

 /**
  * Parse search 
  *
  * @access private
  * @param
  * 
  */
 private function parseSearch()
 {
     include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php';
     foreach (ilAdvancedMDRecord::_getActiveSearchableRecords() as $record) {
         $section = new ilFormSectionHeaderGUI();
         $section->setTitle($record->getTitle());
         $this->form->addItem($section);
         foreach (ilAdvancedMDFieldDefinition::_getDefinitionsByRecordId($record->getRecordId()) as $field) {
             if (!$field->isSearchable()) {
                 continue;
             }
             switch ($field->getFieldType()) {
                 case ilAdvancedMDFieldDefinition::TYPE_TEXT:
                     $group = new ilRadioGroupInputGUI('', 'boolean[' . $field->getFieldId() . ']');
                     $group->setValue(isset($this->search_values['boolean'][$field->getFieldId()]) ? $this->search_values['boolean'][$field->getFieldId()] : 0);
                     $radio_option = new ilRadioOption($this->lng->txt("search_any_word"), 0);
                     $radio_option->setValue(0);
                     $group->addOption($radio_option);
                     $radio_option = new ilRadioOption($this->lng->txt("search_all_words"), 1);
                     $radio_option->setValue(1);
                     $group->addOption($radio_option);
                     $text = new ilTextInputGUI($field->getTitle(), $field->getFieldId());
                     $text->setValue(isset($this->search_values[$field->getFieldId()]) ? $this->search_values[$field->getFieldId()] : '');
                     $text->setSize(30);
                     $text->setMaxLength(255);
                     $text->addSubItem($group);
                     $this->form->addItem($text);
                     break;
                 case ilAdvancedMDFieldDefinition::TYPE_SELECT:
                     $select = new ilSelectInputGUI($field->getTitle(), $field->getFieldId());
                     $select->setValue(isset($this->search_values[$field->getFieldId()]) ? $this->search_values[$field->getFieldId()] : 0);
                     $options = array(0 => $this->lng->txt('search_any'));
                     $counter = 1;
                     foreach ($field->getFieldValues() as $key => $value) {
                         $options[$counter++] = $value;
                     }
                     $select->setOptions($options);
                     $this->form->addItem($select);
                     break;
                 case ilAdvancedMDFieldDefinition::TYPE_DATETIME:
                 case ilAdvancedMDFieldDefinition::TYPE_DATE:
                     $check = new ilCheckboxInputGUI($field->getTitle(), $field->getFieldId());
                     $check->setValue(1);
                     $check->setChecked(isset($this->search_values[$field->getFieldId()]) ? $this->search_values[$field->getFieldId()] : 0);
                     $time = new ilDateTimeInputGUI($this->lng->txt('from'), 'date_start[' . $field->getFieldId() . ']');
                     if ($field->getFieldType() == ilAdvancedMDFieldDefinition::TYPE_DATE) {
                         $time->setShowTime(false);
                     } else {
                         $time->setShowTime(true);
                     }
                     if (isset($this->search_values['date_start'][$field->getFieldId()]) and 0) {
                         #$time->setUnixTime($this->toUnixTime($this->search_values['date_start'][$field->getFieldId()]['date'],$this->search_values['date_start'][$field->getFieldId()]['time']));
                     } else {
                         $time->setDate(new ilDateTime(mktime(8, 0, 0, date('m'), date('d'), date('Y')), IL_CAL_UNIX));
                     }
                     $check->addSubItem($time);
                     $time = new ilDateTimeInputGUI($this->lng->txt('until'), 'date_end[' . $field->getFieldId() . ']');
                     if ($field->getFieldType() == ilAdvancedMDFieldDefinition::TYPE_DATE) {
                         $time->setShowTime(false);
                     } else {
                         $time->setShowTime(true);
                     }
                     if (isset($this->search_values['date_end'][$field->getFieldId()]) and 0) {
                         #$time->setUnixTime($this->toUnixTime($this->search_values['date_end'][$field->getFieldId()]['date'],$this->search_values['date_end'][$field->getFieldId()]['time']));
                     } else {
                         $time->setDate(new ilDateTime(mktime(16, 0, 0, date('m'), date('d'), date('Y')), IL_CAL_UNIX));
                     }
                     $check->addSubItem($time);
                     $this->form->addItem($check);
                     break;
             }
         }
     }
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:81,代码来源:class.ilAdvancedMDRecordGUI.php

示例2: initAdvancedMetaDataForm

 /**
  * 
  *
  * @access protected
  */
 protected function initAdvancedMetaDataForm()
 {
     if (is_object($this->form)) {
         return $this->form;
     }
     include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php';
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $this->form = new ilPropertyFormGUI();
     $this->form->setFormAction($this->ctrl->getFormAction($this, 'performAdvMDSearch'));
     $this->form->setTitle($this->lng->txt('adv_md_search_title'));
     $this->form->addCommandButton('performAdvMDSearch', $this->lng->txt('search'));
     #$this->form->setSubformMode('right');
     $content = new ilTextInputGUI($this->lng->txt('meta_title') . '/' . $this->lng->txt('meta_keyword') . '/' . $this->lng->txt('meta_description'), 'title');
     $content->setValue($this->options['title']);
     $content->setSize(30);
     $content->setMaxLength(255);
     //		$content->setSubformMode('right');
     $group = new ilRadioGroupInputGUI('', 'title_ao');
     $group->setValue($this->options['title_ao']);
     $radio_option = new ilRadioOption($this->lng->txt("search_any_word"), 0);
     $group->addOption($radio_option);
     $radio_option = new ilRadioOption($this->lng->txt("search_all_words"), 1);
     $group->addOption($radio_option);
     $content->addSubItem($group);
     $this->form->addItem($content);
     $type = new ilSelectInputGUI($this->lng->txt('type'), 'type');
     $options['adv_all'] = $this->lng->txt('search_any');
     foreach (ilAdvancedMDRecord::_getActivatedObjTypes() as $obj_type) {
         $options[$obj_type] = $this->lng->txt('objs_' . $obj_type);
     }
     $type->setOptions($options);
     $type->setValue($this->options['type']);
     $this->form->addItem($type);
     include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php';
     $record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_SEARCH);
     $record_gui->setPropertyForm($this->form);
     $record_gui->setSearchValues($this->options);
     $record_gui->parse();
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:44,代码来源:class.ilAdvancedSearchGUI.php


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