本文整理汇总了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;
}
}
}
}
示例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();
}