本文整理汇总了PHP中ilFileInputGUI::setAllowDeletion方法的典型用法代码示例。如果您正苦于以下问题:PHP ilFileInputGUI::setAllowDeletion方法的具体用法?PHP ilFileInputGUI::setAllowDeletion怎么用?PHP ilFileInputGUI::setAllowDeletion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilFileInputGUI
的用法示例。
在下文中一共展示了ilFileInputGUI::setAllowDeletion方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initNewAccountMailForm
protected function initNewAccountMailForm()
{
global $lng, $ilCtrl;
$lng->loadLanguageModule("meta");
$lng->loadLanguageModule("mail");
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($ilCtrl->getFormAction($this));
$form->setTitleIcon(ilUtil::getImagePath("icon_mail.png"));
$form->setTitle($lng->txt("user_new_account_mail"));
$form->setDescription($lng->txt("user_new_account_mail_desc"));
$langs = $lng->getInstalledLanguages();
foreach ($langs as $lang_key) {
$amail = $this->object->_lookupNewAccountMail($lang_key);
$title = $lng->txt("meta_l_" . $lang_key);
if ($lang_key == $lng->getDefaultLanguage()) {
$title .= " (" . $lng->txt("default") . ")";
}
$header = new ilFormSectionHeaderGUI();
$header->setTitle($title);
$form->addItem($header);
$subj = new ilTextInputGUI($lng->txt("subject"), "subject_" . $lang_key);
// $subj->setRequired(true);
$subj->setValue($amail["subject"]);
$form->addItem($subj);
$salg = new ilTextInputGUI($lng->txt("mail_salutation_general"), "sal_g_" . $lang_key);
// $salg->setRequired(true);
$salg->setValue($amail["sal_g"]);
$form->addItem($salg);
$salf = new ilTextInputGUI($lng->txt("mail_salutation_female"), "sal_f_" . $lang_key);
// $salf->setRequired(true);
$salf->setValue($amail["sal_f"]);
$form->addItem($salf);
$salm = new ilTextInputGUI($lng->txt("mail_salutation_male"), "sal_m_" . $lang_key);
// $salm->setRequired(true);
$salm->setValue($amail["sal_m"]);
$form->addItem($salm);
$body = new ilTextAreaInputGUI($lng->txt("message_content"), "body_" . $lang_key);
// $body->setRequired(true);
$body->setValue($amail["body"]);
$body->setRows(10);
$body->setCols(100);
$form->addItem($body);
$att = new ilFileInputGUI($lng->txt("attachment"), "att_" . $lang_key);
$att->setAllowDeletion(true);
if ($amail["att_file"]) {
$att->setValue($amail["att_file"]);
}
$form->addItem($att);
}
$form->addCommandButton("saveNewAccountMail", $lng->txt("save"));
$form->addCommandButton("cancelNewAccountMail", $lng->txt("cancel"));
return $form;
}
示例2: getInputField
/**
* @param ilDataCollectionField $field
*
* @return ilCheckboxInputGUI|ilDateTimeInputGUI|ilFileInputGUI|ilTextInputGUI|NULL
*/
static function getInputField(ilDataCollectionField $field)
{
global $lng;
$type_id = $field->getDatatypeId();
$title = $field->getTitle();
$input = NULL;
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 ilDclCheckboxInputGUI($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 ilFileInputGUI($title, 'field_' . $field->getId());
$input->setSuffixes(self::$mob_suffixes);
$input->setAllowDeletion(true);
break;
case ilDataCollectionDatatype::INPUTFORMAT_FORMULA:
$input = new ilNonEditableValueGUI($title, 'field_' . $field->getId());
$input->setValue('-');
break;
}
if ($field->getDescription() && $input !== NULL) {
$input->setInfo($field->getDescription() . ($input->getInfo() ? "<br>" . $input->getInfo() : ""));
}
return $input;
}