/** * Edit news settings. */ public function editSettings() { global $ilCtrl, $lng, $ilSetting, $ilTabs, $ilToolbar; $ilTabs->activateTab("settings"); if (OH_REF_ID > 0) { ilUtil::sendInfo("This installation is used for online help authoring. Help modules cannot be imported."); return; } if ($this->checkPermissionBool("write")) { // help file include_once "./Services/Form/classes/class.ilFileInputGUI.php"; $fi = new ilFileInputGUI($lng->txt("help_help_file"), "help_file"); $fi->setSuffixes(array("zip")); $ilToolbar->addInputItem($fi, true); $ilToolbar->addFormButton($lng->txt("upload"), "uploadHelpFile"); $ilToolbar->addSeparator(); // help mode include_once "./Services/Form/classes/class.ilSelectInputGUI.php"; $options = array("" => $lng->txt("help_tooltips_and_help"), "1" => $lng->txt("help_help_only"), "2" => $lng->txt("help_tooltips_only")); $si = new ilSelectInputGUI($this->lng->txt("help_mode"), "help_mode"); $si->setOptions($options); $si->setValue($ilSetting->get("help_mode")); $ilToolbar->addInputItem($si); $ilToolbar->addFormButton($lng->txt("help_set_mode"), "setMode"); } $ilToolbar->setFormAction($ilCtrl->getFormAction($this), true); include_once "./Services/Help/classes/class.ilHelpModuleTableGUI.php"; $tab = new ilHelpModuleTableGUI($this, "editSettings"); $this->tpl->setContent($tab->getHTML()); }
/** * Init Social Bookmark edit/create Form * * @param ilObjectGUI $formhandlerObject taken as form target * @param int $mode "create" / "edit" */ public static function _initForm($formhandlerObject, $mode = "create", $id = 0) { global $lng, $ilCtrl; include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setMultipart(true); // File Title $in_title = new ilTextInputGUI($lng->txt("title"), "title"); $in_title->setMaxLength(128); $in_title->setSize(40); $in_title->setRequired(true); $form->addItem($in_title); // Link $in_link = new ilTextInputGUI($lng->txt("link"), "link"); $in_link->setMaxLength(300); $in_link->setSize(40); $in_link->setRequired(true); $in_link->setInfo($lng->txt('socialbm_link_description')); $form->addItem($in_link); // File $in_file = new ilFileInputGUI($lng->txt("file"), "image_file"); $in_file->setSuffixes(array('bmp', 'gif', 'jpg', 'jpeg', 'png')); $form->addItem($in_file); // Activate on submit $in_activate = new ilCheckboxInputGUI($lng->txt("activate"), "activate"); $in_activate->setValue('1'); $form->addItem($in_activate); // save and cancel commands if ($mode == "create") { $form->addCommandButton("createSocialBookmark", $lng->txt("create")); $form->addCommandButton("editSocialBookmarks", $lng->txt("cancel")); $form->setTitle($lng->txt("adm_social_bm_create")); $in_file->setRequired(true); } else { if ($mode == "update") { $in_hidden = new ilHiddenInputGUI("sbm_id", $id); $form->addItem($in_hidden); $form->addCommandButton("updateSocialBookmark", $lng->txt("update")); $form->addCommandButton("cancel", $lng->txt("cancel")); $form->setTitle($lng->txt("adm_social_bm_edit")); $in_file->setRequired(false); } } $form->setTableWidth("60%"); $form->setFormAction($ilCtrl->getFormAction($formhandlerObject)); return $form; }
/** * List subtitls files * * @param * @return */ function listSubtitleFilesObject() { global $ilToolbar, $tpl, $ilCtrl, $lng, $ilUser; $this->setPropertiesSubTabs("subtitles"); // upload file $ilToolbar->setFormAction($ilCtrl->getFormAction($this), true); include_once "./Services/Form/classes/class.ilFileInputGUI.php"; $fi = new ilFileInputGUI($lng->txt("mob_subtitle_file") . " (.srt)", "subtitle_file"); $fi->setSuffixes(array("srt")); $ilToolbar->addInputItem($fi, true); // language include_once "./Services/Form/classes/class.ilSelectInputGUI.php"; include_once "./Services/MetaData/classes/class.ilMDLanguageItem.php"; $options = ilMDLanguageItem::_getLanguages(); $si = new ilSelectInputGUI($this->lng->txt("mob_language"), "language"); $si->setOptions($options); $si->setValue($ilUser->getLanguage()); $ilToolbar->addInputItem($si, true); $ilToolbar->addFormButton($lng->txt("upload"), "uploadSubtitleFile"); include_once "./Services/MediaObjects/classes/class.ilMobSubtitleTableGUI.php"; $tab = new ilMobSubtitleTableGUI($this, "listSubtitleFiles", $this->object); $tpl->setContent($tab->getHTML()); }
/** * Create import form */ protected function initImportForm() { include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; $form = new ilPropertyFormGUI(); $form->setTitle($this->lng->txt('cal_import_tbl')); $form->setFormAction($this->ctrl->getFormAction($this)); $form->addCommandButton('uploadAppointments', $this->lng->txt('import')); $ics = new ilFileInputGUI($this->lng->txt('cal_import_file'), 'file'); $ics->setALlowDeletion(false); $ics->setSuffixes(array('ics')); $ics->setInfo($this->lng->txt('cal_import_file_info')); $form->addItem($ics); return $form; }
/** * Init object import form * * @param string new type * @return ilPropertyFormGUI */ protected function initImportForm($a_new_type) { include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setTarget("_top"); $form->setFormAction($this->ctrl->getFormAction($this, "importFile")); $form->setTitle($this->lng->txt($a_new_type . "_import")); include_once "./Services/Form/classes/class.ilFileInputGUI.php"; $fi = new ilFileInputGUI($this->lng->txt("import_file"), "importfile"); $fi->setSuffixes(array("zip")); $fi->setRequired(true); $form->addItem($fi); $form->addCommandButton("importFile", $this->lng->txt("import")); $form->addCommandButton("cancel", $this->lng->txt("cancel")); return $form; }
/** * Init user import form. * * @param int $a_mode Edit Mode */ public function initUserImportForm() { global $lng, $ilCtrl; include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form = new ilPropertyFormGUI(); // Import File include_once "./Services/Form/classes/class.ilFileInputGUI.php"; $fi = new ilFileInputGUI($lng->txt("import_file"), "importFile"); $fi->setSuffixes(array("xml", "zip")); //$fi->enableFileNameSelection(); //$fi->setInfo($lng->txt("")); $this->form->addItem($fi); $this->form->addCommandButton("importUserRoleAssignment", $lng->txt("import")); $this->form->addCommandButton("importCancelled", $lng->txt("cancel")); $this->form->setTitle($lng->txt("import_users")); $this->form->setFormAction($ilCtrl->getFormAction($this)); }
/** * 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; }
/** * Init upload form form. */ public function initZipUploadForm() { global $lng, $ilCtrl; include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form = new ilPropertyFormGUI(); // desc include_once "./Services/Form/classes/class.ilFileInputGUI.php"; $fi = new ilFileInputGUI($lng->txt("file"), "deliver"); $fi->setSuffixes(array("zip")); $this->form->addItem($fi); $this->form->addCommandButton("deliverUnzip", $lng->txt("upload")); $this->form->setTitle($lng->txt("header_zip")); $this->form->setFormAction($ilCtrl->getFormAction($this)); }
function initImportForm($a_new_type) { include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setTarget("_top"); $new_type = $_POST["new_type"] ? $_POST["new_type"] : $_GET["new_type"]; $this->ctrl->setParameter($this, "new_type", $new_type); $form->setFormAction($this->ctrl->getFormAction($this)); $form->setTitle($this->lng->txt("import_tst")); // file include_once "./Services/Form/classes/class.ilFileInputGUI.php"; $fi = new ilFileInputGUI($this->lng->txt("import_file"), "xmldoc"); $fi->setSuffixes(array("zip")); $fi->setRequired(true); $form->addItem($fi); // question pool include_once "./Modules/Test/classes/class.ilObjTest.php"; $tst = new ilObjTest(); $questionpools = $tst->getAvailableQuestionpools(TRUE, FALSE, TRUE, TRUE); if (count($questionpools)) { $options = array("-1" => $this->lng->txt("dont_use_questionpool")); foreach ($questionpools as $key => $value) { $options[$key] = $value["title"]; } $pool = new ilSelectInputGUI($this->lng->txt("select_questionpool"), "qpl"); $pool->setOptions($options); $form->addItem($pool); } $form->addCommandButton("importFile", $this->lng->txt("import")); $form->addCommandButton("cancel", $this->lng->txt("cancel")); return $form; }
/** * 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')); }
/** * init import form */ protected function initImportForm() { include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this)); $form->setTitle($this->lng->txt('rbac_import_role')); $form->addCommandButton('doImportRole', $this->lng->txt('import')); $form->addCommandButton('perm', $this->lng->txt('cancel')); $zip = new ilFileInputGUI($this->lng->txt('import_file'), 'importfile'); $zip->setSuffixes(array('zip')); $form->addItem($zip); return $form; }
/** * add the properties of a question part to the form * * @param object form object to extend * @param object question part object * @param integer counter of the question part */ private function initPartProperties($form, $part_obj = null, $counter = "1") { // Use a dummy part object for a new booking definition if (!isset($part_obj)) { $part_obj = new assAccountingQuestionPart($this->object); } // Part identifier (is 0 for a new part) $item = new ilHiddenInputGUI("parts[]"); $item->setValue($part_obj->getPartId()); $form->addItem($item); // Title $item = new ilFormSectionHeaderGUI(); $item->setTitle($this->plugin->txt('accounting_table') . ' ' . $counter); $form->addItem($item); // Position $item = new ilNumberInputGUI($this->plugin->txt('position'), 'position_' . $part_obj->getPartId()); $item->setSize(2); $item->setDecimals(1); $item->SetInfo($this->plugin->txt('position_info')); if ($part_obj->getPartId()) { $item->setValue(sprintf("%01.1f", $part_obj->getPosition())); } $form->addItem($item); // Text $item = new ilTextAreaInputGUI($this->plugin->txt("question_part"), 'text_' . $part_obj->getPartId()); $item->setValue($this->object->prepareTextareaOutput($part_obj->getText())); $item->setRows(10); $item->setCols(80); if (!$this->object->getSelfAssessmentEditingMode()) { $item->setUseRte(TRUE); include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php"; $item->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("assessment")); $item->addPlugin("latex"); $item->addButton("latex"); $item->addButton("pastelatex"); $item->setRTESupport($this->object->getId(), "qpl", "assessment"); } else { $item->setRteTags(self::getSelfAssessmentTags()); $item->setUseTagsForRteOnly(false); } $form->addItem($item); // Booking XML definition $item = new ilCustomInputGUI($this->plugin->txt('booking_xml')); $item->setInfo($this->plugin->txt('booking_xml_info')); $tpl = $this->plugin->getTemplate('tpl.il_as_qpl_accqst_edit_xml.html'); $tpl->setVariable("CONTENT", ilUtil::prepareFormOutput($part_obj->getBookingXML())); $tpl->setVariable("NAME", 'booking_xml_' . $part_obj->getPartId()); $item->setHTML($tpl->get()); // Booking file $subitem = new ilFileInputGUI($this->plugin->txt('booking_file'), "booking_file_" . $part_obj->getPartId()); $subitem->setSuffixes(array('xml')); $item->addSubItem($subitem); // Download button if (strlen($part_obj->getBookingXML())) { $tpl = $this->plugin->getTemplate('tpl.il_as_qpl_accqst_form_custom.html'); $this->ctrl->setParameter($this, 'xmltype', 'booking'); $this->ctrl->setParameter($this, 'part_id', $part_obj->getPartId()); $tpl->setCurrentBlock('button'); $tpl->setVariable('BUTTON_HREF', $this->ctrl->getLinkTarget($this, 'downloadXml')); $tpl->setVariable('BUTTON_TEXT', $this->plugin->txt('download_booking_xml')); $tpl->ParseCurrentBlock(); $subitem = new ilcustomInputGUI(''); $subitem->setHTML($tpl->get()); $item->addSubItem($subitem); } $form->addItem($item); // Delete Button if ($part_obj->getPartId()) { $tpl = $this->plugin->getTemplate('tpl.il_as_qpl_accqst_form_custom.html'); $tpl->setCurrentBlock('button'); $this->ctrl->setParameter($this, 'part_id', $part_obj->getPartId()); $tpl->setVariable('BUTTON_HREF', $this->ctrl->getLinkTarget($this, 'deletePart')); $tpl->setVariable('BUTTON_TEXT', $this->plugin->txt('delete_accounting_table')); $tpl->ParseCurrentBlock(); $item = new ilcustomInputGUI(); $item->setHTML($tpl->get()); $form->addItem($item); } }
/** * 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()); }
/** * 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); } }
/** * 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("assjavaapplet"); $this->addBasicQuestionFormProperties($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); $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; }
/** * Init import form */ protected function initImportForm() { include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this)); $form->setTitle($this->lng->txt('cont_import_tracking')); $form->addCommandButton('import', $this->lng->txt('import')); $form->addCommandButton('showTrackingItems', $this->lng->txt('cancel')); $csv = new ilFileInputGUI($this->lng->txt('select_file'), 'csv'); $csv->setRequired(true); $csv->setSuffixes(array('csv')); $form->addItem($csv); return $form; }
/** * Init add cast item form. */ function initAddCastItemForm($a_mode = "create") { global $lng, $ilCtrl, $ilTabs; $this->checkPermission("write"); $ilTabs->activateTab("edit_content"); $lng->loadLanguageModule("mcst"); $news_set = new ilSetting("news"); $enable_internal_rss = $news_set->get("enable_rss_for_internal"); include "Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form_gui = new ilPropertyFormGUI(); $this->form_gui->setMultipart(true); // Property Title $text_input = new ilTextInputGUI($lng->txt("title"), "title"); $text_input->setMaxLength(200); $this->form_gui->addItem($text_input); // Property Content $text_area = new ilTextAreaInputGUI($lng->txt("description"), "description"); $text_area->setRequired(false); $this->form_gui->addItem($text_area); // Property Visibility if ($enable_internal_rss) { $radio_group = new ilRadioGroupInputGUI($lng->txt("access_scope"), "visibility"); $radio_option = new ilRadioOption($lng->txt("access_users"), "users"); $radio_group->addOption($radio_option); $radio_option = new ilRadioOption($lng->txt("access_public"), "public"); $radio_group->addOption($radio_option); $radio_group->setInfo($lng->txt("mcst_visibility_info")); $radio_group->setRequired(true); $radio_group->setValue($this->object->getDefaultAccess() == 0 ? "users" : "public"); $this->form_gui->addItem($radio_group); } // Duration $dur = new ilDurationInputGUI($lng->txt("mcst_duration"), "duration"); $dur->setInfo($lng->txt("mcst_duration_info")); $dur->setShowDays(false); $dur->setShowHours(true); $dur->setShowSeconds(true); $this->form_gui->addItem($dur); foreach (ilObjMediaCast::$purposes as $purpose) { if ($purpose == "VideoAlternative" && $a_mode == "create") { continue; } $section = new ilFormSectionHeaderGUI(); $section->setTitle($lng->txt("mcst_" . strtolower($purpose) . "_title")); $this->form_gui->addItem($section); if ($a_mode != "create") { $value = new ilHiddenInputGUI("value_" . $purpose); $label = new ilNonEditableValueGUI($lng->txt("value")); $label->setPostVar("label_value_" . $purpose); $label->setInfo($lng->txt("mcst_current_value_info")); $this->form_gui->addItem($label); $this->form_gui->addItem($value); } $file = new ilFileInputGUI($lng->txt("file"), "file_" . $purpose); $file->setSuffixes($this->purposeSuffixes[$purpose]); $this->form_gui->addItem($file); $text_input = new ilRegExpInputGUI($lng->txt("url"), "url_" . $purpose); $text_input->setPattern("/https?\\:\\/\\/.+/i"); $text_input->setInfo($lng->txt("mcst_reference_info")); $this->form_gui->addItem($text_input); if ($purpose != "Standard") { $clearCheckBox = new ilCheckboxInputGUI(); $clearCheckBox->setPostVar("delete_" . $purpose); $clearCheckBox->setTitle($lng->txt("mcst_clear_purpose_title")); $this->form_gui->addItem($clearCheckBox); } else { // mime type selection $mimeTypeSelection = new ilSelectInputGUI(); $mimeTypeSelection->setPostVar("mimetype_" . $purpose); $mimeTypeSelection->setTitle($lng->txt("mcst_mimetype")); $mimeTypeSelection->setInfo($lng->txt("mcst_mimetype_info")); $options = array("" => $lng->txt("mcst_automatic_detection")); $options = array_merge($options, $this->mimeTypes); $mimeTypeSelection->setOptions($options); $this->form_gui->addItem($mimeTypeSelection); // preview picure $pp = new ilImageFileInputGUI($lng->txt("mcst_preview_picture"), "preview_pic"); $pp->setSuffixes(array("png", "jpeg", "jpg")); $pp->setInfo($lng->txt("mcst_preview_picture_info") . " mp4, mp3, png, jp(e)g, gif"); $this->form_gui->addItem($pp); } } // save/cancel button if ($a_mode == "create") { $this->form_gui->setTitle($lng->txt("mcst_add_new_item")); $this->form_gui->addCommandButton("saveCastItem", $lng->txt("save")); } else { $this->form_gui->setTitle($lng->txt("mcst_edit_item")); $this->form_gui->addCommandButton("updateCastItem", $lng->txt("save")); } $this->form_gui->addCommandButton("listItems", $lng->txt("cancel")); $this->form_gui->setFormAction($ilCtrl->getFormAction($this, "saveCastItem")); }
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; }
/** * Creates an input field for the davinci text file upload * * @return \ilFileInputGUI file input form item */ protected function createFileInputFormItem() { $file = new ilFileInputGUI($this->lng->txt("rep_robj_xrs_daVinci_import_file"), "upload_file"); $file->setSize(50); $file->setRequired(true); $file->setALlowDeletion(true); $file->setSuffixes(array('txt')); return $file; }
protected function initForm($submit_action) { $form = new ilPropertyFormGUI(); $input = new ilFileInputGUI($this->lng->txt("import_xml_file"), "import_file"); $input->setRequired(true); $input->setSuffixes(array('zip', 'xml')); $form->addItem($input); $form->setFormAction($this->ctrl->getFormAction($this)); $form->addCommandButton($submit_action, $this->lng->txt("import")); return $form; }
/** * 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"); $rect->setRequired(TRUE); $rect->setUseUnits(TRUE); $rect->setTop($form_fields["margin_body_top"]); $rect->setBottom($form_fields["margin_body_bottom"]); $rect->setLeft($form_fields["margin_body_left"]); $rect->setRight($form_fields["margin_body_right"]); $rect->setInfo($this->lng->txt("certificate_unit_description")); if (strcmp($this->ctrl->getCmd(), "certificateSave") == 0) { $rect->checkInput(); } $form->addItem($rect); $certificate = new ilTextAreaInputGUI($this->lng->txt("certificate_text"), "certificate_text"); $certificate->removePlugin('ilimgupload'); $certificate->setValue($form_fields["certificate_text"]); $certificate->setRequired(TRUE); $certificate->setRows(20); $certificate->setCols(80); // fraunhpatch start $common_desc_tpl = new ilTemplate("tpl.common_desc.html", true, true, "Services/Certificate"); foreach (ilCertificate::getCustomCertificateFields() as $f) { $common_desc_tpl->setCurrentBlock("cert_field"); $common_desc_tpl->setVariable("PH", $f["ph"]); $common_desc_tpl->setVariable("PH_TXT", $f["name"]); $common_desc_tpl->parseCurrentBlock(); } $common_desc = $common_desc_tpl->get(); // fraunhpatch start $certificate->setInfo($this->object->getAdapter()->getCertificateVariablesDescription() . $common_desc); $certificate->setUseRte(TRUE, '3.4.7'); $tags = array("br", "em", "font", "li", "ol", "p", "span", "strong", "u", "ul"); $certificate->setRteTags($tags); if (strcmp($this->ctrl->getCmd(), "certificateSave") == 0) { $certificate->checkInput(); } $form->addItem($certificate); $this->object->getAdapter()->addAdditionalFormElements($form, $form_fields); if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) { if ($this->object->isComplete() || $this->object->hasBackgroundImage()) { $form->addCommandButton("certificatePreview", $this->lng->txt("certificate_preview")); $form->addCommandButton("certificateExportFO", $this->lng->txt("certificate_export")); $form->addCommandButton("certificateDelete", $this->lng->txt("delete")); } $form->addCommandButton("certificateSave", $this->lng->txt("save")); } $this->tpl->setVariable("ADM_CONTENT", $form->getHTML()); if (strcmp($this->ctrl->getCmd(), "certificateSave") == 0) { if ($_POST["background_delete"]) { $this->object->deleteBackgroundImage(); } if ($form->checkInput()) { try { $xslfo = $this->object->processXHTML2FO($form_fields); $this->object->getAdapter()->saveFormFields($form_fields); $this->object->saveCertificate($xslfo); $this->object->writeActive($form_fields["active"]); ilUtil::sendSuccess($this->lng->txt("saved_successfully"), TRUE); $this->ctrl->redirect($this, "certificateEditor"); } catch (Exception $e) { ilUtil::sendFailure($e->getMessage()); } } } }
/** * Import codes from export codes file (upload form) */ protected function importAccessCodesObject() { $this->parent_gui->handleWriteAccess(); $this->setCodesSubtabs(); include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $form_import_file = new ilPropertyFormGUI(); $form_import_file->setFormAction($this->ctrl->getFormAction($this)); $form_import_file->setTableWidth("100%"); $form_import_file->setId("codes_import_file"); $headerfile = new ilFormSectionHeaderGUI(); $headerfile->setTitle($this->lng->txt("svy_import_codes")); $form_import_file->addItem($headerfile); $export_file = new ilFileInputGUI($this->lng->txt("codes"), "codes"); $export_file->setInfo(sprintf($this->lng->txt('svy_import_codes_info'), $this->lng->txt("export_all_survey_codes"))); $export_file->setSuffixes(array("csv")); $export_file->setRequired(true); $form_import_file->addItem($export_file); $form_import_file->addCommandButton("importAccessCodesAction", $this->lng->txt("import")); $form_import_file->addCommandButton("codes", $this->lng->txt("cancel")); $this->tpl->setContent($form_import_file->getHTML()); }
protected function initImportForm($a_new_type) { include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setTarget("_top"); $form->setFormAction($this->ctrl->getFormAction($this)); $form->setTitle($this->lng->txt("import_svy")); include_once "./Services/Form/classes/class.ilFileInputGUI.php"; $fi = new ilFileInputGUI($this->lng->txt("import_file"), "importfile"); $fi->setSuffixes(array("zip")); $fi->setRequired(true); $form->addItem($fi); include_once "./Modules/Survey/classes/class.ilObjSurvey.php"; $svy = new ilObjSurvey(); $questionspools = $svy->getAvailableQuestionpools(true, true, true); $pools = new ilSelectInputGUI($this->lng->txt("select_questionpool_short"), "spl"); $pools->setOptions(array("" => $this->lng->txt("dont_use_questionpool")) + $questionspools); $pools->setRequired(false); $form->addItem($pools); $form->addCommandButton("importFile", $this->lng->txt("import")); $form->addCommandButton("cancel", $this->lng->txt("cancel")); return $form; }
/** * Init personal data import form * * @param * @return */ function initPersonalDataImportForm() { global $lng, $ilCtrl; include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form = new ilPropertyFormGUI(); // input file $fi = new ilFileInputGUI($lng->txt("file"), "file"); $fi->setRequired(true); $fi->setSuffixes(array("zip")); $this->form->addItem($fi); // profile data $cb = new ilCheckboxInputGUI($this->lng->txt("pd_profile_data"), "profile_data"); $this->form->addItem($cb); // settings $cb = new ilCheckboxInputGUI($this->lng->txt("settings"), "settings"); $this->form->addItem($cb); // bookmarks $cb = new ilCheckboxInputGUI($this->lng->txt("pd_bookmarks"), "bookmarks"); $this->form->addItem($cb); // personal notes $cb = new ilCheckboxInputGUI($this->lng->txt("pd_notes"), "notes"); $this->form->addItem($cb); // calendar entries $cb = new ilCheckboxInputGUI($this->lng->txt("pd_private_calendars"), "calendar"); $this->form->addItem($cb); $this->form->addCommandButton("importPersonalData", $lng->txt("import")); $this->form->addCommandButton("showExportImport", $lng->txt("cancel")); $this->form->setTitle($lng->txt("pd_import_personal_data")); $this->form->setFormAction($ilCtrl->getFormAction($this)); }
/** * 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; }
/** * Init object import form * * @param string new type */ public function initImportForm($a_new_type = "") { global $lng, $ilCtrl; $lng->loadLanguageModule("feed"); include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form = new ilPropertyFormGUI(); $this->form->setTarget("_top"); // Import file include_once "./Services/Form/classes/class.ilFileInputGUI.php"; $fi = new ilFileInputGUI($lng->txt("import_file"), "importfile"); $fi->setSuffixes(array("zip")); $fi->setRequired(true); $this->form->addItem($fi); $this->form->addCommandButton("importFile", $lng->txt("import")); $this->form->addCommandButton("cancelSaveFeedBlock", $lng->txt("cancel")); $this->form->setTitle($lng->txt($a_new_type . "_import")); $ilCtrl->setParameter($this, "new_type", $a_new_type); $this->form->setFormAction($ilCtrl->getFormAction($this)); }
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); }
/** * FORM: Init zip upload form. */ public function initZipUploadForm($a_mode = "create") { global $lng; include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $zip_form_gui = new ilPropertyFormGUI(); $zip_form_gui->setMultipart(true); // File $in_file = new ilFileInputGUI($lng->txt("file"), "zip_file"); $in_file->setRequired(true); $in_file->setSuffixes(array("zip")); $zip_form_gui->addItem($in_file); // Take over structure $in_str = new ilCheckboxInputGUI($this->lng->txt("take_over_structure"), "adopt_structure"); $in_str->setInfo($this->lng->txt("take_over_structure_info")); $zip_form_gui->addItem($in_str); $zip_form_gui->addCommandButton("saveUnzip", $this->lng->txt($this->type . "_add")); $zip_form_gui->addCommandButton("cancel", $lng->txt("cancel")); $zip_form_gui->setTableWidth("600px"); $zip_form_gui->setTarget($this->getTargetFrame("save")); $zip_form_gui->setTitle($this->lng->txt("header_zip")); $zip_form_gui->setTitleIcon(ilUtil::getImagePath('icon_file.svg'), $this->lng->txt('obj_file')); $this->ctrl->setParameter($this, "new_type", "file"); $zip_form_gui->setFormAction($this->ctrl->getFormAction($this, "saveUnzip")); return $zip_form_gui; }
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; }
public function showCodeImport() { $this->ctrl->setParameter($this, 'coupon_id', $_GET['coupon_id']); $this->__showButtons(); $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment'); $this->coupon_obj->getCouponById(ilUtil::stripSlashes($_GET['coupon_id'])); $oForm = new ilPropertyFormGUI(); $oForm->setId('coup_form'); $oForm->setFormAction($this->ctrl->getFormAction($this), 'importCodes'); $oForm->setTitle($this->lng->txt("paya_coupons_coupon") . " " . $this->coupon_obj->getTitle() . ": " . $this->lng->txt('paya_coupons_codes_import')); $oFile = new ilFileInputGUI($this->lng->txt('file'), 'codesfile'); $oFile->setSuffixes(array("txt")); $oFile->setRequired(true); $oFile->setInfo($this->lng->txt('import_use_only_textfile')); $oForm->addItem($oFile); $oForm->addCommandButton('importCodes', $this->lng->txt('upload')); $this->tpl->setVariable('FORM', $oForm->getHTML()); return true; }