本文整理汇总了PHP中ilDateTimeInputGUI::setStartYear方法的典型用法代码示例。如果您正苦于以下问题:PHP ilDateTimeInputGUI::setStartYear方法的具体用法?PHP ilDateTimeInputGUI::setStartYear怎么用?PHP ilDateTimeInputGUI::setStartYear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilDateTimeInputGUI
的用法示例。
在下文中一共展示了ilDateTimeInputGUI::setStartYear方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getInputField
/**
* @param $type_id
* @param ilDataCollectionField $field
* @return ilCheckboxInputGUI|ilDateTimeInputGUI|ilFileInputGUI|ilTextInputGUI|NULL
*/
static function getInputField(ilDataCollectionField $field)
{
global $lng;
$type_id = $field->getDatatypeId();
$title = $field->getTitle();
switch ($type_id) {
case ilDataCollectionDatatype::INPUTFORMAT_TEXT:
$input = new ilTextInputGUI($title, 'field_' . $field->getId());
if ($field->getTextArea()) {
$input = new ilTextAreaInputGUI($title, 'field_' . $field->getId());
}
if ($field->getLength()) {
$input->setInfo($lng->txt("dcl_max_text_length") . ": " . $field->getLength());
if (!$field->getTextArea()) {
$input->setMaxLength($field->getLength());
}
}
break;
case ilDataCollectionDatatype::INPUTFORMAT_NUMBER:
$input = new ilTextInputGUI($title, 'field_' . $field->getId());
break;
case ilDataCollectionDatatype::INPUTFORMAT_BOOLEAN:
$input = new ilCheckboxInputGUI($title, 'field_' . $field->getId());
break;
case ilDataCollectionDatatype::INPUTFORMAT_DATETIME:
$input = new ilDateTimeInputGUI($title, 'field_' . $field->getId());
$input->setStartYear(date("Y") - 100);
break;
case ilDataCollectionDatatype::INPUTFORMAT_FILE:
$input = new ilFileInputGUI($title, 'field_' . $field->getId());
break;
case ilDataCollectionDatatype::INPUTFORMAT_REFERENCE:
if (!$field->isNRef()) {
$input = new ilSelectInputGUI($title, 'field_' . $field->getId());
} else {
$input = new ilMultiSelectInputGUI($title, 'field_' . $field->getId());
}
break;
case ilDataCollectionDatatype::INPUTFORMAT_RATING:
$input = new ilTextInputGUI($title, 'field_' . $field->getId());
$input->setValue($lng->txt("dcl_editable_in_table_gui"));
$input->setDisabled(true);
break;
case ilDataCollectionDatatype::INPUTFORMAT_ILIAS_REF:
$input = new ilDataCollectionTreePickInputGUI($title, 'field_' . $field->getId());
break;
case ilDataCollectionDatatype::INPUTFORMAT_MOB:
$input = new ilImageFileInputGUI($title, 'field_' . $field->getId());
$input->setAllowDeletion(true);
break;
}
if ($field->getDescription()) {
$input->setInfo($field->getDescription() . ($input->getInfo() ? "<br>" . $input->getInfo() : ""));
}
return $input;
}