本文整理汇总了PHP中ilTextInputGUI::setMulti方法的典型用法代码示例。如果您正苦于以下问题:PHP ilTextInputGUI::setMulti方法的具体用法?PHP ilTextInputGUI::setMulti怎么用?PHP ilTextInputGUI::setMulti使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilTextInputGUI
的用法示例。
在下文中一共展示了ilTextInputGUI::setMulti方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addToForm
public function addToForm()
{
$text = new ilTextInputGUI($this->getTitle(), $this->getElementId());
$text->setMulti(true);
$this->addBasicFieldProperties($text, $this->getADT()->getCopyOfDefinition());
$text->setValue($this->getADT()->getTextElements());
$this->addToParentElement($text);
}
示例2: initPropertiesForm
//.........这里部分代码省略.........
$txt = implode("<br />", $txt);
$participantdatainfo = new ilNonEditableValueGUI($this->lng->txt("mailparticipantdata_placeholder"), "", true);
$participantdatainfo->setValue($txt);
$mailnotification->addSubItem($mailaddresses);
$mailnotification->addSubItem($participantdata);
$mailnotification->addSubItem($participantdatainfo);
$form->addItem($mailnotification);
// tutor notification - currently not available for 360°
if (!$this->object->get360Mode()) {
// parent course?
global $tree;
$has_parent = $tree->checkForParentType($this->object->getRefId(), "grp");
if (!$has_parent) {
$has_parent = $tree->checkForParentType($this->object->getRefId(), "crs");
}
$num_inv = sizeof($this->object->getInvitedUsers());
// notification
$tut = new ilCheckboxInputGUI($this->lng->txt("survey_notification_tutor_setting"), "tut");
$tut->setChecked($this->object->getTutorNotificationStatus());
$form->addItem($tut);
$tut_logins = array();
$tuts = $this->object->getTutorNotificationRecipients();
if ($tuts) {
foreach ($tuts as $tut_id) {
$tmp = ilObjUser::_lookupName($tut_id);
if ($tmp["login"]) {
$tut_logins[] = $tmp["login"];
}
}
}
$tut_ids = new ilTextInputGUI($this->lng->txt("survey_notification_tutor_recipients"), "tut_ids");
$tut_ids->setDataSource($this->ctrl->getLinkTarget($this, "doAutoComplete", "", true));
$tut_ids->setRequired(true);
$tut_ids->setMulti(true);
$tut_ids->setMultiValues($tut_logins);
$tut_ids->setValue(array_shift($tut_logins));
$tut->addSubItem($tut_ids);
$tut_grp = new ilRadioGroupInputGUI($this->lng->txt("survey_notification_target_group"), "tut_grp");
$tut_grp->setRequired(true);
$tut_grp->setValue($this->object->getTutorNotificationTarget());
$tut->addSubItem($tut_grp);
$tut_grp_crs = new ilRadioOption($this->lng->txt("survey_notification_target_group_parent_course"), ilObjSurvey::NOTIFICATION_PARENT_COURSE);
if (!$has_parent) {
$tut_grp_crs->setInfo($this->lng->txt("survey_notification_target_group_parent_course_inactive"));
}
$tut_grp->addOption($tut_grp_crs);
$tut_grp_inv = new ilRadioOption($this->lng->txt("survey_notification_target_group_invited"), ilObjSurvey::NOTIFICATION_INVITED_USERS);
$tut_grp_inv->setInfo(sprintf($this->lng->txt("survey_notification_target_group_invited_info"), $num_inv));
$tut_grp->addOption($tut_grp_inv);
}
// reminders
// reminder - currently not available for 360°
if (!$this->object->get360Mode()) {
$info = new ilFormSectionHeaderGUI();
$info->setTitle($this->lng->txt("svy_settings_section_reminders"));
$form->addItem($info);
$rmd = new ilCheckboxInputGUI($this->lng->txt("survey_reminder_setting"), "rmd");
$rmd->setChecked($this->object->getReminderStatus());
$form->addItem($rmd);
$rmd_start = new ilDateTimeInputGUI($this->lng->txt("survey_reminder_start"), "rmd_start");
$rmd_start->setRequired(true);
$start = $this->object->getReminderStart();
if ($start) {
$rmd_start->setDate($start);
}
$rmd->addSubItem($rmd_start);
示例3: initQuestionForm
protected function initQuestionForm($a_read_only = false)
{
global $lng, $ilCtrl;
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($ilCtrl->getFormAction($this, "saveQuestion"));
$form->setTitle($lng->txt("obj_poll"));
$question = new ilTextAreaInputGUI($lng->txt("poll_question"), "question");
$question->setRequired(true);
$question->setCols(40);
$question->setRows(2);
$question->setValue($this->object->getQuestion());
$question->setDisabled($a_read_only);
$form->addItem($question);
$dimensions = " (" . ilObjPoll::getImageSize() . "px)";
$img = new ilImageFileInputGUI($lng->txt("poll_image") . $dimensions, "image");
$img->setDisabled($a_read_only);
$form->addItem($img);
// show existing file
$file = $this->object->getImageFullPath(true);
if ($file) {
$img->setImage($file);
}
$anonymous = new ilRadioGroupInputGUI($lng->txt("poll_mode"), "mode");
$anonymous->setRequired(true);
$option = new ilRadioOption($lng->txt("poll_mode_anonymous"), 0);
$option->setInfo($lng->txt("poll_mode_anonymous_info"));
$anonymous->addOption($option);
$option = new ilRadioOption($lng->txt("poll_mode_personal"), 1);
$option->setInfo($lng->txt("poll_mode_personal_info"));
$anonymous->addOption($option);
$anonymous->setValue($this->object->getNonAnonymous());
$anonymous->setDisabled($a_read_only);
$form->addItem($anonymous);
$nanswers = new ilNumberInputGUI($lng->txt("poll_max_number_of_answers"), "nanswers");
$nanswers->setRequired(true);
$nanswers->setMinValue(1);
$nanswers->setSize(3);
$nanswers->setValue($this->object->getMaxNumberOfAnswers());
$nanswers->setDisabled($a_read_only);
$form->addItem($nanswers);
$answers = new ilTextInputGUI($lng->txt("poll_answers"), "answers");
$answers->setRequired(true);
$answers->setMulti(true, true);
$answers->setDisabled($a_read_only);
$form->addItem($answers);
$multi_answers = array();
foreach ($this->object->getAnswers() as $idx => $item) {
if (!$idx) {
$answers->setValue($item["answer"]);
}
$multi_answers[] = $item["answer"];
}
$answers->setMultiValues($multi_answers);
if (!$a_read_only) {
$form->addCommandButton("saveQuestion", $lng->txt("save"));
}
return $form;
}
示例4: initForm
/**
* Init form
*
* @param string $a_cmd
* @return ilPropertyFormGUI
*/
public function initForm($a_cmd = "")
{
global $ilCtrl, $lng;
$lng->loadLanguageModule('crs');
include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
$form->setFormAction($ilCtrl->getFormAction($this->parent_obj, $a_cmd));
$form->setTarget('_blank');
$form->setTitle($lng->txt('sess_gen_attendance_list'));
$title = new ilTextInputGUI($lng->txt('title'), 'title');
$title->setValue($this->title);
$form->addItem($title);
$desc = new ilTextInputGUI($lng->txt('description'), 'desc');
$desc->setValue($this->description);
$form->addItem($desc);
if (sizeof($this->presets)) {
$preset = new ilCheckboxGroupInputGUI($lng->txt('user_detail'), 'preset');
$preset_value = array();
foreach ($this->presets as $id => $item) {
$preset->addOption(new ilCheckboxOption($item[0], $id));
if ($item[1]) {
$preset_value[] = $id;
}
}
$preset->setValue($preset_value);
$form->addItem($preset);
}
$blank = new ilTextInputGUI($lng->txt('event_blank_columns'), 'blank');
$blank->setMulti(true);
$form->addItem($blank);
if ($this->pre_blanks) {
$blank->setValue($this->pre_blanks);
}
$part = new ilFormSectionHeaderGUI();
$part->setTitle($lng->txt('event_participant_selection'));
$form->addItem($part);
// Admins
$admin = new ilCheckboxInputGUI($lng->txt('event_tbl_admins'), 'show_admins');
$admin->setOptionTitle($lng->txt('event_inc_admins'));
$admin->setValue(1);
$form->addItem($admin);
// Tutors
$tutor = new ilCheckboxInputGUI($lng->txt('event_tbl_tutors'), 'show_tutors');
$tutor->setOptionTitle($lng->txt('event_inc_tutors'));
$tutor->setValue(1);
$form->addItem($tutor);
// Members
$member = new ilCheckboxInputGUI($lng->txt('event_tbl_members'), 'show_members');
$member->setOptionTitle($lng->txt('event_inc_members'));
$member->setValue(1);
$member->setChecked(true);
$form->addItem($member);
$form->addCommandButton($a_cmd, $lng->txt('sess_print_attendance_list'));
if ($this->id && $a_cmd) {
include_once "Services/User/classes/class.ilUserFormSettings.php";
$settings = new ilUserFormSettings($this->id);
$settings->exportToForm($form);
}
return $form;
}
示例5: initTagStyleForm
//.........这里部分代码省略.........
foreach ($avail_pars[$par] as $p) {
$options[$p] = $p;
}
$sel_input->setOptions($options);
$this->form_gui->addItem($sel_input);
break;
case "text":
$text_input = new ilTextInputGUI($lng->txt("sty_" . $var), $basepar);
$text_input->setMaxLength(200);
$text_input->setSize(20);
$this->form_gui->addItem($text_input);
break;
case "fontsize":
include_once "./Services/Style/classes/class.ilFontSizeInputGUI.php";
$fs_input = new ilFontSizeInputGUI($lng->txt("sty_" . $var), $basepar);
$this->form_gui->addItem($fs_input);
break;
case "numeric_no_perc":
case "numeric":
include_once "./Services/Style/classes/class.ilNumericStyleValueInputGUI.php";
$num_input = new ilNumericStyleValueInputGUI($lng->txt("sty_" . $var), $basepar);
if (ilObjStyleSheet::_getStyleParameterInputType($par) == "numeric_no_perc") {
$num_input->setAllowPercentage(false);
}
$this->form_gui->addItem($num_input);
break;
case "percentage":
$per_input = new ilNumberInputGUI($lng->txt("sty_" . $var), $basepar);
$per_input->setMinValue(0);
$per_input->setMaxValue(100);
$per_input->setMaxLength(3);
$per_input->setSize(3);
$this->form_gui->addItem($per_input);
break;
case "color":
//include_once("./Services/Style/classes/class.ilNumericStyleValueInputGUI.php");
$col_input = new ilColorPickerInputGUI($lng->txt("sty_" . $var), $basepar);
$col_input->setDefaultColor("");
$col_input->setAcceptNamedColors(true);
$this->form_gui->addItem($col_input);
break;
case "trbl_numeric":
include_once "./Services/Style/classes/class.ilTRBLNumericStyleValueInputGUI.php";
$num_input = new ilTRBLNumericStyleValueInputGUI($lng->txt("sty_" . $var), $basepar);
if (ilObjStyleSheet::_getStyleParameterInputType($par) == "trbl_numeric_no_perc") {
$num_input->setAllowPercentage(false);
}
$this->form_gui->addItem($num_input);
break;
case "border_width":
include_once "./Services/Style/classes/class.ilTRBLBorderWidthInputGUI.php";
$bw_input = new ilTRBLBorderWidthInputGUI($lng->txt("sty_" . $var), $basepar);
$this->form_gui->addItem($bw_input);
break;
case "border_style":
include_once "./Services/Style/classes/class.ilTRBLBorderStyleInputGUI.php";
$bw_input = new ilTRBLBorderStyleInputGUI($lng->txt("sty_" . $var), $basepar);
$this->form_gui->addItem($bw_input);
break;
case "trbl_color":
include_once "./Services/Style/classes/class.ilTRBLColorPickerInputGUI.php";
$col_input = new ilTRBLColorPickerInputGUI($lng->txt("sty_" . $var), $basepar);
$col_input->setAcceptNamedColors(true);
$this->form_gui->addItem($col_input);
break;
case "background_image":
include_once "./Services/Style/classes/class.ilBackgroundImageInputGUI.php";
$im_input = new ilBackgroundImageInputGUI($lng->txt("sty_" . $var), $basepar);
$imgs = array();
foreach ($this->object->getImages() as $entry) {
$imgs[] = $entry["entry"];
}
$im_input->setImages($imgs);
$this->form_gui->addItem($im_input);
break;
case "background_position":
include_once "./Services/Style/classes/class.ilBackgroundPositionInputGUI.php";
$im_input = new ilBackgroundPositionInputGUI($lng->txt("sty_" . $var), $basepar);
$this->form_gui->addItem($im_input);
break;
}
}
}
// custom parameters
$sh = new ilFormSectionHeaderGUI();
$sh->setTitle($lng->txt("sty_custom"));
$this->form_gui->addItem($sh);
// custom parameters
$ti = new ilTextInputGUI($this->lng->txt("sty_custom_par"), "custom_par");
$ti->setMaxLength(300);
$ti->setSize(80);
$ti->setMulti(true);
$ti->setInfo($this->lng->txt("sty_custom_par_info"));
$this->form_gui->addItem($ti);
// save and cancel commands
$this->form_gui->addCommandButton("updateTagStyle", $lng->txt("save_return"));
$this->form_gui->addCommandButton("refreshTagStyle", $lng->txt("save_refresh"));
// $this->form_gui->setTitle($lng->txt("edit"));
$this->form_gui->setFormAction($this->ctrl->getFormAction($this));
}
示例6: createAndSetParticipantsMultiTextInput
private function createAndSetParticipantsMultiTextInput($a_bookingData)
{
global $rssPermission;
$participants_input = new ilTextInputGUI($this->lng->txt("rep_robj_xrs_participants_list"), "participants");
$participants_input->setMulti(true);
$ajax_datasource = $this->ctrl->getLinkTarget($this, 'doUserAutoComplete', '', true);
$participants_input->setDataSource($ajax_datasource);
$participants_input->setInfo($this->getMaxRoomAllocationInfo());
if (!empty($a_bookingData[0])) {
$participants_input->setValue($a_bookingData[0]);
}
$participants_input->setMultiValues($a_bookingData);
if ($this->mode == 'show' || !$rssPermission->checkPrivilege(ilRoomSharingPrivilegesConstants::ADD_PARTICIPANTS)) {
$participants_input->setDisabled(true);
}
return $participants_input;
}
示例7: addStandardFieldsToForm
//.........这里部分代码省略.........
$ta = new ilTextAreaInputGUI($lng->txt($lv), "usr_" . $f);
if ($a_user) {
$ta->setValue($a_user->{$m}());
}
$ta->setRows($p["rows"]);
$ta->setCols($p["cols"]);
$ta->setRequired($ilSetting->get("require_" . $f));
if (!$ta->getRequired() || $ta->getValue()) {
$ta->setDisabled($ilSetting->get("usr_settings_disable_" . $f));
}
$a_form->addItem($ta);
}
break;
case "messenger":
if (ilUserProfile::userSettingVisible("instant_messengers")) {
$im_arr = $p["types"];
foreach ($im_arr as $im_name) {
$im = new ilTextInputGUI($lng->txt("im_" . $im_name), "usr_im_" . $im_name);
if ($a_user) {
$im->setValue($a_user->getInstantMessengerId($im_name));
}
$im->setMaxLength($p["maxlength"]);
$im->setSize($p["size"]);
$im->setRequired($ilSetting->get("require_" . "instant_messengers"));
if (!$im->getRequired() || $im->getValue()) {
$im->setDisabled($ilSetting->get("usr_settings_disable_" . "instant_messengers"));
}
$a_form->addItem($im);
}
}
break;
case "password":
if (self::$mode == self::MODE_REGISTRATION) {
if (!$registration_settings->passwordGenerationEnabled()) {
$ta = new ilPasswordInputGUI($lng->txt($lv), "usr_" . $f);
$ta->setRequired(true);
// $ta->setDisabled($ilSetting->get("usr_settings_disable_".$f));
} else {
$ta = new ilNonEditableValueGUI($lng->txt($lv));
$ta->setValue($lng->txt("reg_passwd_via_mail"));
}
$a_form->addItem($ta);
}
break;
case "language":
if (ilUserProfile::userSettingVisible($f)) {
$ta = new ilSelectInputGUI($lng->txt($lv), "usr_" . $f);
if ($a_user) {
$ta->setValue($a_user->{$m}());
}
$options = array();
$lng->loadLanguageModule("meta");
foreach ($lng->getInstalledLanguages() as $lang_key) {
$options[$lang_key] = $lng->txt("meta_l_" . $lang_key);
}
asort($options);
// #9728
$ta->setOptions($options);
$ta->setRequired($ilSetting->get("require_" . $f));
if (!$ta->getRequired() || $ta->getValue()) {
$ta->setDisabled($ilSetting->get("usr_settings_disable_" . $f));
}
$a_form->addItem($ta);
}
break;
case "multitext":
if (ilUserProfile::userSettingVisible($f)) {
$ti = new ilTextInputGUI($lng->txt($lv), "usr_" . $f);
$ti->setMulti(true);
if ($a_user) {
$ti->setValue($a_user->{$m}());
}
$ti->setMaxLength($p["maxlength"]);
$ti->setSize($p["size"]);
$ti->setRequired($ilSetting->get("require_" . $f));
if (!$ti->getRequired() || $ti->getValue()) {
$ti->setDisabled($ilSetting->get("usr_settings_disable_" . $f));
}
if ($this->ajax_href) {
// add field to ajax call
$ti->setDataSource($this->ajax_href . "&f=" . $f);
}
$a_form->addItem($ti);
}
break;
}
}
// append custom fields as "other"
if (is_array($custom_fields) && !$custom_fields_done) {
// add "other" subheader
if ($current_group != "other") {
$sh = new ilFormSectionHeaderGUI();
$sh->setTitle($lng->txt("other"));
$a_form->addItem($sh);
}
foreach ($custom_fields as $custom_field) {
$a_form->addItem($custom_field);
}
}
}
示例8: initKeywordsForm
protected function initKeywordsForm()
{
global $ilUser;
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this, "saveKeywordsForm"));
$form->setTitle($this->lng->txt("blog_edit_keywords"));
$txt = new ilTextInputGUI($this->lng->txt("blog_keywords"), "keywords");
// $txt->setRequired(true); #10504
$txt->setMulti(true);
$txt->setDataSource($this->ctrl->getLinkTarget($this, "keywordAutocomplete", "", true));
$txt->setMaxLength(200);
$txt->setSize(50);
$txt->setInfo($this->lng->txt("blog_keywords_info"));
$form->addItem($txt);
$md_section = $this->getBlogPosting()->getMDSection();
$keywords = array();
foreach ($ids = $md_section->getKeywordIds() as $id) {
$md_key = $md_section->getKeyword($id);
if (trim($md_key->getKeyword()) != "") {
$keywords[$md_key->getKeywordLanguageCode()][] = $md_key->getKeyword();
}
}
// language is not "used" anywhere
$ulang = $ilUser->getLanguage();
if ($keywords[$ulang]) {
asort($keywords[$ulang]);
$txt->setValue($keywords[$ulang]);
}
$form->addCommandButton("saveKeywordsForm", $this->lng->txt("save"));
$form->addCommandButton("preview", $this->lng->txt("cancel"));
return $form;
}
示例9: initQuickEditForm
/**
* Init quick edit form.
*/
public function initQuickEditForm()
{
global $lng, $ilCtrl;
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$this->form = new ilPropertyFormGUI();
// title
$ti = new ilTextInputGUI($this->lng->txt("title"), "gen_title");
$ti->setMaxLength(200);
$ti->setSize(50);
$ti->setRequired(true);
$ti->setValue($this->md_section->getTitle());
$this->form->addItem($ti);
// description(s)
foreach ($ids = $this->md_section->getDescriptionIds() as $id) {
$md_des = $this->md_section->getDescription($id);
$ta = new ilTextAreaInputGUI($this->lng->txt("meta_description"), "gen_description[" . $id . "][description]");
$ta->setCols(50);
$ta->setRows(4);
$ta->setValue($md_des->getDescription());
if (count($ids) > 1) {
$ta->setInfo($this->lng->txt("meta_l_" . $md_des->getDescriptionLanguageCode()));
}
$this->form->addItem($ta);
}
// language(s)
$first = "";
$options = ilMDLanguageItem::_getLanguages();
foreach ($ids = $this->md_section->getLanguageIds() as $id) {
$md_lan = $this->md_section->getLanguage($id);
$first_lang = $md_lan->getLanguageCode();
$si = new ilSelectInputGUI($this->lng->txt("meta_language"), "gen_language[" . $id . "][language]");
$si->setOptions($options);
$si->setValue($md_lan->getLanguageCode());
$this->form->addItem($si);
$first = false;
}
if ($first) {
$si = new ilSelectInputGUI($this->lng->txt("meta_language"), "gen_language[][language]");
$si->setOptions($options);
$this->form->addItem($si);
}
// keyword(s)
$first = true;
$keywords = array();
foreach ($ids = $this->md_section->getKeywordIds() as $id) {
$md_key = $this->md_section->getKeyword($id);
if (trim($md_key->getKeyword()) != "") {
$keywords[$md_key->getKeywordLanguageCode()][] = $md_key->getKeyword();
}
}
foreach ($keywords as $lang => $keyword_set) {
$kw = new ilTextInputGUI($this->lng->txt("keywords"), "keywords[value][" . $lang . "]");
$kw->setDataSource($this->ctrl->getLinkTarget($this, "keywordAutocomplete", "", true));
$kw->setMaxLength(200);
$kw->setSize(50);
$kw->setMulti(true);
if (count($keywords) > 1) {
$kw->setInfo($this->lng->txt("meta_l_" . $lang));
}
$this->form->addItem($kw);
asort($keyword_set);
$kw->setValue($keyword_set);
}
if (count($keywords) == 0) {
$kw = new ilTextInputGUI($this->lng->txt("keywords"), "keywords[value][" . $first_lang . "]");
$kw->setDataSource($this->ctrl->getLinkTarget($this, "keywordAutocomplete", "", true));
$kw->setMaxLength(200);
$kw->setSize(50);
$kw->setMulti(true);
$this->form->addItem($kw);
}
// Lifecycle...
// Authors
$ta = new ilTextAreaInputGUI($this->lng->txt('authors') . "<br />" . "(" . sprintf($this->lng->txt('md_separated_by'), $this->md_settings->getDelimiter()) . ")", "life_authors");
$ta->setCols(50);
$ta->setRows(2);
if (is_object($this->md_section = $this->md_obj->getLifecycle())) {
$sep = $ent_str = "";
foreach ($ids = $this->md_section->getContributeIds() as $con_id) {
$md_con = $this->md_section->getContribute($con_id);
if ($md_con->getRole() == "Author") {
foreach ($ent_ids = $md_con->getEntityIds() as $ent_id) {
$md_ent = $md_con->getEntity($ent_id);
$ent_str = $ent_str . $sep . $md_ent->getEntity();
$sep = $this->md_settings->getDelimiter() . " ";
}
}
}
$ta->setValue($ent_str);
}
$this->form->addItem($ta);
// copyright
include_once "./Services/MetaData/classes/class.ilCopyrightInputGUI.php";
$cp = new ilCopyrightInputGUI($this->lng->txt("meta_copyright"), "copyright");
$cp->setCols(50);
$cp->setRows(3);
$desc = ilMDRights::_lookupDescription($this->md_obj->getRBACId(), $this->md_obj->getObjId());
//.........这里部分代码省略.........
示例10: addCustomFieldToDefinitionForm
/**
* Add input elements to definition form
*
* @param ilPropertyFormGUI $a_form
* @param bool $a_disabled
*/
public function addCustomFieldToDefinitionForm(ilPropertyFormGUI $a_form, $a_disabled = false)
{
global $lng;
$field = new ilTextInputGUI($lng->txt("options"), "opts");
$field->setRequired(true);
$field->setMulti(true);
$field->setMaxLength(255);
// :TODO:
$a_form->addItem($field);
$options = $this->getOptions();
if ($options) {
$field->setMultiValues($options);
$field->setValue(array_shift($options));
}
if ($a_disabled) {
$field->setDisabled(true);
}
}
示例11: initForm
/**
* Init form
*
* @param string $a_cmd
* @return ilPropertyFormGUI
*/
public function initForm($a_cmd = "")
{
global $ilCtrl, $lng;
$lng->loadLanguageModule('crs');
include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
$form->setFormAction($ilCtrl->getFormAction($this->parent_obj, $a_cmd));
$form->setTarget('_blank');
$form->setTitle($lng->txt('sess_gen_attendance_list'));
$title = new ilTextInputGUI($lng->txt('title'), 'title');
$title->setValue($this->title);
$form->addItem($title);
$desc = new ilTextInputGUI($lng->txt('description'), 'desc');
$desc->setValue($this->description);
$form->addItem($desc);
if (sizeof($this->presets)) {
$preset = new ilCheckboxGroupInputGUI($lng->txt('user_detail'), 'preset');
$preset_value = array();
foreach ($this->presets as $id => $item) {
$preset->addOption(new ilCheckboxOption($item[0], $id));
if ($item[1]) {
$preset_value[] = $id;
}
}
$preset->setValue($preset_value);
$form->addItem($preset);
}
$blank = new ilTextInputGUI($lng->txt('event_blank_columns'), 'blank');
$blank->setMulti(true);
$form->addItem($blank);
if ($this->pre_blanks) {
$blank->setValue($this->pre_blanks);
}
$part = new ilFormSectionHeaderGUI();
$part->setTitle($lng->txt('event_participant_selection'));
$form->addItem($part);
// participants by roles
foreach ($this->role_data as $role_id => $role_data) {
$chk = new ilCheckboxInputGUI($role_data[0], 'role_' . $role_id);
$chk->setValue(1);
$chk->setChecked(1);
$form->addItem($chk);
}
// not in sessions
if ($this->waiting_list) {
$chk = new ilCheckboxInputGUI($lng->txt('group_new_registrations'), 'subscr');
$chk->setValue(1);
$form->addItem($chk);
$chk = new ilCheckboxInputGUI($lng->txt('crs_waiting_list'), 'wlist');
$chk->setValue(1);
$form->addItem($chk);
}
if ($this->user_filters) {
foreach ($this->user_filters as $sub_id => $sub_item) {
$sub = new ilCheckboxInputGUI($sub_item[0], 'members_' . $sub_id);
if ($sub_item[1]) {
$sub->setChecked(true);
}
$form->addItem($sub);
}
}
$form->addCommandButton($a_cmd, $lng->txt('sess_print_attendance_list'));
if ($this->id && $a_cmd) {
include_once "Services/User/classes/class.ilUserFormSettings.php";
$settings = new ilUserFormSettings($this->id);
$settings->deleteValue('desc');
// #11340
$settings->exportToForm($form);
}
return $form;
}
示例12: initKeywordsForm
protected function initKeywordsForm()
{
global $ilUser;
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this, "saveKeywordsForm"));
$form->setTitle($this->lng->txt("blog_edit_keywords"));
$txt = new ilTextInputGUI($this->lng->txt("blog_keywords"), "keywords");
// $txt->setRequired(true); #10504
$txt->setMulti(true);
$txt->setDataSource($this->ctrl->getLinkTarget($this, "keywordAutocomplete", "", true));
$txt->setMaxLength(200);
$txt->setSize(50);
$txt->setInfo($this->lng->txt("blog_keywords_info"));
$form->addItem($txt);
$md_section = $this->getBlogPosting()->getMDSection();
$keywords = array();
foreach ($ids = $md_section->getKeywordIds() as $id) {
$md_key = $md_section->getKeyword($id);
if (trim($md_key->getKeyword()) != "") {
$keywords[$md_key->getKeywordLanguageCode()][] = $md_key->getKeyword();
}
}
// language is not "used" anywhere
$ulang = $ilUser->getLanguage();
if ($keywords[$ulang]) {
asort($keywords[$ulang]);
$txt->setValue($keywords[$ulang]);
}
// other keywords in blog
$other = array();
foreach (array_keys(ilBlogPosting::getAllPostings($this->getBlogPosting()->getBlogId())) as $posting_id) {
if ($posting_id != $this->getBlogPosting()->getId()) {
$other = array_merge($other, ilBlogPosting::getKeywords($this->getBlogPosting()->getBlogId(), $posting_id));
}
}
if (is_array($keywords[$ulang])) {
$other = array_diff($other, $keywords[$ulang]);
}
if (sizeof($other)) {
$html = "";
foreach ($other as $item) {
$html .= '<span class="ilTag">' . $item . '</span>';
}
$info = new ilNonEditableValueGUI($this->lng->txt("blog_keywords_other"), "", true);
$info->setInfo($this->lng->txt("blog_keywords_other_info"));
$info->setValue($html);
$form->addItem($info);
}
$form->addCommandButton("saveKeywordsForm", $this->lng->txt("save"));
$form->addCommandButton("preview", $this->lng->txt("cancel"));
return $form;
}
示例13: initForm
//.........这里部分代码省略.........
}
}
// email
if ($this->isSettingChangeable('email')) {
$em = new ilEMailInputGUI($lng->txt("email"), "email");
$em->setRequired(isset($settings["require_email"]) && $settings["require_email"]);
$this->form_gui->addItem($em);
}
// interests/hobbies
if ($this->isSettingChangeable('hobby')) {
$hob = new ilTextAreaInputGUI($lng->txt("hobby"), "hobby");
$hob->setRows(3);
$hob->setCols(40);
$hob->setRequired(isset($settings["require_hobby"]) && $settings["require_hobby"]);
$this->form_gui->addItem($hob);
}
// referral comment
if ($this->isSettingChangeable('referral_comment')) {
$rc = new ilTextAreaInputGUI($lng->txt("referral_comment"), "referral_comment");
$rc->setRows(3);
$rc->setCols(40);
$rc->setRequired(isset($settings["require_referral_comment"]) && $settings["require_referral_comment"]);
$this->form_gui->addItem($rc);
}
// interests
$sh = new ilFormSectionHeaderGUI();
$sh->setTitle($lng->txt("interests"));
$this->form_gui->addItem($sh);
$multi_fields = array("interests_general", "interests_help_offered", "interests_help_looking");
foreach ($multi_fields as $multi_field) {
if ($this->isSettingChangeable($multi_field)) {
// see ilUserProfile
$ti = new ilTextInputGUI($lng->txt($multi_field), $multi_field);
$ti->setMulti(true);
$ti->setMaxLength(40);
$ti->setSize(40);
$ti->setRequired(isset($settings["require_" . $multi_field]) && $settings["require_" . $multi_field]);
$this->form_gui->addItem($ti);
}
}
// instant messengers
if ($this->isSettingChangeable('instant_messengers')) {
$sec_im = new ilFormSectionHeaderGUI();
$sec_im->setTitle($this->lng->txt("instant_messengers"));
$this->form_gui->addItem($sec_im);
}
// icq, yahoo, msn, aim, skype
$fields = array("icq", "yahoo", "msn", "aim", "skype", "jabber", "voip");
foreach ($fields as $field) {
if ($this->isSettingChangeable('instant_messengers')) {
$im = new ilTextInputGUI($lng->txt("im_" . $field), "im_" . $field);
$im->setSize(40);
$im->setMaxLength(40);
$this->form_gui->addItem($im);
}
}
// other information
if ($this->isSettingChangeable('user_profile_other')) {
$sec_oi = new ilFormSectionHeaderGUI();
$sec_oi->setTitle($this->lng->txt("user_profile_other"));
$this->form_gui->addItem($sec_oi);
}
// matriculation number
if ($this->isSettingChangeable('matriculation')) {
$mr = new ilTextInputGUI($lng->txt("matriculation"), "matriculation");
$mr->setSize(40);
示例14: initAddCodesForm
function initAddCodesForm()
{
global $rbacreview, $ilObjDataCache, $lng;
include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
$this->form_gui = new ilPropertyFormGUI();
$this->form_gui->setFormAction($this->ctrl->getFormAction($this, 'createCodes'));
$this->form_gui->setTitle($this->lng->txt('registration_codes_edit_header'));
$count = new ilNumberInputGUI($this->lng->txt('registration_codes_number'), 'reg_codes_number');
$count->setSize(4);
$count->setMaxLength(4);
$count->setMinValue(1);
$count->setMaxValue(1000);
$count->setRequired(true);
$this->form_gui->addItem($count);
$sec = new ilFormSectionHeaderGUI();
$sec->setTitle($this->lng->txt('registration_codes_roles_title'));
$this->form_gui->addItem($sec);
include_once './Services/AccessControl/classes/class.ilObjRole.php';
$options = array("" => $this->lng->txt('registration_codes_no_assigned_role'));
foreach ($rbacreview->getGlobalRoles() as $role_id) {
if (!in_array($role_id, array(SYSTEM_ROLE_ID, ANONYMOUS_ROLE_ID))) {
$options[$role_id] = $ilObjDataCache->lookupTitle($role_id);
}
}
$roles = new ilSelectInputGUI($this->lng->txt("registration_codes_roles"), "reg_codes_role");
$roles->setInfo($this->lng->txt("registration_codes_override_info"));
$roles->setOptions($options);
$this->form_gui->addItem($roles);
$local = new ilTextInputGUI($this->lng->txt("registration_codes_roles_local"), "reg_codes_local");
$local->setMulti(true);
$local->setDataSource($this->ctrl->getLinkTarget($this, "getLocalRoleAutoComplete", "", true));
$this->form_gui->addItem($local);
$sec = new ilFormSectionHeaderGUI();
$sec->setTitle($this->lng->txt('reg_access_limitations'));
$this->form_gui->addItem($sec);
$limit = new ilRadioGroupInputGUI($this->lng->txt("reg_access_limitation_mode"), "reg_limit");
$limit->setInfo($this->lng->txt("registration_codes_override_info"));
$this->form_gui->addItem($limit);
$opt = new ilRadioOption($this->lng->txt("registration_codes_roles_limitation_none"), "none");
$limit->addOption($opt);
$opt = new ilRadioOption($this->lng->txt("reg_access_limitation_none"), "unlimited");
$limit->addOption($opt);
$opt = new ilRadioOption($this->lng->txt("reg_access_limitation_mode_absolute"), "absolute");
$limit->addOption($opt);
$dt = new ilDateTimeInputGUI($this->lng->txt("reg_access_limitation_mode_absolute_target"), "abs_date");
$dt->setRequired(true);
$opt->addSubItem($dt);
$opt = new ilRadioOption($this->lng->txt("reg_access_limitation_mode_relative"), "relative");
$limit->addOption($opt);
$days = new ilTextInputGUI("", "rel_date[d]");
$days->setSize(5);
$days->setSuffix($this->lng->txt("days"));
$mon = new ilTextInputGUI("", "rel_date[m]");
$mon->setSize(5);
$mon->setSuffix($this->lng->txt("months"));
$yr = new ilTextInputGUI("", "rel_date[y]");
$yr->setSize(5);
$yr->setSuffix($this->lng->txt("years"));
// custom input won't reload
if (is_array($_POST["rel_date"])) {
$days->setValue($_POST["rel_date"]["d"]);
$mon->setValue($_POST["rel_date"]["m"]);
$yr->setValue($_POST["rel_date"]["y"]);
}
$dur = new ilCustomInputGUI($this->lng->txt("reg_access_limitation_mode_relative_target"));
$dur->setRequired(true);
$dur->setHTML($days->getToolbarHTML() . " " . $mon->getToolbarHTML() . " " . $yr->getToolbarHTML());
$opt->addSubItem($dur);
$this->form_gui->addCommandButton('createCodes', $this->lng->txt('create'));
}
示例15: createParticipantsMultiTextInput
private function createParticipantsMultiTextInput()
{
$participants_input = new ilTextInputGUI($this->lng->txt("rep_robj_xrs_participants_list"), "participants");
$participants_input->setMulti(true);
$ajax_datasource = $this->ctrl->getLinkTarget($this, 'doUserAutoComplete', '', true);
$participants_input->setDataSource($ajax_datasource);
$participants_input->setInfo($this->getMaxRoomAllocationInfo());
return $participants_input;
}