本文整理汇总了PHP中ilFormSectionHeaderGUI::setInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP ilFormSectionHeaderGUI::setInfo方法的具体用法?PHP ilFormSectionHeaderGUI::setInfo怎么用?PHP ilFormSectionHeaderGUI::setInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilFormSectionHeaderGUI
的用法示例。
在下文中一共展示了ilFormSectionHeaderGUI::setInfo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addToForm
public function addToForm()
{
if ($this->getTitle()) {
$section = new ilFormSectionHeaderGUI();
$section->setTitle($this->getTitle());
if ($this->getInfo()) {
$section->setInfo($this->getInfo());
}
$this->getForm()->addItem($section);
}
$this->prepareElements();
foreach ($this->elements as $element) {
$element->addToForm();
}
}
示例2: parseSearch
/**
* Parse search
*/
private function parseSearch()
{
// this is NOT used for the global search, see ilLuceneAdvancedSearchFields::getFormElement()
// (so searchable flag is NOT relevant)
//
// current usage: wiki page element "[amd] page list"
$this->lng->loadLanguageModule('search');
include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php';
include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php';
if ($this->getSelectedOnly()) {
$recs = ilAdvancedMDRecord::_getSelectedRecordsByObject($this->obj_type, $this->obj_id, $this->sub_type);
} else {
$recs = ilAdvancedMDRecord::_getActivatedRecordsByObjectType($this->obj_type, $this->sub_type);
}
$this->search_form = array();
foreach ($recs as $record) {
$section = new ilFormSectionHeaderGUI();
$section->setTitle($record->getTitle());
$section->setInfo($record->getDescription());
$this->form->addItem($section);
foreach (ilAdvancedMDFieldDefinition::getInstancesByRecordId($record->getRecordId(), true) as $field) {
$field_form = ilADTFactory::getInstance()->getSearchBridgeForDefinitionInstance($field->getADTDefinition(), true, false);
$field_form->setForm($this->form);
$field_form->setElementId("advmd[" . $field->getFieldId() . "]");
$field_form->setTitle($field->getTitle());
if (is_array($this->search_form_values) && isset($this->search_form_values[$field->getFieldId()])) {
$field->setSearchValueSerialized($field_form, $this->search_form_values[$field->getFieldId()]);
}
$field->prepareElementForSearch($field_form);
$field_form->addToForm();
$this->search_form[$field->getFieldId()] = array("def" => $field, "value" => $field_form);
}
}
}
示例3: parseEditor
/**
* Parse property form in editor mode
*
* @access private
*
*/
private function parseEditor()
{
global $ilUser;
include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php';
foreach (ilAdvancedMDRecord::_getActivatedRecordsByObjectType($this->obj_type) as $record_obj) {
$section = new ilFormSectionHeaderGUI();
$section->setTitle($record_obj->getTitle());
$section->setInfo($record_obj->getDescription());
$this->form->addItem($section);
include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php';
foreach (ilAdvancedMDFieldDefinition::_getDefinitionsByRecordId($record_obj->getRecordId()) as $def) {
if ($this->handleECSDefinitions($def)) {
continue;
}
include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDValue.php';
$value = ilAdvancedMDValue::_getInstance($this->obj_id, $def->getFieldId());
switch ($def->getFieldType()) {
case ilAdvancedMDFieldDefinition::TYPE_TEXT:
$text = new ilTextInputGUI($def->getTitle(), 'md[' . $def->getFieldId() . ']');
$text->setValue($value->getValue());
$text->setSize(40);
$text->setMaxLength(512);
$text->setDisabled($value->isDisabled());
$text->setInfo($def->getDescription());
$this->form->addItem($text);
break;
case ilAdvancedMDFieldDefinition::TYPE_SELECT:
$select = new ilSelectInputGUI($def->getTitle(), 'md[' . $def->getFieldId() . ']');
$select->setOptions($def->getFieldValuesForSelect());
$select->setValue($value->getValue());
$select->setDisabled($value->isDisabled());
$select->setInfo($def->getDescription());
$this->form->addItem($select);
break;
case ilAdvancedMDFieldDefinition::TYPE_DATE:
$unixtime = $value->getValue() ? $value->getValue() : mktime(8, 0, 0, date('m'), date('d'), date('Y'));
$time = new ilDateTimeInputGUI($def->getTitle(), 'md[' . $def->getFieldId() . ']');
$time->setShowTime(false);
$time->setDate(new ilDate($unixtime, IL_CAL_UNIX));
$time->enableDateActivation($this->lng->txt('enabled'), 'md_activated[' . $def->getFieldId() . ']', $value->getValue() ? true : false);
$time->setDisabled($value->isDisabled());
$time->setInfo($def->getDescription());
$this->form->addItem($time);
break;
case ilAdvancedMDFieldDefinition::TYPE_DATETIME:
$unixtime = $value->getValue() ? $value->getValue() : mktime(8, 0, 0, date('m'), date('d'), date('Y'));
$time = new ilDateTimeInputGUI($def->getTitle(), 'md[' . $def->getFieldId() . ']');
$time->setShowTime(true);
$time->setDate(new ilDateTime($unixtime, IL_CAL_UNIX, $ilUser->getTimeZone()));
$time->enableDateActivation($this->lng->txt('enabled'), 'md_activated[' . $def->getFieldId() . ']', $value->getValue() ? true : false);
$time->setDisabled($value->isDisabled());
$this->form->addItem($time);
break;
}
}
}
}