当前位置: 首页>>代码示例>>PHP>>正文


PHP ilFileInputGUI::setRequired方法代码示例

本文整理汇总了PHP中ilFileInputGUI::setRequired方法的典型用法代码示例。如果您正苦于以下问题:PHP ilFileInputGUI::setRequired方法的具体用法?PHP ilFileInputGUI::setRequired怎么用?PHP ilFileInputGUI::setRequired使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ilFileInputGUI的用法示例。


在下文中一共展示了ilFileInputGUI::setRequired方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: initForm

 protected function initForm($submit_action)
 {
     $form = new ilPropertyFormGUI();
     $input = new ilFileInputGUI($this->lng->txt("import_xml_file"), "import_file");
     $input->setRequired(true);
     $form->addItem($input);
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->addCommandButton($submit_action, $this->lng->txt("import"));
     return $form;
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:10,代码来源:class.ilOrgUnitSimpleImportGUI.php

示例2: 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(TRUE);
     $form->setTableWidth("100%");
     $form->setId("assimagemap");
     // title, author, description, question, working time (assessment mode)
     $this->addBasicQuestionFormProperties($form);
     // image
     include_once "./Modules/TestQuestionPool/classes/class.ilImagemapFileInputGUI.php";
     $image = new ilImagemapFileInputGUI($this->lng->txt('image'), 'image');
     $image->setRequired(true);
     if (strlen($this->object->getImageFilename())) {
         $image->setImage($this->object->getImagePathWeb() . $this->object->getImageFilename());
         $image->setValue($this->object->getImageFilename());
         $image->setAreas($this->object->getAnswers());
         $assessmentSetting = new ilSetting("assessment");
         $linecolor = strlen($assessmentSetting->get("imap_line_color")) ? "\"#" . $assessmentSetting->get("imap_line_color") . "\"" : "\"#FF0000\"";
         $image->setLineColor($linecolor);
         $image->setImagePath($this->object->getImagePath());
         $image->setImagePathWeb($this->object->getImagePathWeb());
     }
     $form->addItem($image);
     // imagemapfile
     $imagemapfile = new ilFileInputGUI($this->lng->txt('add_imagemap'), 'imagemapfile');
     $imagemapfile->setRequired(false);
     $form->addItem($imagemapfile);
     $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;
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:53,代码来源:class.assImagemapQuestionGUI.php

示例3: initMultiFeedbackForm

 function initMultiFeedbackForm($a_ass_id)
 {
     global $lng;
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->addCommandButton("uploadMultiFeedback", $lng->txt("upload"));
     $form->addCommandButton("members", $lng->txt("cancel"));
     // multi feedback file
     $fi = new ilFileInputGUI($lng->txt("exc_multi_feedback_file"), "mfzip");
     $fi->setSuffixes(array("zip"));
     $fi->setRequired(true);
     $form->addItem($fi);
     $form->setTitle(ilExAssignment::lookupTitle($a_ass_id));
     $form->setFormAction($this->ctrl->getFormAction($this, "uploadMultiFeedback"));
     return $form;
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:16,代码来源:class.ilObjExerciseGUI.php

示例4: populateQuestionSpecificFormPart

 public function populateQuestionSpecificFormPart(\ilPropertyFormGUI $form)
 {
     // points
     $points = new ilNumberInputGUI($this->lng->txt("points"), "points");
     $points->setValue($this->object->getPoints());
     $points->setRequired(TRUE);
     $points->setSize(3);
     $points->setMinValue(0.0);
     $form->addItem($points);
     $header = new ilFormSectionHeaderGUI();
     $header->setTitle($this->lng->txt("applet_attributes"));
     $form->addItem($header);
     // java applet
     $javaapplet = $this->object->getJavaAppletFilename();
     $applet = new ilFileInputGUI($this->lng->txt('javaapplet'), 'javaappletName');
     $applet->setSuffixes(array('jar', 'class'));
     $applet->setRequired(false);
     if (strlen($javaapplet)) {
         $filename = new ilNonEditableValueGUI($this->lng->txt('filename'), 'uploaded_javaapplet');
         $filename->setValue($javaapplet);
         $applet->addSubItem($filename);
         $delete = new ilCheckboxInputGUI('', 'delete_applet');
         $delete->setOptionTitle($this->lng->txt('delete'));
         $delete->setValue(1);
         $applet->addSubItem($delete);
     }
     $form->addItem($applet);
     // Code
     $code = new ilTextInputGUI($this->lng->txt("code"), "java_code");
     $code->setValue($this->object->getJavaCode());
     $code->setRequired(TRUE);
     $form->addItem($code);
     if (!strlen($javaapplet)) {
         // Archive
         $archive = new ilTextInputGUI($this->lng->txt("archive"), "java_archive");
         $archive->setValue($this->object->getJavaArchive());
         $archive->setRequired(false);
         $form->addItem($archive);
         // Codebase
         $codebase = new ilTextInputGUI($this->lng->txt("codebase"), "java_codebase");
         $codebase->setValue($this->object->getJavaCodebase());
         $codebase->setRequired(false);
         $form->addItem($codebase);
     }
     // Width
     $width = new ilNumberInputGUI($this->lng->txt("width"), "java_width");
     $width->setDecimals(0);
     $width->setSize(6);
     $width->setMinValue(50);
     $width->setMaxLength(6);
     $width->setValue($this->object->getJavaWidth());
     $width->setRequired(TRUE);
     $form->addItem($width);
     // Height
     $height = new ilNumberInputGUI($this->lng->txt("height"), "java_height");
     $height->setDecimals(0);
     $height->setSize(6);
     $height->setMinValue(50);
     $height->setMaxLength(6);
     $height->setValue($this->object->getJavaHeight());
     $height->setRequired(TRUE);
     $form->addItem($height);
     $header = new ilFormSectionHeaderGUI();
     $header->setTitle($this->lng->txt("applet_parameters"));
     $form->addItem($header);
     include_once "./Modules/TestQuestionPool/classes/class.ilKVPWizardInputGUI.php";
     $kvp = new ilKVPWizardInputGUI($this->lng->txt("applet_parameters"), "kvp");
     $values = array();
     for ($i = 0; $i < $this->object->getParameterCount(); $i++) {
         $param = $this->object->getParameter($i);
         array_push($values, array($param['name'], $param['value']));
     }
     if (count($values) == 0) {
         array_push($values, array("", ""));
     }
     $kvp->setKeyName($this->lng->txt('name'));
     $kvp->setValueName($this->lng->txt('value'));
     $kvp->setValues($values);
     $form->addItem($kvp);
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:80,代码来源:class.assJavaAppletGUI.php

示例5: initImportForm

 /**
  * Init import form.
  */
 public function initImportForm()
 {
     global $lng, $ilCtrl;
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $new_type = $_POST["new_type"] ? $_POST["new_type"] : $_GET["new_type"];
     $this->ctrl->setParameter($this, "new_type", $new_type);
     $form->setTarget(ilFrameTargetInfo::_getFrame("MainContent"));
     $form->setTableWidth("600px");
     // import file
     $fi = new ilFileInputGUI($this->lng->txt("file"), "xmldoc");
     $fi->setSuffixes(array("zip"));
     $fi->setRequired(true);
     $fi->setSize(30);
     $form->addItem($fi);
     // validation
     $cb = new ilCheckboxInputGUI($this->lng->txt("cont_validate_file"), "validate");
     $cb->setInfo($this->lng->txt(""));
     $form->addItem($cb);
     $form->addCommandButton("importFile", $lng->txt("import"));
     $form->addCommandButton("cancel", $lng->txt("cancel"));
     $form->setTitle($this->lng->txt("import_" . $new_type));
     $form->setFormAction($ilCtrl->getFormAction($this));
     return $form;
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:28,代码来源:class.ilObjContentObjectGUI.php

示例6: 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");
//.........这里部分代码省略.........
开发者ID:arlendotcn,项目名称:ilias,代码行数:101,代码来源:class.ilCertificateGUI.php

示例7: initPageLayoutImportForm

 /**
  * Init page layout import form.
  */
 public function initPageLayoutImportForm()
 {
     global $lng, $ilCtrl;
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     // template file
     $fi = new ilFileInputGUI($lng->txt("file"), "file");
     $fi->setSuffixes(array("zip"));
     $fi->setRequired(true);
     $form->addItem($fi);
     $form->addCommandButton("importPageLayout", $lng->txt("import"));
     $form->addCommandButton("viewPageLayouts", $lng->txt("cancel"));
     $form->setTitle($lng->txt("sty_import_page_layout"));
     $form->setFormAction($ilCtrl->getFormAction($this));
     return $form;
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:19,代码来源:class.ilObjStyleSettingsGUI.php

示例8: initImportForm

 /**
  * show import form
  *
  * @access protected
  */
 protected function initImportForm()
 {
     if (is_object($this->import_form)) {
         return true;
     }
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->import_form = new ilPropertyFormGUI();
     $this->import_form->setMultipart(true);
     $this->import_form->setFormAction($this->ctrl->getFormAction($this));
     // add file property
     $file = new ilFileInputGUI($this->lng->txt('file'), 'file');
     $file->setSuffixes(array('xml'));
     $file->setRequired(true);
     $this->import_form->addItem($file);
     $this->import_form->setTitle($this->lng->txt('md_adv_import_record'));
     $this->import_form->addCommandButton('importRecord', $this->lng->txt('import'));
     $this->import_form->addCommandButton('showRecords', $this->lng->txt('cancel'));
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:23,代码来源:class.ilAdvancedMDSettingsGUI.php

示例9: initEditForm

 public function initEditForm()
 {
     global $lng;
     $form = parent::initEditForm();
     // Add File-Upload
     $in_file = new ilFileInputGUI($lng->txt("bibliography file"), "bibliographic_file");
     $in_file->setSuffixes(array("ris", "bib", "bibtex"));
     $in_file->setRequired(false);
     $cb_override = new ilCheckboxInputGUI($this->lng->txt("override_entries"), "override_entries");
     $cb_override->addSubItem($in_file);
     $form->addItem($cb_override);
     $form->setFormAction($this->ctrl->getFormAction($this, "save"));
     return $form;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:14,代码来源:class.ilObjBibliographicGUI.php

示例10: showAttachments

 public function showAttachments()
 {
     /**
      * @var $ilToolbar ilToolbarGUI
      */
     global $ilToolbar;
     $this->tpl->setTitle($this->lng->txt('mail'));
     require_once 'Services/Form/classes/class.ilFileInputGUI.php';
     $attachment = new ilFileInputGUI($this->lng->txt('upload'), 'userfile');
     $attachment->setRequired(true);
     $attachment->setSize(20);
     $ilToolbar->setFormAction($this->ctrl->getFormAction($this, 'uploadFile'), true);
     $ilToolbar->addInputItem($attachment);
     $ilToolbar->addFormButton($this->lng->txt('upload'), 'uploadFile');
     require_once 'Services/Mail/classes/class.ilMailAttachmentTableGUI.php';
     $table = new ilMailAttachmentTableGUI($this, 'showAttachments');
     $mailData = $this->umail->getSavedData();
     $files = $this->mfile->getUserFilesData();
     $data = array();
     $counter = 0;
     foreach ($files as $file) {
         $checked = false;
         if (is_array($mailData['attachments']) && in_array($file['name'], $mailData['attachments'])) {
             $checked = true;
         }
         $data[$counter] = array('checked' => $checked, 'filename' => $file['name'], 'filesize' => (int) $file['size'], 'filecreatedate' => (int) $file['ctime']);
         ++$counter;
     }
     $table->setData($data);
     $this->tpl->setContent($table->getHtml());
     $this->tpl->show();
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:32,代码来源:class.ilMailAttachmentGUI.php

示例11: populateQuestionSpecificFormPart

 public function populateQuestionSpecificFormPart(\ilPropertyFormGUI $form)
 {
     // is MultipleChoice?
     $radioGroup = new ilRadioGroupInputGUI($this->lng->txt('tst_imap_qst_mode'), 'is_multiple_choice');
     $radioGroup->setValue($this->object->getIsMultipleChoice());
     $modeSingleChoice = new ilRadioOption($this->lng->txt('tst_imap_qst_mode_sc'), assImagemapQuestion::MODE_SINGLE_CHOICE);
     $modeMultipleChoice = new ilRadioOption($this->lng->txt('tst_imap_qst_mode_mc'), assImagemapQuestion::MODE_MULTIPLE_CHOICE);
     $radioGroup->addOption($modeSingleChoice);
     $radioGroup->addOption($modeMultipleChoice);
     $form->addItem($radioGroup);
     // image
     include_once "./Modules/TestQuestionPool/classes/class.ilImagemapFileInputGUI.php";
     $image = new ilImagemapFileInputGUI($this->lng->txt('image'), 'image');
     $image->setPointsUncheckedFieldEnabled($this->object->getIsMultipleChoice());
     $image->setRequired(true);
     if (strlen($this->object->getImageFilename())) {
         $image->setImage($this->object->getImagePathWeb() . $this->object->getImageFilename());
         $image->setValue($this->object->getImageFilename());
         $image->setAreas($this->object->getAnswers());
         $assessmentSetting = new ilSetting("assessment");
         $linecolor = strlen($assessmentSetting->get("imap_line_color")) ? "\"#" . $assessmentSetting->get("imap_line_color") . "\"" : "\"#FF0000\"";
         $image->setLineColor($linecolor);
         $image->setImagePath($this->object->getImagePath());
         $image->setImagePathWeb($this->object->getImagePathWeb());
     }
     $form->addItem($image);
     // imagemapfile
     $imagemapfile = new ilFileInputGUI($this->lng->txt('add_imagemap'), 'imagemapfile');
     $imagemapfile->setRequired(false);
     $form->addItem($imagemapfile);
     return $form;
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:32,代码来源:class.assImagemapQuestionGUI.php

示例12: importQuestionsObject

 /**
  * display the import form to import questions into the questionpool
  */
 public function importQuestionsObject()
 {
     global $tpl;
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this, "uploadQuestions"));
     $form->setTitle($this->lng->txt("import_question"));
     include_once "./Services/Form/classes/class.ilFileInputGUI.php";
     $fi = new ilFileInputGUI($this->lng->txt("select_file"), "qtidoc");
     $fi->setSuffixes(array("xml", "zip"));
     $fi->setRequired(true);
     $form->addItem($fi);
     $form->addCommandButton("uploadQuestions", $this->lng->txt("import"));
     $form->addCommandButton("questions", $this->lng->txt("cancel"));
     $tpl->setContent($form->getHTML());
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:19,代码来源:class.ilObjSurveyQuestionPoolGUI.php

示例13: initFormContent

 /**
  * Shows a form to add or edit content
  *
  * @param int $a_mode
  * @param int $a_content_id optional content id
  * @access protected
  */
 protected function initFormContent($a_mode, $a_content_id = 0)
 {
     if ($this->cform instanceof ilPropertyFormGUI) {
         return;
     }
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $this->cform = new ilPropertyFormGUI();
     switch ($a_mode) {
         case self::CONTENT_MOD_EDIT:
             $positive_cmd = $this->is_record ? 'updateRecord' : 'updateContent';
             // Header
             $this->ctrl->setParameter($this, 'content_id', (int) $_REQUEST['content_id']);
             $this->cform->setTitle($this->txt('edit_content'));
             // Buttons
             $this->cform->addCommandButton($positive_cmd, $this->txt('save'));
             $this->cform->addCommandButton('showContent', $this->txt('cancel'));
             // Form action
             if ($a_content_id) {
                 $this->ctrl->setParameter($this, 'content_id', $a_content_id);
             }
             $this->cform->setFormAction($this->ctrl->getFormAction($this, $positive_cmd));
             break;
         case self::CONTENT_MOD_ADD:
             // Header
             $this->cform->setTitle($this->txt('add_new_content'));
             // Buttons
             $this->cform->addCommandButton('addContent', $this->txt('save'));
             $this->cform->addCommandButton('showContent', $this->txt('cancel'));
             // Form action
             $this->cform->setFormAction($this->ctrl->getFormAction($this, 'addContent'));
             break;
     }
     // Title
     $tit = new ilTextInputGUI($this->txt('title'), 'tit');
     //		$tit->setRequired(true);
     $tit->setSize(40);
     $tit->setMaxLength(127);
     $this->cform->addItem($tit);
     // Description
     $des = new ilTextAreaInputGUI($this->txt('description'), 'des');
     $des->setRows(3);
     $this->cform->addItem($des);
     if ($this->is_record == false) {
         // File
         $fil = new ilFileInputGUI($this->txt('file'), 'file');
         if ($a_mode == self::CONTENT_MOD_ADD) {
             $fil->setRequired(true);
         }
         $content_file_types = strlen(ilAdobeConnectServer::getSetting('content_file_types')) > 1 ? ilAdobeConnectServer::getSetting('content_file_types') : 'ppt, pptx, flv, swf, pdf, gif, jpg, png, mp3, html';
         $fil->setSuffixes(explode(',', str_replace(' ', '', $content_file_types)));
         $this->cform->addItem($fil);
     }
 }
开发者ID:KamuiXenom,项目名称:ILIAS_AdobeConnectPlugin,代码行数:60,代码来源:class.ilObjAdobeConnectGUI.php

示例14: createFileInputFormItem

 /**
  * Creates an input field for floor plans that should be uploaded.
  *
  * @return ilFileInputGUI file input form item
  */
 protected function createFileInputFormItem()
 {
     $file = new ilFileInputGUI($this->lng->txt("rep_robj_xrs_room_floor_plans"), "upload_file");
     $file->setSize(50);
     $file->setRequired(true);
     $file->setALlowDeletion(true);
     $file->setInfo($this->lng->txt("rep_robj_xrs_floor_plans_filetypes") . " .bmp, .jpg, .jpeg, .png, .gif");
     return $file;
 }
开发者ID:studer-raimann,项目名称:RoomSharing,代码行数:14,代码来源:class.ilRoomSharingFloorPlansGUI.php

示例15: initEditForm

 /**
  * Init edit form
  *
  * @param        int        $a_mode        Edit Mode
  */
 public function initEditForm($a_mode = "edit")
 {
     global $lng, $ilCtrl, $ilUser;
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     if ($a_mode != "add_file") {
         // title
         $ti = new ilTextInputGUI($lng->txt("title"), "flst_title");
         $ti->setMaxLength(80);
         $ti->setSize(40);
         $form->addItem($ti);
         // language
         require_once "Services/MetaData/classes/class.ilMDLanguageItem.php";
         $lang = ilMDLanguageItem::_getLanguages();
         $si = new ilSelectInputGUI($lng->txt("language"), "flst_language");
         $si->setOptions($lang);
         $form->addItem($si);
     }
     if (in_array($a_mode, array("create", "add_file"))) {
         // file
         $fi = new ilFileInputGUI($lng->txt("file"), "file");
         $fi->setRequired(true);
         $form->addItem($fi);
     } else {
         if (in_array($a_mode, array("select_file"))) {
             // file
             $ne = new ilNonEditableValueGUI($lng->txt("file"), "");
             if (isset($_GET["file_ref_id"])) {
                 include_once "./Modules/File/classes/class.ilObjFile.php";
                 $file_obj = new ilObjFile((int) $_GET["file_ref_id"]);
                 if (is_object($file_obj)) {
                     // ref id as hidden input
                     $hi = new ilHiddenInputGUI("file_ref_id");
                     $hi->setValue((int) $_GET["file_ref_id"]);
                     $form->addItem($hi);
                     $ne->setValue($file_obj->getTitle());
                 }
             } else {
                 if (isset($_GET["fl_wsp_id"])) {
                     // we need the object id for the instance
                     include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
                     $tree = new ilWorkspaceTree($ilUser->getId());
                     $node = $tree->getNodeData((int) $_GET["fl_wsp_id"]);
                     include_once "./Modules/File/classes/class.ilObjFile.php";
                     $file_obj = new ilObjFile($node["obj_id"], false);
                     if (is_object($file_obj)) {
                         // ref id as hidden input
                         $hi = new ilHiddenInputGUI("file_ref_id");
                         $hi->setValue("wsp_" . (int) $node["obj_id"]);
                         $form->addItem($hi);
                         $ne->setValue($file_obj->getTitle());
                     }
                     $this->tpl->parseCurrentBlock();
                 }
             }
             $form->addItem($ne);
         }
     }
     switch ($a_mode) {
         case "edit":
             $ti->setValue($this->content_obj->getListTitle());
             $si->setValue($this->content_obj->getLanguage());
             $form->addCommandButton("saveProperties", $lng->txt("save"));
             $form->addCommandButton("cancelUpdate", $lng->txt("cancel"));
             $form->setTitle($lng->txt("cont_edit_file_list_properties"));
             break;
         case "create":
         case "select_file":
             if ($_SESSION["il_text_lang_" . $_GET["ref_id"]] != "") {
                 $s_lang = $_SESSION["il_text_lang_" . $_GET["ref_id"]];
             } else {
                 $s_lang = $ilUser->getLanguage();
             }
             $si->setValue($s_lang);
             $form->addCommandButton("create_flst", $lng->txt("save"));
             $form->addCommandButton("cancelCreate", $lng->txt("cancel"));
             $form->setTitle($lng->txt("cont_insert_file_list"));
             break;
         case "add_file":
             $form->addCommandButton("insertNewFileItem", $lng->txt("save"));
             $form->addCommandButton("editFiles", $lng->txt("cancel"));
             $form->setTitle($lng->txt("cont_insert_file_item"));
             break;
     }
     $form->setFormAction($ilCtrl->getFormAction($this));
     return $form;
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:92,代码来源:class.ilPCFileListGUI.php


注:本文中的ilFileInputGUI::setRequired方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。