本文整理汇总了PHP中ilTextAreaInputGUI::setInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP ilTextAreaInputGUI::setInfo方法的具体用法?PHP ilTextAreaInputGUI::setInfo怎么用?PHP ilTextAreaInputGUI::setInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilTextAreaInputGUI
的用法示例。
在下文中一共展示了ilTextAreaInputGUI::setInfo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initForm
/**
* Init creation form
*/
function initForm($a_mode = "create")
{
global $lng, $ilCtrl;
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
if ($a_mode == "edit") {
$std_item = $this->object->getMediaItem("Standard");
}
$this->form_gui = new ilPropertyFormGUI();
// standard view resource
$title = new ilTextInputGUI($lng->txt("title"), "standard_title");
$title->setSize(40);
$title->setMaxLength(120);
$this->form_gui->addItem($title);
$radio_prop = new ilRadioGroupInputGUI($lng->txt("cont_resource"), "standard_type");
$op1 = new ilRadioOption($lng->txt("cont_file"), "File");
$up = new ilFileInputGUI("", "standard_file");
$up->setSuffixes(ilObjMediaObject::getRestrictedFileTypes());
$up->setInfo("");
$op1->addSubItem($up);
$radio_prop->addOption($op1);
$op2 = new ilRadioOption($lng->txt("url"), "Reference");
$ref = new ilTextInputGUI("", "standard_reference");
$ref->setInfo($lng->txt("cont_ref_helptext"));
$op2->addSubItem($ref);
$radio_prop->addOption($op2);
$radio_prop->setValue("File");
$this->form_gui->addItem($radio_prop);
// standard format
if ($a_mode == "edit") {
$format = new ilNonEditableValueGUI($lng->txt("cont_format"), "standard_format");
$format->setValue($std_item->getFormat());
$this->form_gui->addItem($format);
}
// standard size
$radio_size = new ilRadioGroupInputGUI($lng->txt("size"), "standard_size");
if ($a_mode == "edit") {
if ($orig_size = $std_item->getOriginalSize()) {
$add_str = " (" . $orig_size["width"] . " x " . $orig_size["height"] . ")";
}
$op1 = new ilRadioOption($lng->txt("cont_resource_size") . $add_str, "original");
$op2 = new ilRadioOption($lng->txt("cont_custom_size"), "selected");
} else {
$op1 = new ilRadioOption($lng->txt("cont_orig_size"), "original");
$op2 = new ilRadioOption($lng->txt("cont_adjust_size"), "selected");
}
$radio_size->addOption($op1);
// width height
include_once "./Services/MediaObjects/classes/class.ilWidthHeightInputGUI.php";
$width_height = new ilWidthHeightInputGUI($lng->txt("cont_width") . " / " . $lng->txt("cont_height"), "standard_width_height");
$width_height->setConstrainProportions(true);
$op2->addSubItem($width_height);
// resize image
if ($a_mode == "edit") {
$std_item = $this->object->getMediaItem("Standard");
if (is_int(strpos($std_item->getFormat(), "image")) && $std_item->getLocationType() == "LocalFile") {
$resize = new ilCheckboxInputGUI($lng->txt("cont_resize_img"), "standard_resize");
$op2->addSubItem($resize);
}
}
$radio_size->setValue("original");
if ($a_mode == "create" && ($this->getHeightPreset() > 0 || $this->getWidthPreset() > 0)) {
$radio_size->setValue("selected");
$width_height->setWidth($this->getWidthPreset());
$width_height->setHeight($this->getHeightPreset());
}
$radio_size->addOption($op2);
$this->form_gui->addItem($radio_size);
// standard caption
$caption = new ilTextAreaInputGUI($lng->txt("cont_caption"), "standard_caption");
$caption->setCols(30);
$caption->setRows(2);
$this->form_gui->addItem($caption);
/*$caption = new ilTextInputGUI($lng->txt("cont_caption"), "standard_caption");
$caption->setSize(40);
$caption->setMaxLength(200);
$this->form_gui->addItem($caption);*/
// text representation (alt text)
if ($a_mode == "edit" && is_int(strpos($std_item->getFormat(), "image"))) {
$ta = new ilTextAreaInputGUI($lng->txt("text_repr"), "text_representation");
$ta->setCols(30);
$ta->setRows(2);
$ta->setInfo($lng->txt("text_repr_info"));
$this->form_gui->addItem($ta);
}
// standard parameters
if ($a_mode == "edit" && !in_array($std_item->getFormat(), ilObjMediaObject::_getSimpleMimeTypes())) {
if (ilObjMediaObject::_useAutoStartParameterOnly($std_item->getLocation(), $std_item->getFormat())) {
$auto = new ilCheckboxInputGUI($lng->txt("cont_autostart"), "standard_autostart");
$this->form_gui->addItem($auto);
} else {
$par = new ilTextAreaInputGUI($lng->txt("cont_parameter"), "standard_parameters");
$par->setRows(5);
$par->setCols(50);
$this->form_gui->addItem($par);
}
}
if ($a_mode == "edit") {
//.........这里部分代码省略.........
示例2: initPropertiesForm
/**
* Init survey settings form
*
* @return ilPropertyFormGUI
*/
function initPropertiesForm()
{
$template_settings = $hide_rte_switch = null;
$template = $this->object->getTemplate();
if ($template) {
include_once "Services/Administration/classes/class.ilSettingsTemplate.php";
$template = new ilSettingsTemplate($template);
$template_settings = $template->getSettings();
$hide_rte_switch = $template_settings["rte_switch"]["hide"];
}
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setTableWidth("100%");
$form->setId("survey_properties");
// general properties
$header = new ilFormSectionHeaderGUI();
$header->setTitle($this->lng->txt("settings"));
$form->addItem($header);
// title & description (meta data)
include_once 'Services/MetaData/classes/class.ilMD.php';
$md_obj = new ilMD($this->object->getId(), 0, "svy");
$md_section = $md_obj->getGeneral();
$title = new ilTextInputGUI($this->lng->txt("title"), "title");
$title->setRequired(true);
$title->setValue($md_section->getTitle());
$form->addItem($title);
$ids = $md_section->getDescriptionIds();
if ($ids) {
$desc_obj = $md_section->getDescription(array_pop($ids));
$desc = new ilTextAreaInputGUI($this->lng->txt("description"), "description");
$desc->setCols(50);
$desc->setRows(4);
$desc->setValue($desc_obj->getDescription());
$form->addItem($desc);
}
// pool usage
$pool_usage = new ilRadioGroupInputGUI($this->lng->txt("survey_question_pool_usage"), "use_pool");
$opt = new ilRadioOption($this->lng->txt("survey_question_pool_usage_active"), 1);
$opt->setInfo($this->lng->txt("survey_question_pool_usage_active_info"));
$pool_usage->addOption($opt);
$opt = new ilRadioOption($this->lng->txt("survey_question_pool_usage_inactive"), 0);
$opt->setInfo($this->lng->txt("survey_question_pool_usage_inactive_info"));
$pool_usage->addOption($opt);
$pool_usage->setValue($this->object->getPoolUsage());
$form->addItem($pool_usage);
// 360°: appraisees
if ($this->object->get360Mode()) {
$self_eval = new ilCheckboxInputGUI($this->lng->txt("survey_360_self_evaluation"), "self_eval");
$self_eval->setInfo($this->lng->txt("survey_360_self_evaluation_info"));
$self_eval->setChecked($this->object->get360SelfEvaluation());
$form->addItem($self_eval);
$self_rate = new ilCheckboxInputGUI($this->lng->txt("survey_360_self_raters"), "self_rate");
$self_rate->setInfo($this->lng->txt("survey_360_self_raters_info"));
$self_rate->setChecked($this->object->get360SelfRaters());
$form->addItem($self_rate);
$self_appr = new ilCheckboxInputGUI($this->lng->txt("survey_360_self_appraisee"), "self_appr");
$self_appr->setInfo($this->lng->txt("survey_360_self_appraisee_info"));
$self_appr->setChecked($this->object->get360SelfAppraisee());
$form->addItem($self_appr);
}
// activation
include_once "Services/Object/classes/class.ilObjectActivation.php";
$this->lng->loadLanguageModule('rep');
$section = new ilFormSectionHeaderGUI();
$section->setTitle($this->lng->txt('rep_activation_availability'));
$form->addItem($section);
// additional info only with multiple references
$act_obj_info = $act_ref_info = "";
if (sizeof(ilObject::_getAllReferences($this->object->getId())) > 1) {
$act_obj_info = ' ' . $this->lng->txt('rep_activation_online_object_info');
$act_ref_info = $this->lng->txt('rep_activation_access_ref_info');
}
$online = new ilCheckboxInputGUI($this->lng->txt('rep_activation_online'), 'online');
$online->setInfo($this->lng->txt('svy_activation_online_info') . $act_obj_info);
$online->setChecked($this->object->isOnline());
$form->addItem($online);
$act_type = new ilCheckboxInputGUI($this->lng->txt('rep_visibility_until'), 'access_type');
// $act_type->setInfo($this->lng->txt('svy_availability_until_info'));
$act_type->setChecked($this->object->isActivationLimited());
$this->tpl->addJavaScript('./Services/Form/js/date_duration.js');
include_once "Services/Form/classes/class.ilDateDurationInputGUI.php";
$dur = new ilDateDurationInputGUI($this->lng->txt('rep_time_period'), "access_period");
$dur->setShowTime(true);
$date = $this->object->getActivationStartDate();
$dur->setStart(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
$dur->setStartText($this->lng->txt('rep_activation_limited_start'));
$date = $this->object->getActivationEndDate();
$dur->setEnd(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
$dur->setEndText($this->lng->txt('rep_activation_limited_end'));
$act_type->addSubItem($dur);
$visible = new ilCheckboxInputGUI($this->lng->txt('rep_activation_limited_visibility'), 'access_visiblity');
$visible->setInfo($this->lng->txt('svy_activation_limited_visibility_info'));
$visible->setChecked($this->object->getActivationVisibility());
$act_type->addSubItem($visible);
//.........这里部分代码省略.........
示例3: initFormNewsItem
/**
* FORM NewsItem: Init form.
*
* @param int $a_mode Form Edit Mode (IL_FORM_EDIT | IL_FORM_CREATE)
*/
public function initFormNewsItem($a_mode)
{
global $lng, $ilTabs;
$ilTabs->clearTargets();
//$this->setTabs();
$lng->loadLanguageModule("news");
include "Services/Form/classes/class.ilPropertyFormGUI.php";
$this->form_gui = new ilPropertyFormGUI();
// Property Title
$text_input = new ilTextInputGUI($lng->txt("news_news_item_title"), "news_title");
$text_input->setInfo("");
$text_input->setRequired(true);
$text_input->setMaxLength(200);
$this->form_gui->addItem($text_input);
// Property Content
$text_area = new ilTextAreaInputGUI($lng->txt("news_news_item_content"), "news_content");
$text_area->setInfo("");
$text_area->setRequired(false);
$this->form_gui->addItem($text_area);
// Property Visibility
$radio_group = new ilRadioGroupInputGUI($lng->txt("news_news_item_visibility"), "news_visibility");
$radio_option = new ilRadioOption($lng->txt("news_visibility_users"), "users");
$radio_group->addOption($radio_option);
$radio_option = new ilRadioOption($lng->txt("news_visibility_public"), "public");
$radio_group->addOption($radio_option);
$radio_group->setInfo($lng->txt("news_news_item_visibility_info"));
$radio_group->setRequired(false);
$radio_group->setValue("users");
$this->form_gui->addItem($radio_group);
// Property ContentLong
$text_area = new ilTextAreaInputGUI($lng->txt("news_news_item_content_long"), "news_content_long");
$text_area->setInfo($lng->txt("news_news_item_content_long_info"));
$text_area->setRequired(false);
$text_area->setCols("40");
$text_area->setRows("8");
$text_area->setUseRte(true);
$this->form_gui->addItem($text_area);
// save and cancel commands
if (in_array($a_mode, array(IL_FORM_CREATE, IL_FORM_RE_CREATE))) {
$this->form_gui->addCommandButton("saveNewsItem", $lng->txt("save"));
$this->form_gui->addCommandButton("cancelSaveNewsItem", $lng->txt("cancel"));
} else {
$this->form_gui->addCommandButton("updateNewsItem", $lng->txt("save"));
$this->form_gui->addCommandButton("cancelUpdateNewsItem", $lng->txt("cancel"));
}
$this->form_gui->setTitle($lng->txt("news_news_item_head"));
$this->form_gui->setFormAction($this->ctrl->getFormAction($this));
$this->form_gui->setTitleIcon(ilUtil::getImagePath("icon_news.png"));
$news_set = new ilSetting("news");
if (!$news_set->get("enable_rss_for_internal")) {
$this->form_gui->removeItemByPostVar("news_visibility");
} else {
$nv = $this->form_gui->getItemByPostVar("news_visibility");
if (is_object($nv)) {
$nv->setValue(ilNewsItem::_getDefaultVisibilityForRefId($_GET["ref_id"]));
}
}
}
示例4: certificateEditor
/**
* Shows the certificate editor for ILIAS tests
*/
public function certificateEditor()
{
global $ilAccess;
$form_fields = array();
if (strcmp($this->ctrl->getCmd(), "certificateSave") == 0) {
$form_fields = $this->getFormFieldsFromPOST();
} else {
$form_fields = $this->getFormFieldsFromFO();
}
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setPreventDoubleSubmission(false);
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setTitle($this->lng->txt("certificate_edit"));
$form->setMultipart(TRUE);
$form->setTableWidth("100%");
$form->setId("certificate");
$active = new ilCheckboxInputGUI($this->lng->txt("active"), "active");
$active->setChecked($form_fields["active"]);
$form->addItem($active);
$import = new ilFileInputGUI($this->lng->txt("import"), "certificate_import");
$import->setRequired(FALSE);
$import->setSuffixes(array("zip"));
// handle the certificate import
if (strlen($_FILES["certificate_import"]["tmp_name"])) {
if ($import->checkInput()) {
$result = $this->object->importCertificate($_FILES["certificate_import"]["tmp_name"], $_FILES["certificate_import"]["name"]);
if ($result == FALSE) {
$import->setAlert($this->lng->txt("certificate_error_import"));
} else {
$this->ctrl->redirect($this, "certificateEditor");
}
}
}
$form->addItem($import);
$pageformat = new ilRadioGroupInputGUI($this->lng->txt("certificate_page_format"), "pageformat");
$pageformats = $this->object->getPageFormats();
$pageformat->setValue($form_fields["pageformat"]);
foreach ($pageformats as $format) {
$option = new ilRadioOption($format["name"], $format["value"]);
if (strcmp($format["value"], "custom") == 0) {
$pageheight = new ilTextInputGUI($this->lng->txt("certificate_pageheight"), "pageheight");
$pageheight->setValue($form_fields["pageheight"]);
$pageheight->setSize(6);
$pageheight->setValidationRegexp("/[0123456789\\.](cm|mm|in|pt|pc|px|em)/is");
$pageheight->setInfo($this->lng->txt("certificate_unit_description"));
$pageheight->setRequired(true);
$option->addSubitem($pageheight);
$pagewidth = new ilTextInputGUI($this->lng->txt("certificate_pagewidth"), "pagewidth");
$pagewidth->setValue($form_fields["pagewidth"]);
$pagewidth->setSize(6);
$pagewidth->setValidationRegexp("/[0123456789\\.](cm|mm|in|pt|pc|px|em)/is");
$pagewidth->setInfo($this->lng->txt("certificate_unit_description"));
$pagewidth->setRequired(true);
$option->addSubitem($pagewidth);
}
$pageformat->addOption($option);
}
$pageformat->setRequired(true);
if (strcmp($this->ctrl->getCmd(), "certificateSave") == 0) {
$pageformat->checkInput();
}
$form->addItem($pageformat);
$bgimage = new ilImageFileInputGUI($this->lng->txt("certificate_background_image"), "background");
$bgimage->setRequired(FALSE);
$bgimage->setUseCache(false);
if (count($_POST)) {
// handle the background upload
if (strlen($_FILES["background"]["tmp_name"])) {
if ($bgimage->checkInput()) {
$result = $this->object->uploadBackgroundImage($_FILES["background"]["tmp_name"]);
if ($result == FALSE) {
$bgimage->setAlert($this->lng->txt("certificate_error_upload_bgimage"));
}
}
}
}
if (!$this->object->hasBackgroundImage()) {
include_once "./Services/Certificate/classes/class.ilObjCertificateSettingsAccess.php";
if (ilObjCertificateSettingsAccess::hasBackgroundImage()) {
$bgimage->setImage(ilObjCertificateSettingsAccess::getBackgroundImageThumbPathWeb());
}
} else {
$bgimage->setImage($this->object->getBackgroundImageThumbPathWeb());
}
$form->addItem($bgimage);
$padding_top = new ilTextInputGUI($this->lng->txt("certificate_padding_top"), "padding_top");
$padding_top->setRequired(TRUE);
$padding_top->setValue($form_fields["padding_top"]);
$padding_top->setSize(6);
$padding_top->setValidationRegexp("/[0123456789\\.](cm|mm|in|pt|pc|px|em)/is");
$padding_top->setInfo($this->lng->txt("certificate_unit_description"));
if (strcmp($this->ctrl->getCmd(), "certificateSave") == 0) {
$padding_top->checkInput();
}
$form->addItem($padding_top);
$rect = new ilCSSRectInputGUI($this->lng->txt("certificate_margin_body"), "margin_body");
//.........这里部分代码省略.........
示例5: editQuestion
/**
* Creates an output of the edit form for the question
*
* @access public
*/
public function editQuestion($checkonly = FALSE)
{
$save = $this->isSaveCommand();
$this->getQuestionTemplate();
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setTitle($this->outQuestionType());
$form->setMultipart(FALSE);
$form->setTableWidth("100%");
$form->setId("orderinghorizontal");
$this->addBasicQuestionFormProperties($form);
// errortext
$errortext = new ilTextAreaInputGUI($this->lng->txt("errortext"), "errortext");
$errortext->setValue(ilUtil::prepareFormOutput($this->object->getErrorText()));
$errortext->setRequired(TRUE);
$errortext->setInfo($this->lng->txt("errortext_info"));
$errortext->setRows(10);
$errortext->setCols(80);
$form->addItem($errortext);
if (!$this->getSelfAssessmentEditingMode()) {
// textsize
$textsize = new ilNumberInputGUI($this->lng->txt("textsize"), "textsize");
$textsize->setValue(strlen($this->object->getTextSize()) ? $this->object->getTextSize() : 100.0);
$textsize->setInfo($this->lng->txt("textsize_errortext_info"));
$textsize->setSize(6);
$textsize->setSuffix("%");
$textsize->setMinValue(10);
$textsize->setRequired(true);
$form->addItem($textsize);
}
if (count($this->object->getErrorData()) || $checkonly) {
$header = new ilFormSectionHeaderGUI();
$header->setTitle($this->lng->txt("errors_section"));
$form->addItem($header);
include_once "./Modules/TestQuestionPool/classes/class.ilErrorTextWizardInputGUI.php";
$errordata = new ilErrorTextWizardInputGUI($this->lng->txt("errors"), "errordata");
$values = array();
$errordata->setKeyName($this->lng->txt('text_wrong'));
$errordata->setValueName($this->lng->txt('text_correct'));
$errordata->setValues($this->object->getErrorData());
$form->addItem($errordata);
// points for wrong selection
$points_wrong = new ilNumberInputGUI($this->lng->txt("points_wrong"), "points_wrong");
$points_wrong->setValue($this->object->getPointsWrong());
$points_wrong->setInfo($this->lng->txt("points_wrong_info"));
$points_wrong->setSize(6);
$points_wrong->setRequired(true);
$form->addItem($points_wrong);
}
$form->addCommandButton("analyze", $this->lng->txt('analyze_errortext'));
$this->addQuestionFormCommandButtons($form);
$errors = false;
if ($save) {
$form->setValuesByPost();
$errors = !$form->checkInput();
$form->setValuesByPost();
// again, because checkInput now performs the whole stripSlashes handling and we need this if we don't want to have duplication of backslashes
if ($errors) {
$checkonly = false;
}
}
if (!$checkonly) {
$this->tpl->setVariable("QUESTION_DATA", $form->getHTML());
}
return $errors;
}
示例6: showProperties
/**
* Show learning objectives
*/
function showProperties()
{
global $tpl, $lng, $ilTabs, $ilCtrl;
$this->setTabs();
$this->setLocator();
$ilTabs->setTabActive("sahs_desc_objectives");
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
// hide objectives page
$cb = new ilCheckboxInputGUI($lng->txt("sahs_hide_objectives_page"), "hide_objectives_page");
$cb->setInfo($lng->txt("sahs_hide_objectives_page_info"));
$form->addItem($cb);
$cb->setChecked($this->node_object->getHideObjectivePage());
// description
$ta = new ilTextAreaInputGUI($lng->txt("description"), "desc");
$ta->setRows(4);
$ta->setCols(55);
$ta->setInfo($lng->txt("sahs_list_info"));
$form->setTitle($lng->txt("properties"));
$form->addItem($ta);
include_once "./Services/MetaData/classes/class.ilMD.php";
$meta = new ilMD($this->node_object->getSLMId(), $this->node_object->getId(), $this->node_object->getType());
$desc_ids = $meta->getGeneral()->getDescriptionIds();
$ta->setValue($meta->getGeneral()->getDescription($desc_ids[0])->getDescription());
// objectives
$sh = new ilFormSectionHeaderGUI();
$sh->setTitle($lng->txt("sahs_learning_objectives"));
$form->addItem($sh);
$objectives = $this->node_object->getObjectives();
foreach ($objectives as $ob) {
// map info
$mappings = $ob->getMappings();
$mapinfo = null;
foreach ($mappings as $map) {
$mapinfo .= $map->getTargetObjectiveID();
}
if ($mapinfo == null) {
$mapinfo = "local";
} else {
$mapinfo = "global to " . $mapinfo;
}
// objective
$ta = new ilTextAreaInputGUI($mapinfo, "obj_" . $ob->getId());
$ta->setCols(55);
$ta->setRows(4);
$ta->setInfo($lng->txt("sahs_list_info"));
$form->addItem($ta);
$ta->setValue($ob->getObjectiveID());
}
$form->setFormAction($ilCtrl->getFormAction($this));
$form->addCommandButton("updateProperties", $lng->txt("save"));
$tpl->setContent($form->getHTML());
}
示例7: editQuestion
/**
* Creates an output of the edit form for the question
*
* @access public
*/
public function editQuestion($checkonly = FALSE)
{
$save = $this->isSaveCommand();
$this->getQuestionTemplate();
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setTitle($this->outQuestionType());
$form->setMultipart(FALSE);
$form->setTableWidth("100%");
$form->setId("orderinghorizontal");
$this->addBasicQuestionFormProperties($form);
// ordertext
$ordertext = new ilTextAreaInputGUI($this->lng->txt("ordertext"), "ordertext");
$ordertext->setValue($this->object->prepareTextareaOutput($this->object->getOrderText()));
$ordertext->setRequired(TRUE);
$ordertext->setInfo(sprintf($this->lng->txt("ordertext_info"), $this->object->separator));
$ordertext->setRows(10);
$ordertext->setCols(80);
$form->addItem($ordertext);
// textsize
$textsize = new ilNumberInputGUI($this->lng->txt("textsize"), "textsize");
$textsize->setValue($this->object->getTextSize());
$textsize->setInfo($this->lng->txt("textsize_info"));
$textsize->setSize(6);
$textsize->setMinValue(10);
$textsize->setRequired(FALSE);
$form->addItem($textsize);
// points
$points = new ilNumberInputGUI($this->lng->txt("points"), "points");
// mbecker: Fix for mantis bug 7866: Predefined values schould make sense.
// This implements a default value of "1" for this question type.
if ($this->object->getPoints() == null) {
$points->setValue("1");
} else {
$points->setValue($this->object->getPoints());
}
$points->setRequired(TRUE);
$points->setSize(3);
$points->setMinValue(0.0);
$points->setMinvalueShouldBeGreater(true);
$form->addItem($points);
$this->addQuestionFormCommandButtons($form);
$errors = false;
if ($save) {
$form->setValuesByPost();
$errors = !$form->checkInput();
$form->setValuesByPost();
// again, because checkInput now performs the whole stripSlashes handling and we need this if we don't want to have duplication of backslashes
if ($errors) {
$checkonly = false;
}
}
if (!$checkonly) {
$this->tpl->setVariable("QUESTION_DATA", $form->getHTML());
}
return $errors;
}
示例8: fillRow
/**
* Fill table row
*/
protected function fillRow($d)
{
global $lng, $ilCtrl;
$this->tpl->setVariable("TXT_ASS_TITLE", $d["title"]);
$file_info = ilExAssignment::getDownloadedFilesInfoForTableGUIS($this->parent_obj, $this->exc_id, $d["type"], $d["id"], $this->part_id, $this->parent_cmd);
$has_no_team_yet = false;
if ($d["type"] == ilExAssignment::TYPE_UPLOAD_TEAM) {
$members = ilExAssignment::getTeamMembersByAssignmentId($d["id"], $this->part_id);
// #11957
if (sizeof($members)) {
$this->tpl->setCurrentBlock("ass_members");
foreach ($members as $member_id) {
$this->tpl->setVariable("TXT_MEMBER_NAME", ilObjUser::_lookupFullname($member_id));
$this->tpl->parseCurrentBlock();
}
$ilCtrl->setParameter($this->parent_obj, "lpart", $this->part_id);
$this->tpl->setVariable("HREF_LOG", $ilCtrl->getLinkTarget($this->parent_obj, "showTeamLog"));
$this->tpl->setVariable("TXT_LOG", $lng->txt("exc_team_log"));
$ilCtrl->setParameter($this->parent_obj, "lpart", "");
} else {
// #11957
$has_no_team_yet = true;
$this->tpl->setCurrentBlock("team_info");
$this->tpl->setVariable("TXT_TEAM_INFO", $lng->txt("exc_no_team_yet"));
$this->tpl->setVariable("TXT_CREATE_TEAM", $lng->txt("exc_create_team"));
$ilCtrl->setParameter($this->parent_obj, "ass_id", $d["id"]);
$ilCtrl->setParameter($this->parent_obj, "lpart", $this->part_id);
$this->tpl->setVariable("URL_CREATE_TEAM", $ilCtrl->getLinkTarget($this->getParentObject(), "createSingleMemberTeam"));
$ilCtrl->setParameter($this->parent_obj, "lpart", "");
$ilCtrl->setParameter($this->parent_obj, "ass_id", "");
if ($file_info["files"]["count"]) {
$this->tpl->setVariable("TEAM_FILES_INFO", "<br />" . $file_info["files"]["txt"] . ": " . $file_info["files"]["count"]);
}
$this->tpl->parseCurrentBlock();
}
}
if (!$has_no_team_yet) {
$this->tpl->setVariable("VAL_CHKBOX", ilUtil::formCheckbox(0, "assid[" . $d["id"] . "]", 1));
$this->tpl->setVariable("VAL_ID", $d["id"]);
$this->tpl->setVariable("VAL_LAST_SUBMISSION", $file_info["last_submission"]["value"]);
$this->tpl->setVariable("TXT_LAST_SUBMISSION", $file_info["last_submission"]["txt"]);
$this->tpl->setVariable("TXT_SUBMITTED_FILES", $file_info["files"]["txt"]);
$this->tpl->setVariable("VAL_SUBMITTED_FILES", $file_info["files"]["count"]);
if ($file_info["files"]["download_url"]) {
$this->tpl->setCurrentBlock("download_link");
$this->tpl->setVariable("LINK_DOWNLOAD", $file_info["files"]["download_url"]);
$this->tpl->setVariable("TXT_DOWNLOAD", $file_info["files"]["download_txt"]);
$this->tpl->parseCurrentBlock();
}
if ($file_info["files"]["download_new_url"]) {
$this->tpl->setCurrentBlock("download_link");
$this->tpl->setVariable("LINK_NEW_DOWNLOAD", $file_info["files"]["download_new_url"]);
$this->tpl->setVariable("TXT_NEW_DOWNLOAD", $file_info["files"]["download_new_txt"]);
$this->tpl->parseCurrentBlock();
}
// note
$this->tpl->setVariable("TXT_NOTE", $lng->txt("exc_note_for_tutor"));
$this->tpl->setVariable("NAME_NOTE", "notice[" . $d["id"] . "]");
$this->tpl->setVariable("VAL_NOTE", ilUtil::prepareFormOutput(ilExAssignment::lookupNoticeOfUser($d["id"], $this->part_id)));
// comment for learner
$lcomment_value = ilExAssignment::lookupCommentForUser($d["id"], $this->part_id);
$overlay_id = "excasscomm_" . $d["id"] . "_" . $this->part_id;
$overlay_trigger_id = $overlay_id . "_tr";
$overlay = new ilOverlayGUI($overlay_id);
$overlay->setAnchor($overlay_trigger_id);
$overlay->setTrigger($overlay_trigger_id, "click", $overlay_trigger_id);
$overlay->add();
$this->tpl->setVariable("LCOMMENT_ID", $overlay_id . "_snip");
$this->tpl->setVariable("LCOMMENT_SNIPPET", ilUtil::shortenText($lcomment_value, 25, true));
$this->tpl->setVariable("COMMENT_OVERLAY_TRIGGER_ID", $overlay_trigger_id);
$this->tpl->setVariable("COMMENT_OVERLAY_TRIGGER_TEXT", $lng->txt("exc_comment_for_learner_edit"));
$lcomment_form = new ilPropertyFormGUI();
$lcomment_form->setId($overlay_id);
$lcomment_form->setPreventDoubleSubmission(false);
$lcomment = new ilTextAreaInputGUI($lng->txt("exc_comment_for_learner"), "lcomment_" . $d["id"] . "_" . $this->part_id);
$lcomment->setInfo($lng->txt("exc_comment_for_learner_info"));
$lcomment->setValue($lcomment_value);
$lcomment->setCols(45);
$lcomment->setRows(5);
$lcomment_form->addItem($lcomment);
//$lcomment_form->addCommandButton("save", $lng->txt("save"));
// $lcomment_form->addCommandButton("cancel", $lng->txt("cancel"));
$this->overlay_tpl->setCurrentBlock("overlay_bl");
$this->overlay_tpl->setVariable("COMMENT_OVERLAY_ID", $overlay_id);
$this->overlay_tpl->setVariable("COMMENT_OVERLAY_FORM", $lcomment_form->getHTML());
$this->overlay_tpl->parseCurrentBlock();
/*
$this->tpl->setVariable("TXT_LCOMMENT", $lng->txt("exc_comment_for_learner"));
$this->tpl->setVariable("NAME_LCOMMENT",
"lcomment[".$d["id"]."]");
$lpcomment = ilExAssignment::lookupCommentForUser($d["id"], $this->part_id);
$this->tpl->setVariable("VAL_LCOMMENT",
ilUtil::prepareFormOutput($lpcomment));
*/
// solved
//$this->tpl->setVariable("CHKBOX_SOLVED",
// ilUtil::formCheckbox($this->exc->members_obj->getStatusByMember($member_id),"solved[$member_id]",1));
//.........这里部分代码省略.........
示例9: populateQuestionSpecificFormPart
public function populateQuestionSpecificFormPart(ilPropertyFormGUI $form)
{
// cloze text
$cloze_text = new ilTextAreaInputGUI($this->lng->txt("cloze_text"), 'cloze_text');
$cloze_text->setRequired(true);
$cloze_text->setValue($this->applyIndizesToGapText($this->object->getClozeText()));
$cloze_text->setInfo($this->lng->txt("close_text_hint"));
$cloze_text->setRows(10);
$cloze_text->setCols(80);
if (!$this->object->getSelfAssessmentEditingMode()) {
if ($this->object->getAdditionalContentEditingMode() == assQuestion::ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT) {
$cloze_text->setUseRte(TRUE);
include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
$cloze_text->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("assessment"));
$cloze_text->addPlugin("latex");
$cloze_text->addButton("latex");
$cloze_text->addButton("pastelatex");
}
} else {
$cloze_text->setUseRte(TRUE);
$cloze_text->setRteTags(self::getSelfAssessmentTags());
$cloze_text->setUseTagsForRteOnly(false);
}
$cloze_text->setRTESupport($this->object->getId(), "qpl", "assessment");
$form->addItem($cloze_text);
$tpl = new ilTemplate("tpl.il_as_qpl_cloze_gap_button_code.html", TRUE, TRUE, "Modules/TestQuestionPool");
$tpl->setVariable('INSERT_GAP', $this->lng->txt('insert_gap'));
$tpl->setVariable('CREATE_GAPS', $this->lng->txt('create_gaps'));
$tpl->parseCurrentBlock();
$button = new ilCustomInputGUI(' ', '');
$button->setHtml($tpl->get());
$form->addItem($button);
// text rating
if (!$this->object->getSelfAssessmentEditingMode()) {
$textrating = new ilSelectInputGUI($this->lng->txt("text_rating"), "textgap_rating");
$text_options = array("ci" => $this->lng->txt("cloze_textgap_case_insensitive"), "cs" => $this->lng->txt("cloze_textgap_case_sensitive"), "l1" => sprintf($this->lng->txt("cloze_textgap_levenshtein_of"), "1"), "l2" => sprintf($this->lng->txt("cloze_textgap_levenshtein_of"), "2"), "l3" => sprintf($this->lng->txt("cloze_textgap_levenshtein_of"), "3"), "l4" => sprintf($this->lng->txt("cloze_textgap_levenshtein_of"), "4"), "l5" => sprintf($this->lng->txt("cloze_textgap_levenshtein_of"), "5"));
$textrating->setOptions($text_options);
$textrating->setValue($this->object->getTextgapRating());
$form->addItem($textrating);
// text field length
$fixedTextLength = new ilNumberInputGUI($this->lng->txt("cloze_fixed_textlength"), "fixedTextLength");
$ftl = $this->object->getFixedTextLength();
$fixedTextLength->setValue($ftl > 0 ? $ftl : '');
$fixedTextLength->setMinValue(0);
$fixedTextLength->setSize(3);
$fixedTextLength->setMaxLength(6);
$fixedTextLength->setInfo($this->lng->txt('cloze_fixed_textlength_description'));
$fixedTextLength->setRequired(false);
$form->addItem($fixedTextLength);
// identical scoring
$identical_scoring = new ilCheckboxInputGUI($this->lng->txt("identical_scoring"), "identical_scoring");
$identical_scoring->setValue(1);
$identical_scoring->setChecked($this->object->getIdenticalScoring());
$identical_scoring->setInfo($this->lng->txt('identical_scoring_desc'));
$identical_scoring->setRequired(FALSE);
$form->addItem($identical_scoring);
}
return $form;
}
示例10: initFormNewsItem
/**
* FORM NewsItem: Init form.
*
* @param int $a_mode Form Edit Mode (IL_FORM_EDIT | IL_FORM_CREATE)
*/
public function initFormNewsItem($a_mode)
{
global $lng;
$lng->loadLanguageModule("news");
include "Services/Form/classes/class.ilPropertyFormGUI.php";
$this->form_gui = new ilPropertyFormGUI();
// Property Title
$text_input = new ilTextInputGUI($lng->txt("news_news_item_title"), "news_title");
$text_input->setInfo("");
$text_input->setRequired(true);
$text_input->setMaxLength(200);
$this->form_gui->addItem($text_input);
// Property Content
$text_area = new ilTextAreaInputGUI($lng->txt("news_news_item_content"), "news_content");
$text_area->setInfo("");
$text_area->setRequired(false);
$this->form_gui->addItem($text_area);
// Property Visibility
$radio_group = new ilRadioGroupInputGUI($lng->txt("news_news_item_visibility"), "news_visibility");
$radio_option = new ilRadioOption($lng->txt("news_visibility_users"), "users");
$radio_group->addOption($radio_option);
$radio_option = new ilRadioOption($lng->txt("news_visibility_public"), "public");
$radio_group->addOption($radio_option);
$radio_group->setInfo($lng->txt("news_news_item_visibility_info"));
$radio_group->setRequired(false);
$radio_group->setValue("users");
$this->form_gui->addItem($radio_group);
// Property ContentLong
$text_area = new ilTextAreaInputGUI($lng->txt("news_news_item_content_long"), "news_content_long");
$text_area->setInfo($lng->txt("news_news_item_content_long_info"));
$text_area->setRequired(false);
$text_area->setCols("40");
$text_area->setRows("8");
$text_area->setUseRte(true);
$this->form_gui->addItem($text_area);
// save and cancel commands
if (in_array($a_mode, array(IL_FORM_CREATE, IL_FORM_RE_CREATE))) {
$this->form_gui->addCommandButton("saveNewsItem", $lng->txt("save"));
$this->form_gui->addCommandButton("cancelSaveNewsItem", $lng->txt("cancel"));
} else {
$this->form_gui->addCommandButton("updateNewsItem", $lng->txt("save"));
$this->form_gui->addCommandButton("cancelUpdateNewsItem", $lng->txt("cancel"));
}
$this->form_gui->setTitle($lng->txt("news_news_item_head"));
$this->form_gui->setFormAction($this->ctrl->getFormAction($this));
$this->prepareFormNewsItem($this->form_gui);
}
示例11: initInfoEditor
/**
* init info editor
*
* @access protected
* @return
*/
protected function initInfoEditor()
{
if (is_object($this->form)) {
return true;
}
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$this->form = new ilPropertyFormGUI();
$this->form->setFormAction($this->ctrl->getFormAction($this, 'updateInfo'));
$this->form->setTitle($this->lng->txt('grp_general_informations'));
$this->form->addCommandButton('updateInfo', $this->lng->txt('save'));
$this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
$area = new ilTextAreaInputGUI($this->lng->txt('grp_information'), 'important');
$area->setInfo($this->lng->txt('grp_information_info'));
$area->setValue($this->object->getInformation());
$area->setRows(8);
$area->setCols(80);
$this->form->addItem($area);
}
示例12: initForm
/**
* Init your form
*
*/
protected function initForm()
{
$title = $this->setting->getId() ? sprintf($this->pl->txt('edit_setting'), $this->setting->getIdentifier()) : $this->pl->txt('add_new_custom_setting');
$this->setTitle($title);
$item = new ilHiddenInputGUI('custom_setting_id');
$item->setValue($this->setting->getId());
$this->addItem($item);
$item = new ilTextInputGUI($this->pl->txt('identifier'), 'identifier');
$item->setRequired(true);
$item->setValue($this->setting->getIdentifier());
$item->setInfo(sprintf($this->pl->txt('identifier_info'), srCertificatePlaceholder::REGEX_VALID_IDENTIFIER));
$this->addItem($item);
$item = new ilRadioGroupInputGUI($this->pl->txt('custom_setting_type'), 'setting_type_id');
$item->setRequired(true);
$option = new ilRadioOption($this->pl->txt('custom_setting_type_' . srCertificateCustomTypeSetting::SETTING_TYPE_BOOLEAN), srCertificateCustomTypeSetting::SETTING_TYPE_BOOLEAN);
$item->addOption($option);
$option = new ilRadioOption($this->pl->txt('custom_setting_type_' . srCertificateCustomTypeSetting::SETTING_TYPE_SELECT), srCertificateCustomTypeSetting::SETTING_TYPE_SELECT);
$subitem = new ilTextAreaInputGUI($this->pl->txt('custom_setting_type_2_data'), 'data');
$subitem->setValue($this->setting->getData());
$subitem->setInfo($this->pl->txt('custom_setting_type_2_data_info'));
$option->addSubItem($subitem);
$item->setValue($this->setting->getSettingTypeId());
$item->addOption($option);
$this->addItem($item);
$item = new ilTextInputGUI($this->pl->txt('default_value'), "value");
$item->setInfo($this->pl->txt('custom_setting_default_value_info'));
$item->setValue($this->setting->getValue());
$this->addItem($item);
$item = new ilMultiSelectInputGUI($this->pl->txt('editable_in'), 'editable_in');
$options = array();
foreach (srCertificateType::getAllAvailableObjectTypes() as $type) {
$options[$type] = $type;
}
$item->setOptions($options);
$item->setValue($this->setting->getEditableIn());
$this->addItem($item);
// Update definitions, add settings
if (!$this->setting->getId()) {
$item = new ilCheckboxInputGUI($this->pl->txt('update_cert_definitions'), 'update_definitions');
$item->setInfo($this->pl->txt('custom_setting_update_cert_definitions_info'));
$this->addItem($item);
}
// Label per language
/** @var srCertificateType $type */
$type = $this->setting->getId() ? srCertificateType::find($this->setting->getTypeId()) : srCertificateType::find((int) $_GET['type_id']);
foreach ($type->getLanguages() as $lang_code) {
$this->addLabelInput($lang_code);
}
}
示例13: propertiesObject
/**
* Display and fill the properties form of the test
*
* @access public
*/
function propertiesObject($checkonly = FALSE)
{
global $ilAccess;
if (!$ilAccess->checkAccess("write", "", $this->ref_id)) {
// allow only write access
ilUtil::sendInfo($this->lng->txt("cannot_edit_test"), true);
$this->ctrl->redirect($this, "infoScreen");
}
// using template?
$template_settings = null;
$template = $this->object->getTemplate();
if ($template) {
include_once "Services/Administration/classes/class.ilSettingsTemplate.php";
$template = new ilSettingsTemplate($template, ilObjAssessmentFolderGUI::getSettingsTemplateConfig());
$template_settings = $template->getSettings();
$hide_rte_switch = $template_settings["rte_switch"]["hide"];
}
$save = strcmp($this->ctrl->getCmd(), "saveProperties") == 0 ? TRUE : FALSE;
$total = $this->object->evalTotalPersons();
$this->tpl->addJavascript("./Services/JavaScript/js/Basic.js");
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setTableWidth("100%");
$form->setId("test_properties");
if (!$template || $template && $this->formShowGeneralSection($template_settings)) {
// general properties
$header = new ilFormSectionHeaderGUI();
$header->setTitle($this->lng->txt("tst_general_properties"));
$form->addItem($header);
}
// title & description (meta data)
include_once 'Services/MetaData/classes/class.ilMD.php';
$md_obj = new ilMD($this->object->getId(), 0, "tst");
$md_section = $md_obj->getGeneral();
$title = new ilTextInputGUI($this->lng->txt("title"), "title");
$title->setRequired(true);
$title->setValue($md_section->getTitle());
$form->addItem($title);
$ids = $md_section->getDescriptionIds();
if ($ids) {
$desc_obj = $md_section->getDescription(array_pop($ids));
$desc = new ilTextAreaInputGUI($this->lng->txt("description"), "description");
$desc->setCols(50);
$desc->setRows(4);
$desc->setValue($desc_obj->getDescription());
$form->addItem($desc);
}
// anonymity
$anonymity = new ilRadioGroupInputGUI($this->lng->txt('tst_anonymity'), 'anonymity');
if ($total) {
$anonymity->setDisabled(true);
}
$rb = new ilRadioOption($this->lng->txt('tst_anonymity_no_anonymization'), 0);
$anonymity->addOption($rb);
$rb = new ilRadioOption($this->lng->txt('tst_anonymity_anonymous_test'), 1);
$anonymity->addOption($rb);
$anonymity->setValue((int) $this->object->getAnonymity());
$form->addItem($anonymity);
// random selection of questions
$random = new ilCheckboxInputGUI($this->lng->txt("tst_random_selection"), "random_test");
$random->setValue(1);
if ($total) {
$random->setDisabled(true);
}
$random->setChecked($this->object->isRandomTest());
$info = $this->lng->txt("tst_random_test_description");
if ($this->object->hasQuestionsWithoutQuestionpool()) {
$info .= $this->lng->txt("tst_random_test_description_warning");
}
$random->setInfo($info);
$form->addItem($random);
// pool usage
$pool_usage = new ilCheckboxInputGUI($this->lng->txt("test_question_pool_usage"), "use_pool");
$pool_usage->setValue(1);
$pool_usage->setChecked($this->object->getPoolUsage());
$form->addItem($pool_usage);
// activation/availability (no template support yet)
include_once "Services/Object/classes/class.ilObjectActivation.php";
$this->lng->loadLanguageModule('rep');
$section = new ilFormSectionHeaderGUI();
$section->setTitle($this->lng->txt('rep_activation_availability'));
$form->addItem($section);
// additional info only with multiple references
$act_obj_info = $act_ref_info = "";
if (sizeof(ilObject::_getAllReferences($this->object->getId())) > 1) {
$act_obj_info = ' ' . $this->lng->txt('rep_activation_online_object_info');
$act_ref_info = $this->lng->txt('rep_activation_access_ref_info');
}
$online = new ilCheckboxInputGUI($this->lng->txt('rep_activation_online'), 'online');
$online->setChecked($this->object->isOnline());
$online->setInfo($this->lng->txt('tst_activation_online_info') . $act_obj_info);
$form->addItem($online);
$act_type = new ilRadioGroupInputGUI($this->lng->txt('rep_activation_access'), 'activation_type');
$act_type->setInfo($act_ref_info);
//.........这里部分代码省略.........
示例14: settings
public function settings()
{
global $rbacreview;
$this->tabs_gui->setSubTabActive('shib_settings');
// set already saved data or default value for port
$settings = $this->ilias->getAllSettings();
// Compose role list
$role_list = $rbacreview->getRolesByFilter(2);
$role = array();
if (!isset($settings["shib_user_default_role"])) {
$settings["shib_user_default_role"] = 4;
}
if (!isset($settings["shib_idp_list"]) || $settings["shib_idp_list"] == '') {
$settings["shib_idp_list"] = "urn:mace:organization1:providerID, Example Organization 1\nurn:mace:organization2:providerID, Example Organization 2, /Shibboleth.sso/WAYF/SWITCHaai";
}
if (!isset($settings["shib_login_button"]) || $settings["shib_login_button"] == '') {
$settings["shib_login_button"] = "templates/default/images/shib_login_button.png";
}
if (!isset($settings["shib_hos_type"]) || $settings["shib_hos_type"] == '') {
$settings["shib_hos_type"] = 'internal_wayf';
}
foreach ($role_list as $data) {
$role[$data["obj_id"]] = $data["title"];
}
// Set text field content
$shib_settings = array('shib_login', 'shib_title', 'shib_firstname', 'shib_lastname', 'shib_email', 'shib_gender', 'shib_institution', 'shib_department', 'shib_zipcode', 'shib_city', 'shib_country', 'shib_street', 'shib_phone_office', 'shib_phone_home', 'shib_phone_mobile', 'shib_language', 'shib_matriculation');
//set PropertyFormGUI
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$propertys = new ilPropertyFormGUI();
$propertys->setTitle($this->lng->txt("shib"));
$propertys->setFormAction($this->ctrl->getFormAction($this, "save"));
$propertys->addCommandButton("save", $this->lng->txt("save"));
$propertys->addCommandButton("settings", $this->lng->txt("cancel"));
//set enable shibboleth support
$enable = new ilCheckboxInputGUI();
$enable->setTitle($this->lng->txt("shib_active"));
$read_me_link = "./Services/AuthShibboleth/README.SHIBBOLETH.txt";
$info = "<a href='" . $read_me_link . "' target='_blank'>" . $this->lng->txt("auth_shib_instructions") . "</a>";
$enable->setInfo($info);
$enable->setPostVar("shib[active]");
$enable->setChecked($settings["shib_active"]);
//set allow local authentication
$local = new ilCheckboxInputGUI();
$local->setTitle($this->lng->txt("auth_allow_local"));
$local->setPostVar("shib[auth_allow_local]");
$local->setChecked($settings['shib_auth_allow_local']);
//set user default role
$defaultrole = new ilSelectInputGUI();
$defaultrole->setTitle($this->lng->txt("shib_user_default_role"));
$defaultrole->setPostVar("shib[user_default_role]");
$defaultrole->setOptions($role);
$defaultrole->setRequired(true);
$defaultrole->setValue($settings["shib_user_default_role"]);
//set name of federation
$name = new ilTextInputGUI();
$name->setTitle($this->lng->txt("shib_federation_name"));
$name->setPostVar("shib[federation_name]");
$name->setSize(40);
$name->setMaxLength(50);
$name->setRequired(true);
$name->setValue(stripslashes($settings["shib_federation_name"]));
//set Organize selection group
include_once "./Services/Form/classes/class.ilRadioGroupInputGUI.php";
include_once "./Services/Form/classes/class.ilRadioOption.php";
$organize = new ilRadioGroupInputGUI();
$organize->setTitle($this->lng->txt("shib_login_type"));
$organize->setPostVar("shib[hos_type]");
$organize->setRequired(true);
$organize->setValue($settings["shib_hos_type"]);
//set 1. option internalwayf
$internalwayf = new ilRadioOption();
$internalwayf->setTitle($this->lng->txt("shib_login_internal_wayf"));
$internalwayf->setValue("internal_wayf");
//set 1. option internalwayf textbox idplist
$idplist = new ilTextAreaInputGUI();
$idplist->setInfo($this->lng->txt("shib_idp_list"));
$idplist->setPostVar("shib[idp_list]");
$idplist->setRows(3);
$idplist->setCols(50);
$idplist->setValue($settings["shib_idp_list"]);
//set 2. Option externalwayf
$externalwayf = new ilRadioOption();
$externalwayf->setTitle($this->lng->txt("shib_login_external_wayf"));
$externalwayf->setValue("external_wayf");
//set 2. Option externalwayf textfield path to login button image
$loginbutton = new ilTextInputGUI();
$loginbutton->setInfo($this->lng->txt("shib_login_button"));
$loginbutton->setPostVar("shib[login_button]");
$loginbutton->setSize(50);
$loginbutton->setMaxLength(255);
$loginbutton->setValue($settings["shib_login_button"]);
//set 3. Option embeddedwayf
$embeddedwayf = new ilRadioOption();
$embeddedwayf->setTitle($this->lng->txt("shib_login_embedded_wayf"));
$embeddedwayf->setInfo($this->lng->txt("shib_login_embedded_wayf_description"));
$embeddedwayf->setValue("embedded_wayf");
//set login instructions
$logininstruction = new ilTextAreaInputGUI();
$logininstruction->setTitle($this->lng->txt("auth_login_instructions"));
$logininstruction->setPostVar("shib[login_instructions]");
//.........这里部分代码省略.........
示例15: 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;
}