public function setValueByArray($value) { parent::setValueByArray($value); include_once './Services/Tree/classes/class.ilPathGUI.php'; $path = new ilPathGUI(); $reference = $value[$this->getPostVar()]; if ($reference) { $pathString = $path->getPath(ROOT_FOLDER_ID, $reference); $id = ilObject::_lookupObjId($reference); $this->title_input->setValue($pathString . " > " . ilObject::_lookupTitle($id)); $this->hidden_input->setValue($reference); } }
/** * Init settings property form * * @access private */ private function initForm() { $this->setFormAction($this->ctrl->getFormAction($this->parent_gui)); $name = new ilTextInputGUI($this->lng->txt("bibl_library_name"), 'name'); $name->setRequired(true); $name->setValue(''); $this->addItem($name); $url = new ilTextInputGUI($this->lng->txt("bibl_library_url"), 'url'); $url->setRequired(true); $url->setValue(''); $this->addItem($url); $img = new ilTextInputGUI($this->lng->txt("bibl_library_img"), 'img'); $img->setValue(''); $this->addItem($img); $show_in_list = new ilCheckboxInputGUI($this->lng->txt("bibl_library_show_in_list"), 'show_in_list'); $show_in_list->setValue(1); $this->addItem($show_in_list); switch ($this->action) { case 'create': $this->setTitle($this->lng->txt("bibl_settings_new")); $this->addCommandButton('create', $this->lng->txt('save')); break; case 'update': $this->addCommandButton('update', $this->lng->txt('save')); $this->fillForm(); $this->setTitle($this->lng->txt("bibl_settings_edit")); break; } $this->addCommandButton('cancel', $this->lng->txt("cancel")); }
/** * Creates an output of the edit form for the question * @access public */ function editQuestion() { global $ilDB, $tpl; $plugin = $this->object->getPlugin(); $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("assJSMEQuestion"); // Basiseingabefelder: title, author, description, question, working time (assessment mode) $this->addBasicQuestionFormProperties($form); // points $points = new ilNumberInputGUI($plugin->txt("points"), "points"); $points->setValue($this->object->getPoints()); $points->setRequired(TRUE); $points->setSize(10); $points->setMinValue(0.0); $form->addItem($points); // optionString for the JSME-Applet include_once "./Services/Form/classes/class.ilTextInputGUI.php"; $optionString = new ilTextInputGUI($plugin->txt("optionString"), "optionString"); $optionString->setValue($this->object->getOptionString()); $form->addItem($optionString); // JSME-Applet for sampleSolution include_once "./Services/Form/classes/class.ilCustomInputGUI.php"; $sampleSolution = new ilCustomInputGUI($plugin->txt("sampleSolution"), "sampleSolution"); $template = $this->getJsmeOutputTemplate("", $this->object->getOptionString(), $this->object->getSampleSolution()); $sampleSolution->setHtml($template->get()); $form->addItem($sampleSolution); $form->addCommandButton('save', $plugin->txt("save")); $this->tpl->setVariable("QUESTION_DATA", $form->getHTML()); }
public function addToForm() { $text = new ilTextInputGUI($this->getTitle(), $this->getElementId()); $text->setSize(20); $text->setMaxLength(512); $text->setSubmitFormOnEnter(true); $text->setValue($this->getADT()->getText()); $this->addToParentElement($text); }
public function showSettings($item) { global $lng; $txt = new ilTextInputGUI($lng->txt('polling_intervall'), 'osd_polling_intervall'); $txt->setRequired(true); $txt->setInfo($lng->txt('polling_in_seconds')); $txt->setValue('300'); $item->addSubItem($txt); return array('osd_polling_intervall'); }
/** * set value * * @access public * @param string $a_value color hexcode * @return */ public function setValue($a_value) { $a_value = trim($a_value); if ($this->getAcceptNamedColors() && substr($a_value, 0, 1) == "!") { parent::setValue($a_value); } else { $this->hex = ilColorPickerInputGUI::determineHexcode($a_value); parent::setValue($this->getHexcode()); } }
function showPersonalData() { // user_id $this->user_obj->getId() // all $this->psc_obj = new ilPaymentShoppingCart($this->user_obj); if (!count($items = $this->psc_obj->getEntries($this->pm_id))) { $this->tpl->setVariable("HEADER", $this->lng->txt('pay_bmf_your_order')); $this->tpl->touchBlock("stop_floating"); ilUtil::sendInfo($this->lng->txt('pay_shopping_cart_empty')); } else { $this->tpl->setVariable("HEADER", $this->lng->txt('pay_step1')); $this->tpl->setVariable("TITLE", $this->lng->txt('pay_bmf_personal_data')); $this->tpl->setVariable("DESCRIPTION", $this->lng->txt('pay_bmf_description_personal_data')); $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment'); $oForm = new ilPropertyFormGUI(); $oForm->setFormAction($this->ctrl->getFormAction($this, 'getPersonalData')); $oForm->setTitle($this->lng->txt('pay_bmf_personal_data')); $oFirstname = new ilNonEditableValueGUI($this->lng->txt('firstname')); $oFirstname->setValue($this->user_obj->getFirstname()); $oForm->addItem($oFirstname); $oLastname = new ilNonEditableValueGUI($this->lng->txt('lastname')); $oLastname->setValue($this->user_obj->getLastname()); $oForm->addItem($oLastname); $oStreet = new ilTextInputGUI($this->lng->txt('street'), 'street'); $oStreet->setValue($this->error != '' && isset($_POST['street']) ? ilUtil::prepareFormOutput($_POST['street'], true) : ilUtil::prepareFormOutput($_SESSION['bmf']['personal_data']['street'], true)); $oForm->addItem($oStreet); $oHouseNumber = new ilTextInputGUI($this->lng->txt('pay_bmf_house_number'), 'house_number'); $oHouseNumber->setValue($this->error != '' && isset($_POST['house_number']) ? ilUtil::prepareFormOutput($_POST['house_number'], true) : ilUtil::prepareFormOutput($_SESSION['bmf']['personal_data']['house_number'], true)); $oForm->addItem($oHouseNumber); $oPoBox = new ilTextInputGUI($this->lng->txt('pay_bmf_or') . ' ' . $this->lng->txt('pay_bmf_po_box'), 'po_box'); $oPoBox->setValue($this->error != '' && isset($_POST['po_box']) ? ilUtil::prepareFormOutput($_POST['po_box'], true) : ilUtil::prepareFormOutput($_SESSION['bmf']['personal_data']['po_box'], true)); $oForm->addItem($oPoBox); $oZipCode = new ilTextInputGUI($this->lng->txt('zipcode'), 'zipcode'); $oZipCode->setValue($this->error != '' && isset($_POST['zipcode']) ? ilUtil::prepareFormOutput($_POST['zipcode'], true) : ilUtil::prepareFormOutput($_SESSION['bmf']['personal_data']['zipcode'], true)); $oForm->addItem($oZipCode); $oCity = new ilTextInputGUI($this->lng->txt('city'), 'city'); $oCity->setValue($this->error != '' && isset($_POST['city']) ? ilUtil::prepareFormOutput($_POST['city'], true) : ilUtil::prepareFormOutput($_SESSION['bmf']['personal_data']['city'], true)); $oForm->addItem($oCity); $oCountry = new ilSelectInputGUI($this->lng->txt('country'), 'country'); $oCountry->setOptions($this->__getCountries()); $oCountry->setValue($this->error != '' && isset($_POST['country']) ? $_POST['country'] : $_SESSION['bmf']['personal_data']['country']); $oForm->addItem($oCountry); $oEmail = new ilNonEditableValueGUI($this->lng->txt('email')); $oEmail->setValue($this->user_obj->getEmail()); $oForm->addItem($oEmail); $oForm->addcommandButton('getPersonalData', ucfirst($this->lng->txt('next'))); $this->tpl->setVariable('FORM', $oForm->getHTML()); } }
function owner() { $this->__initSubTabs("owner"); include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this, "owner")); $form->setTitle($this->lng->txt("info_owner_of_object")); $login = new ilTextInputGUI($this->lng->txt("login"), "owner"); $login->setDataSource($this->ctrl->getLinkTargetByClass(array(get_class($this), 'ilRepositorySearchGUI'), 'doUserAutoComplete', '', true)); $login->setRequired(true); $login->setSize(50); $login->setInfo($this->lng->txt("chown_warning")); $login->setValue(ilObjUser::_lookupLogin($this->gui_obj->object->getOwner())); $form->addItem($login); $form->addCommandButton("changeOwner", $this->lng->txt("change_owner")); $this->tpl->setContent($form->getHTML()); }
/** * get html * * @access public * @param * @return */ public function initForm() { $rec = new ilSelectInputGUI($this->lng->txt('cal_recurrences'), 'frequence'); $rec->setRequired(true); $rec->setOptions(array(0 => $this->lng->txt('cal_no_recurrence'), ilCalendarRecurrence::FREQ_DAILY => $this->lng->txt('cal_rec_daily'), ilCalendarRecurrence::FREQ_WEEKLY => $this->lng->txt('cal_rec_weekly'), ilCalendarRecurrence::FREQ_MONTHLY => $this->lng->txt('cal_rec_monthly'), ilCalendarRecurrence::FREQ_YEARLY => $this->lng->txt('cal_rec_yearly'))); $rec->setValue($this->recurrence->getFrequenceType()); $this->form->addItem($rec); // DAILY part $interval = new ilTextInputGUI($this->lng->txt('interval'), 'interval'); $interval->setSize(2); $interval->setMaxLength(3); $interval->setValue($this->recurrence->getInterval() ? $this->recurrence->getInterval() : 1); $interval->setInfo($this->lng->txt('interval_info')); $rec->addSubItem($interval); // Weekly $check = new ilCheckboxInputGUI($this->lng->txt('Su_short'), 'w_day[0]'); $check->setChecked(true); $rec->addSubItem($check); $check = new ilCheckboxInputGUI($this->lng->txt('Mo_short'), 'w_day[1]'); $check->setChecked(true); $rec->addSubItem($check); $check = new ilCheckboxInputGUI($this->lng->txt('Tu_short'), 'w_day[2]'); $check->setChecked(true); $rec->addSubItem($check); $check = new ilCheckboxInputGUI($this->lng->txt('We_short'), 'w_day[3]'); $check->setChecked(true); $rec->addSubItem($check); $check = new ilCheckboxInputGUI($this->lng->txt('Th_short'), 'w_day[4]'); $check->setChecked(true); $rec->addSubItem($check); $check = new ilCheckboxInputGUI($this->lng->txt('Fr_short'), 'w_day[5]'); $check->setChecked(true); $rec->addSubItem($check); $check = new ilCheckboxInputGUI($this->lng->txt('Sa_short'), 'w_day[6]'); $check->setChecked(true); $rec->addSubItem($check); }
public function addCustomSettingsToForm(ilPropertyFormGUI $a_form) { global $lng; $lng->loadLanguageModule("file"); require_once 'Services/WebDAV/classes/class.ilObjDiskQuotaSettings.php'; $disk_quota_obj = ilObjDiskQuotaSettings::getInstance(); // Enable disk quota reminder mail $cb_prop_reminder = new ilCheckboxInputGUI($lng->txt("enable_disk_quota_reminder_mail"), "enable_disk_quota_reminder_mail"); $cb_prop_reminder->setValue('1'); $cb_prop_reminder->setChecked($disk_quota_obj->isDiskQuotaReminderMailEnabled()); $cb_prop_reminder->setInfo($lng->txt('disk_quota_reminder_mail_desc')); $a_form->addItem($cb_prop_reminder); // Enable summary mail for certain users $cb_prop_summary = new ilCheckboxInputGUI($lng->txt("enable_disk_quota_summary_mail"), "enable_disk_quota_summary_mail"); $cb_prop_summary->setValue(1); $cb_prop_summary->setChecked($disk_quota_obj->isDiskQuotaSummaryMailEnabled()); $cb_prop_summary->setInfo($lng->txt('enable_disk_quota_summary_mail_desc')); $a_form->addItem($cb_prop_summary); // Edit disk quota recipients $summary_rcpt = new ilTextInputGUI($lng->txt("disk_quota_summary_rctp"), "disk_quota_summary_rctp"); $summary_rcpt->setValue($disk_quota_obj->getSummaryRecipients()); $summary_rcpt->setInfo($lng->txt('disk_quota_summary_rctp_desc')); $cb_prop_summary->addSubItem($summary_rcpt); }
public function showTopicForm() { $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment'); include_once 'Services/Form/classes/class.ilPropertyFormGUI.php'; $form = new ilPropertyFormGUI(); if ($this->objCurrentTopic->getId()) { $this->ctrl->setParameter($this, 'topic_id', $this->objCurrentTopic->getId()); } $form->setFormAction($this->ctrl->getFormAction($this, 'saveTopic')); $form->setTitle($this->lng->txt($this->objCurrentTopic->getId() ? 'edit_topic' : 'new_topic')); $title = new ilTextInputGUI($this->lng->txt('title'), 'title'); $title->setValue($this->objCurrentTopic->getTitle()); $title->setRequired(true); $form->addItem($title); $sorting = new ilTextInputGUI($this->lng->txt('pay_sorting_value'), 'sorting'); $sorting->setValue($this->objCurrentTopic->getSorting()); $sorting->setMaxLength(11); $sorting->setSize(11); $form->addItem($sorting); $form->addCommandButton('saveTopic', $this->lng->txt('save')); $form->addCommandButton('showTopicsList', $this->lng->txt('cancel')); $this->tpl->setVariable('FORM', $form->getHTML()); return true; }
private function buildForm() { require_once 'Services/Form/classes/class.ilPropertyFormGUI.php'; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this)); $form->addCommandButton(self::CMD_SAVE_FORM, $this->lng->txt("save")); $form->setTableWidth("100%"); $form->setId("test_properties"); if (!$this->settingsTemplate || $this->formShowGeneralSection($this->settingsTemplate->getSettings())) { // 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->testOBJ->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 ($this->testOBJ->participantDataExist()) { $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->testOBJ->getAnonymity()); $form->addItem($anonymity); // test mode (question set type) $questSetType = new ilRadioGroupInputGUI($this->lng->txt("tst_question_set_type"), 'question_set_type'); $questSetTypeFixed = new ilRadioOption($this->lng->txt("tst_question_set_type_fixed"), ilObjTest::QUESTION_SET_TYPE_FIXED, $this->lng->txt("tst_question_set_type_fixed_desc")); $questSetType->addOption($questSetTypeFixed); $questSetTypeRandom = new ilRadioOption($this->lng->txt("tst_question_set_type_random"), ilObjTest::QUESTION_SET_TYPE_RANDOM, $this->lng->txt("tst_question_set_type_random_desc")); $questSetType->addOption($questSetTypeRandom); $questSetTypeContinues = new ilRadioOption($this->lng->txt("tst_question_set_type_dynamic"), ilObjTest::QUESTION_SET_TYPE_DYNAMIC, $this->lng->txt("tst_question_set_type_dynamic_desc")); $questSetType->addOption($questSetTypeContinues); $questSetType->setValue($this->testOBJ->getQuestionSetType()); if ($this->testOBJ->participantDataExist()) { $questSetType->setDisabled(true); } $form->addItem($questSetType); // pool usage $pool_usage = new ilCheckboxInputGUI($this->lng->txt("test_question_pool_usage"), "use_pool"); $pool_usage->setValue(1); $pool_usage->setChecked($this->testOBJ->getPoolUsage()); $form->addItem($pool_usage); // enable_archiving $enable_archiving = new ilCheckboxInputGUI($this->lng->txt('test_enable_archiving'), 'enable_archiving'); $enable_archiving->setValue(1); $enable_archiving->setChecked($this->testOBJ->getEnableArchiving()); $form->addItem($enable_archiving); // 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->testOBJ->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->testOBJ->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); $act_type->setValue($this->testOBJ->isActivationLimited() ? ilObjectActivation::TIMINGS_ACTIVATION : ilObjectActivation::TIMINGS_DEACTIVATED); $opt = new ilRadioOption($this->lng->txt('rep_visibility_limitless'), ilObjectActivation::TIMINGS_DEACTIVATED); $opt->setInfo($this->lng->txt('tst_availability_limitless_info')); $act_type->addOption($opt); $opt = new ilRadioOption($this->lng->txt('rep_visibility_until'), ilObjectActivation::TIMINGS_ACTIVATION); $opt->setInfo($this->lng->txt('tst_availability_until_info')); $this->tpl->addJavaScript('./Services/Form/js/date_duration.js'); include_once "Services/Form/classes/class.ilDateDurationInputGUI.php"; $dur = new ilDateDurationInputGUI("", "access_period"); $dur->setShowTime(true); $date = $this->testOBJ->getActivationStartingTime(); $dur->setStart(new ilDateTime($date ? $date : time(), IL_CAL_UNIX)); $dur->setStartText($this->lng->txt('rep_activation_limited_start')); $date = $this->testOBJ->getActivationEndingTime(); $dur->setEnd(new ilDateTime($date ? $date : time(), IL_CAL_UNIX)); $dur->setEndText($this->lng->txt('rep_activation_limited_end')); $opt->addSubItem($dur); $visible = new ilCheckboxInputGUI($this->lng->txt('rep_activation_limited_visibility'), 'activation_visibility'); $visible->setInfo($this->lng->txt('tst_activation_limited_visibility_info')); $visible->setChecked($this->testOBJ->getActivationVisibility()); $opt->addSubItem($visible); $act_type->addOption($opt); $form->addItem($act_type); if (!$this->settingsTemplate || $this->formShowBeginningEndingInformation($this->settingsTemplate->getSettings())) { // general properties $header = new ilFormSectionHeaderGUI(); $header->setTitle($this->lng->txt("tst_beginning_ending_information")); $form->addItem($header); } // introduction $intro = new ilTextAreaInputGUI($this->lng->txt("tst_introduction"), "introduction"); $intro->setValue($this->testOBJ->prepareTextareaOutput($this->testOBJ->getIntroduction())); $intro->setRows(10); $intro->setCols(80); $intro->setUseRte(TRUE); $intro->addPlugin("latex"); $intro->addButton("latex"); $intro->setRTESupport($this->testOBJ->getId(), "tst", "assessment"); $intro->setRteTagSet('full'); $intro->setInfo($this->lng->txt('intro_desc')); // showinfo $showinfo = new ilCheckboxInputGUI('', "showinfo"); $showinfo->setValue(1); $showinfo->setChecked($this->testOBJ->getShowInfo()); $showinfo->setOptionTitle($this->lng->txt("showinfo")); $showinfo->setInfo($this->lng->txt("showinfo_desc")); $intro->addSubItem($showinfo); $form->addItem($intro); // final statement $finalstatement = new ilTextAreaInputGUI($this->lng->txt("final_statement"), "finalstatement"); $finalstatement->setValue($this->testOBJ->prepareTextareaOutput($this->testOBJ->getFinalStatement())); $finalstatement->setRows(10); $finalstatement->setCols(80); $finalstatement->setUseRte(TRUE); $finalstatement->addPlugin("latex"); $finalstatement->addButton("latex"); $finalstatement->setRTESupport($this->testOBJ->getId(), "tst", "assessment"); $finalstatement->setRteTagSet('full'); // show final statement $showfinal = new ilCheckboxInputGUI('', "showfinalstatement"); $showfinal->setValue(1); $showfinal->setChecked($this->testOBJ->getShowFinalStatement()); $showfinal->setOptionTitle($this->lng->txt("final_statement_show")); $showfinal->setInfo($this->lng->txt("final_statement_show_desc")); $finalstatement->addSubItem($showfinal); $form->addItem($finalstatement); // examview $enable_examview = new ilCheckboxInputGUI($this->lng->txt("enable_examview"), 'enable_examview'); $enable_examview->setValue(1); $enable_examview->setChecked($this->testOBJ->getEnableExamview()); $enable_examview->setInfo($this->lng->txt("enable_examview_desc")); $show_examview_html = new ilCheckboxInputGUI('', 'show_examview_html'); $show_examview_html->setValue(1); $show_examview_html->setChecked($this->testOBJ->getShowExamviewHtml()); $show_examview_html->setOptionTitle($this->lng->txt("show_examview_html")); $show_examview_html->setInfo($this->lng->txt("show_examview_html_desc")); $enable_examview->addSubItem($show_examview_html); $show_examview_pdf = new ilCheckboxInputGUI('', 'show_examview_pdf'); $show_examview_pdf->setValue(1); $show_examview_pdf->setChecked($this->testOBJ->getShowExamviewPdf()); $show_examview_pdf->setOptionTitle($this->lng->txt("show_examview_pdf")); $show_examview_pdf->setInfo($this->lng->txt("show_examview_pdf_desc")); $enable_examview->addSubItem($show_examview_pdf); $form->addItem($enable_examview); if (!$this->settingsTemplate || $this->formShowSessionSection($this->settingsTemplate->getSettings())) { // session properties $sessionheader = new ilFormSectionHeaderGUI(); $sessionheader->setTitle($this->lng->txt("tst_session_settings")); $form->addItem($sessionheader); } // max. number of passes $nr_of_tries = new ilTextInputGUI($this->lng->txt("tst_nr_of_tries"), "nr_of_tries"); $nr_of_tries->setSize(3); $nr_of_tries->setValue($this->testOBJ->getNrOfTries()); $nr_of_tries->setRequired(true); $nr_of_tries->setSuffix($this->lng->txt("0_unlimited")); $total = $this->testOBJ->evalTotalPersons(); if ($total) { $nr_of_tries->setDisabled(true); } $form->addItem($nr_of_tries); // enable max. processing time $processing = new ilCheckboxInputGUI($this->lng->txt("tst_processing_time"), "chb_processing_time"); $processing->setValue(1); //$processing->setOptionTitle($this->lng->txt("enabled")); if ($this->settingsTemplate && $this->getTemplateSettingValue('chb_processing_time')) { $processing->setChecked(true); } else { $processing->setChecked($this->testOBJ->getEnableProcessingTime()); } // max. processing time $processingtime = new ilDurationInputGUI('', 'processing_time'); $ptime = $this->testOBJ->getProcessingTimeAsArray(); $processingtime->setHours($ptime['hh']); $processingtime->setMinutes($ptime['mm']); $processingtime->setSeconds($ptime['ss']); $processingtime->setShowMonths(false); $processingtime->setShowDays(false); $processingtime->setShowHours(true); $processingtime->setShowMinutes(true); $processingtime->setShowSeconds(true); $processingtime->setInfo($this->lng->txt("tst_processing_time_desc")); $processing->addSubItem($processingtime); // reset max. processing time $resetprocessing = new ilCheckboxInputGUI('', "chb_reset_processing_time"); $resetprocessing->setValue(1); $resetprocessing->setOptionTitle($this->lng->txt("tst_reset_processing_time")); $resetprocessing->setChecked($this->testOBJ->getResetProcessingTime()); $resetprocessing->setInfo($this->lng->txt("tst_reset_processing_time_desc")); $processing->addSubItem($resetprocessing); $form->addItem($processing); // enable starting time $enablestartingtime = new ilCheckboxInputGUI($this->lng->txt("tst_starting_time"), "chb_starting_time"); $enablestartingtime->setValue(1); //$enablestartingtime->setOptionTitle($this->lng->txt("enabled")); if ($this->settingsTemplate && $this->getTemplateSettingValue('chb_starting_time')) { $enablestartingtime->setChecked(true); } else { $enablestartingtime->setChecked(strlen($this->testOBJ->getStartingTime())); } // starting time $startingtime = new ilDateTimeInputGUI('', 'starting_time'); $startingtime->setShowDate(true); $startingtime->setShowTime(true); if (strlen($this->testOBJ->getStartingTime())) { $startingtime->setDate(new ilDateTime($this->testOBJ->getStartingTime(), IL_CAL_TIMESTAMP)); } else { $startingtime->setDate(new ilDateTime(time(), IL_CAL_UNIX)); } $enablestartingtime->addSubItem($startingtime); $form->addItem($enablestartingtime); if ($this->testOBJ->participantDataExist()) { $enablestartingtime->setDisabled(true); $startingtime->setDisabled(true); } // enable ending time $enableendingtime = new ilCheckboxInputGUI($this->lng->txt("tst_ending_time"), "chb_ending_time"); $enableendingtime->setValue(1); //$enableendingtime->setOptionTitle($this->lng->txt("enabled")); if ($this->settingsTemplate && $this->getTemplateSettingValue('chb_ending_time')) { $enableendingtime->setChecked(true); } else { $enableendingtime->setChecked(strlen($this->testOBJ->getEndingTime())); } // ending time $endingtime = new ilDateTimeInputGUI('', 'ending_time'); $endingtime->setShowDate(true); $endingtime->setShowTime(true); if (strlen($this->testOBJ->getEndingTime())) { $endingtime->setDate(new ilDateTime($this->testOBJ->getEndingTime(), IL_CAL_TIMESTAMP)); } else { $endingtime->setDate(new ilDateTime(time(), IL_CAL_UNIX)); } $enableendingtime->addSubItem($endingtime); $form->addItem($enableendingtime); // test password $password = new ilTextInputGUI($this->lng->txt("tst_password"), "password"); $password->setSize(20); $password->setValue($this->testOBJ->getPassword()); $password->setInfo($this->lng->txt("tst_password_details")); $form->addItem($password); if (!$this->settingsTemplate || $this->formShowPresentationSection($this->settingsTemplate->getSettings())) { // sequence properties $seqheader = new ilFormSectionHeaderGUI(); $seqheader->setTitle($this->lng->txt("tst_presentation_properties")); $form->addItem($seqheader); } // use previous answers $prevanswers = new ilCheckboxInputGUI($this->lng->txt("tst_use_previous_answers"), "chb_use_previous_answers"); $prevanswers->setValue(1); $prevanswers->setChecked($this->testOBJ->getUsePreviousAnswers()); $prevanswers->setInfo($this->lng->txt("tst_use_previous_answers_description")); $form->addItem($prevanswers); // force js $forcejs = new ilCheckboxInputGUI($this->lng->txt("forcejs_short"), "forcejs"); $forcejs->setValue(1); $forcejs->setChecked($this->testOBJ->getForceJS()); $forcejs->setOptionTitle($this->lng->txt("forcejs")); $forcejs->setInfo($this->lng->txt("forcejs_desc")); $form->addItem($forcejs); // question title output $title_output = new ilRadioGroupInputGUI($this->lng->txt("tst_title_output"), "title_output"); $title_output->addOption(new ilRadioOption($this->lng->txt("tst_title_output_full"), 0, '')); $title_output->addOption(new ilRadioOption($this->lng->txt("tst_title_output_hide_points"), 1, '')); $title_output->addOption(new ilRadioOption($this->lng->txt("tst_title_output_no_title"), 2, '')); $title_output->setValue($this->testOBJ->getTitleOutput()); $title_output->setInfo($this->lng->txt("tst_title_output_description")); $form->addItem($title_output); // selector for unicode characters global $ilSetting; if ($ilSetting->get('char_selector_availability') > 0) { require_once 'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php'; $char_selector = new ilCharSelectorGUI(ilCharSelectorConfig::CONTEXT_TEST); $char_selector->getConfig()->setAvailability($this->testOBJ->getCharSelectorAvailability()); $char_selector->getConfig()->setDefinition($this->testOBJ->getCharSelectorDefinition()); $char_selector->addFormProperties($form); $char_selector->setFormValues($form); } // Autosave $autosave_output = new ilCheckboxInputGUI($this->lng->txt('autosave'), 'autosave'); $autosave_output->setValue(1); $autosave_output->setChecked($this->testOBJ->getAutosave()); $autosave_output->setInfo($this->lng->txt('autosave_info')); $autosave_interval = new ilTextInputGUI($this->lng->txt('autosave_ival'), 'autosave_ival'); $autosave_interval->setSize(10); $autosave_interval->setValue($this->testOBJ->getAutosaveIval() / 1000); $autosave_interval->setInfo($this->lng->txt('autosave_ival_info')); $autosave_output->addSubItem($autosave_interval); $form->addItem($autosave_output); if (!$this->settingsTemplate || $this->formShowSequenceSection($this->settingsTemplate->getSettings())) { // sequence properties $seqheader = new ilFormSectionHeaderGUI(); $seqheader->setTitle($this->lng->txt("tst_sequence_properties")); $form->addItem($seqheader); } // postpone questions $postpone = new ilCheckboxInputGUI($this->lng->txt("tst_postpone"), "chb_postpone"); $postpone->setValue(1); $postpone->setChecked($this->testOBJ->getSequenceSettings()); $postpone->setInfo($this->lng->txt("tst_postpone_description")); $form->addItem($postpone); // shuffle questions $shuffle = new ilCheckboxInputGUI($this->lng->txt("tst_shuffle_questions"), "chb_shuffle_questions"); $shuffle->setValue(1); $shuffle->setChecked($this->testOBJ->getShuffleQuestions()); $shuffle->setInfo($this->lng->txt("tst_shuffle_questions_description")); $form->addItem($shuffle); // show list of questions $list_of_questions = new ilCheckboxInputGUI($this->lng->txt("tst_show_summary"), "list_of_questions"); //$list_of_questions->setOptionTitle($this->lng->txt("tst_show_summary")); $list_of_questions->setValue(1); $list_of_questions->setChecked($this->testOBJ->getListOfQuestions()); $list_of_questions->setInfo($this->lng->txt("tst_show_summary_description")); $list_of_questions_options = new ilCheckboxGroupInputGUI('', "list_of_questions_options"); $list_of_questions_options->addOption(new ilCheckboxOption($this->lng->txt("tst_list_of_questions_start"), 'chb_list_of_questions_start', '')); $list_of_questions_options->addOption(new ilCheckboxOption($this->lng->txt("tst_list_of_questions_end"), 'chb_list_of_questions_end', '')); $list_of_questions_options->addOption(new ilCheckboxOption($this->lng->txt("tst_list_of_questions_with_description"), 'chb_list_of_questions_with_description', '')); $values = array(); if ($this->testOBJ->getListOfQuestionsStart()) { array_push($values, 'chb_list_of_questions_start'); } if ($this->testOBJ->getListOfQuestionsEnd()) { array_push($values, 'chb_list_of_questions_end'); } if ($this->testOBJ->getListOfQuestionsDescription()) { array_push($values, 'chb_list_of_questions_with_description'); } $list_of_questions_options->setValue($values); $list_of_questions->addSubItem($list_of_questions_options); $form->addItem($list_of_questions); // show question marking $marking = new ilCheckboxInputGUI($this->lng->txt("question_marking"), "chb_show_marker"); $marking->setValue(1); $marking->setChecked($this->testOBJ->getShowMarker()); $marking->setInfo($this->lng->txt("question_marking_description")); $form->addItem($marking); // show suspend test $cancel = new ilCheckboxInputGUI($this->lng->txt("tst_show_cancel"), "chb_show_cancel"); $cancel->setValue(1); $cancel->setChecked($this->testOBJ->getShowCancel()); $cancel->setInfo($this->lng->txt("tst_show_cancel_description")); $form->addItem($cancel); if (!$this->settingsTemplate || $this->formShowNotificationSection($this->settingsTemplate->getSettings())) { // notifications $notifications = new ilFormSectionHeaderGUI(); $notifications->setTitle($this->lng->txt("tst_mail_notification")); $form->addItem($notifications); } // mail notification $mailnotification = new ilRadioGroupInputGUI($this->lng->txt("tst_finish_notification"), "mailnotification"); $mailnotification->addOption(new ilRadioOption($this->lng->txt("tst_finish_notification_no"), 0, '')); $mailnotification->addOption(new ilRadioOption($this->lng->txt("tst_finish_notification_simple"), 1, '')); $mailnotification->addOption(new ilRadioOption($this->lng->txt("tst_finish_notification_advanced"), 2, '')); $mailnotification->setValue($this->testOBJ->getMailNotification()); $form->addItem($mailnotification); $mailnottype = new ilCheckboxInputGUI('', "mailnottype"); $mailnottype->setValue(1); $mailnottype->setOptionTitle($this->lng->txt("mailnottype")); $mailnottype->setChecked($this->testOBJ->getMailNotificationType()); $form->addItem($mailnottype); /* This options always active (?) */ $highscore_head = new ilFormSectionHeaderGUI(); $highscore_head->setTitle($this->lng->txt("tst_highscore_options")); $form->addItem($highscore_head); $highscore = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_enabled"), "highscore_enabled"); $highscore->setValue(1); $highscore->setChecked($this->testOBJ->getHighscoreEnabled()); $highscore->setInfo($this->lng->txt("tst_highscore_description")); $form->addItem($highscore); $highscore_anon = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_anon"), "highscore_anon"); $highscore_anon->setValue(1); $highscore_anon->setChecked($this->testOBJ->getHighscoreAnon()); $highscore_anon->setInfo($this->lng->txt("tst_highscore_anon_description")); $highscore->addSubItem($highscore_anon); $highscore_achieved_ts = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_achieved_ts"), "highscore_achieved_ts"); $highscore_achieved_ts->setValue(1); $highscore_achieved_ts->setChecked($this->testOBJ->getHighscoreAchievedTS()); $highscore_achieved_ts->setInfo($this->lng->txt("tst_highscore_achieved_ts_description")); $highscore->addSubItem($highscore_achieved_ts); $highscore_score = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_score"), "highscore_score"); $highscore_score->setValue(1); $highscore_score->setChecked($this->testOBJ->getHighscoreScore()); $highscore_score->setInfo($this->lng->txt("tst_highscore_score_description")); $highscore->addSubItem($highscore_score); $highscore_percentage = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_percentage"), "highscore_percentage"); $highscore_percentage->setValue(1); $highscore_percentage->setChecked($this->testOBJ->getHighscorePercentage()); $highscore_percentage->setInfo($this->lng->txt("tst_highscore_percentage_description")); $highscore->addSubItem($highscore_percentage); $highscore_hints = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_hints"), "highscore_hints"); $highscore_hints->setValue(1); $highscore_hints->setChecked($this->testOBJ->getHighscoreHints()); $highscore_hints->setInfo($this->lng->txt("tst_highscore_hints_description")); $highscore->addSubItem($highscore_hints); $highscore_wtime = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_wtime"), "highscore_wtime"); $highscore_wtime->setValue(1); $highscore_wtime->setChecked($this->testOBJ->getHighscoreWTime()); $highscore_wtime->setInfo($this->lng->txt("tst_highscore_wtime_description")); $highscore->addSubItem($highscore_wtime); $highscore_own_table = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_own_table"), "highscore_own_table"); $highscore_own_table->setValue(1); $highscore_own_table->setChecked($this->testOBJ->getHighscoreOwnTable()); $highscore_own_table->setInfo($this->lng->txt("tst_highscore_own_table_description")); $highscore->addSubItem($highscore_own_table); $highscore_top_table = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_top_table"), "highscore_top_table"); $highscore_top_table->setValue(1); $highscore_top_table->setChecked($this->testOBJ->getHighscoreTopTable()); $highscore_top_table->setInfo($this->lng->txt("tst_highscore_top_table_description")); $highscore->addSubItem($highscore_top_table); $highscore_top_num = new ilTextInputGUI($this->lng->txt("tst_highscore_top_num"), "highscore_top_num"); $highscore_top_num->setSize(4); $highscore_top_num->setSuffix($this->lng->txt("tst_highscore_top_num_unit")); $highscore_top_num->setValue($this->testOBJ->getHighscoreTopNum()); $highscore_top_num->setInfo($this->lng->txt("tst_highscore_top_num_description")); $highscore->addSubItem($highscore_top_num); if (!$this->settingsTemplate || $this->formShowTestExecutionSection($this->settingsTemplate->getSettings())) { $testExecution = new ilFormSectionHeaderGUI(); $testExecution->setTitle($this->lng->txt("tst_test_execution")); $form->addItem($testExecution); } // kiosk mode $kiosk = new ilCheckboxInputGUI($this->lng->txt("kiosk"), "kiosk"); $kiosk->setValue(1); $kiosk->setChecked($this->testOBJ->getKioskMode()); $kiosk->setInfo($this->lng->txt("kiosk_description")); // kiosk mode options $kiosktitle = new ilCheckboxGroupInputGUI($this->lng->txt("kiosk_options"), "kiosk_options"); $kiosktitle->addOption(new ilCheckboxOption($this->lng->txt("kiosk_show_title"), 'kiosk_title', '')); $kiosktitle->addOption(new ilCheckboxOption($this->lng->txt("kiosk_show_participant"), 'kiosk_participant', '')); $kiosktitle->addOption(new ilCheckboxOption($this->lng->txt('examid_in_kiosk'), 'examid_in_kiosk')); $values = array(); if ($this->testOBJ->getShowKioskModeTitle()) { array_push($values, 'kiosk_title'); } if ($this->testOBJ->getShowKioskModeParticipant()) { array_push($values, 'kiosk_participant'); } if ($this->testOBJ->getExamidInKiosk()) { array_push($values, 'examid_in_kiosk'); } $kiosktitle->setValue($values); $kiosktitle->setInfo($this->lng->txt("kiosk_options_desc")); $kiosk->addSubItem($kiosktitle); $form->addItem($kiosk); $redirection_mode = $this->testOBJ->getRedirectionMode(); $rm_enabled = new ilCheckboxInputGUI($this->lng->txt('redirect_after_finishing_tst'), 'redirection_enabled'); $rm_enabled->setChecked($redirection_mode == '0' ? false : true); $radio_rm = new ilRadioGroupInputGUI($this->lng->txt('redirect_after_finishing_tst'), 'redirection_mode'); $always = new ilRadioOption($this->lng->txt('tst_results_access_always'), REDIRECT_ALWAYS); $radio_rm->addOption($always); $kiosk = new ilRadioOption($this->lng->txt('redirect_in_kiosk_mode'), REDIRECT_KIOSK); $radio_rm->addOption($kiosk); $radio_rm->setValue(in_array($redirection_mode, array(REDIRECT_ALWAYS, REDIRECT_KIOSK)) ? $redirection_mode : REDIRECT_ALWAYS); $rm_enabled->addSubItem($radio_rm); $redirection_url = new ilTextInputGUI($this->lng->txt('redirection_url'), 'redirection_url'); $redirection_url->setValue((string) $this->testOBJ->getRedirectionUrl()); $redirection_url->setRequired(true); $rm_enabled->addSubItem($redirection_url); $form->addItem($rm_enabled); // Sign submission $sign_submission = $this->testOBJ->getSignSubmission(); $sign_submission_enabled = new ilCheckboxInputGUI($this->lng->txt('sign_submission'), 'sign_submission'); $sign_submission_enabled->setChecked($sign_submission); $sign_submission_enabled->setInfo($this->lng->txt('sign_submission_info')); $form->addItem($sign_submission_enabled); if (!$this->settingsTemplate || $this->formShowParticipantSection($this->settingsTemplate->getSettings())) { // participants properties $restrictions = new ilFormSectionHeaderGUI(); $restrictions->setTitle($this->lng->txt("tst_max_allowed_users")); $form->addItem($restrictions); } $fixedparticipants = new ilCheckboxInputGUI($this->lng->txt('participants_invitation'), "fixedparticipants"); $fixedparticipants->setValue(1); $fixedparticipants->setChecked($this->testOBJ->getFixedParticipants()); $fixedparticipants->setOptionTitle($this->lng->txt("tst_allow_fixed_participants")); $fixedparticipants->setInfo($this->lng->txt("participants_invitation_description")); $invited_users = $this->testOBJ->getInvitedUsers(); if ($total && count($invited_users) == 0) { $fixedparticipants->setDisabled(true); } $form->addItem($fixedparticipants); // simultaneous users $simul = new ilTextInputGUI($this->lng->txt("tst_allowed_users"), "allowedUsers"); $simul->setSize(3); $simul->setValue($this->testOBJ->getAllowedUsers() ? $this->testOBJ->getAllowedUsers() : ''); $form->addItem($simul); // idle time $idle = new ilTextInputGUI($this->lng->txt("tst_allowed_users_time_gap"), "allowedUsersTimeGap"); $idle->setSize(4); $idle->setSuffix($this->lng->txt("seconds")); $idle->setValue($this->testOBJ->getAllowedUsersTimeGap() ? $this->testOBJ->getAllowedUsersTimeGap() : ''); $form->addItem($idle); // Edit ecs export settings include_once 'Modules/Test/classes/class.ilECSTestSettings.php'; $ecs = new ilECSTestSettings($this->testOBJ); $ecs->addSettingsToForm($form, 'tst'); // remove items when using template if ($this->settingsTemplate) { foreach ($this->settingsTemplate->getSettings() as $id => $item) { if ($item["hide"]) { $form->removeItemByPostVar($id); } } } return $form; }
protected function initNewAccountMailForm() { global $lng, $ilCtrl; $lng->loadLanguageModule("meta"); $lng->loadLanguageModule("mail"); include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($ilCtrl->getFormAction($this)); $form->setTitleIcon(ilUtil::getImagePath("icon_mail.png")); $form->setTitle($lng->txt("user_new_account_mail")); $form->setDescription($lng->txt("user_new_account_mail_desc")); $langs = $lng->getInstalledLanguages(); foreach ($langs as $lang_key) { $amail = $this->object->_lookupNewAccountMail($lang_key); $title = $lng->txt("meta_l_" . $lang_key); if ($lang_key == $lng->getDefaultLanguage()) { $title .= " (" . $lng->txt("default") . ")"; } $header = new ilFormSectionHeaderGUI(); $header->setTitle($title); $form->addItem($header); $subj = new ilTextInputGUI($lng->txt("subject"), "subject_" . $lang_key); // $subj->setRequired(true); $subj->setValue($amail["subject"]); $form->addItem($subj); $salg = new ilTextInputGUI($lng->txt("mail_salutation_general"), "sal_g_" . $lang_key); // $salg->setRequired(true); $salg->setValue($amail["sal_g"]); $form->addItem($salg); $salf = new ilTextInputGUI($lng->txt("mail_salutation_female"), "sal_f_" . $lang_key); // $salf->setRequired(true); $salf->setValue($amail["sal_f"]); $form->addItem($salf); $salm = new ilTextInputGUI($lng->txt("mail_salutation_male"), "sal_m_" . $lang_key); // $salm->setRequired(true); $salm->setValue($amail["sal_m"]); $form->addItem($salm); $body = new ilTextAreaInputGUI($lng->txt("message_content"), "body_" . $lang_key); // $body->setRequired(true); $body->setValue($amail["body"]); $body->setRows(10); $body->setCols(100); $form->addItem($body); $att = new ilFileInputGUI($lng->txt("attachment"), "att_" . $lang_key); $att->setAllowDeletion(true); if ($amail["att_file"]) { $att->setValue($amail["att_file"]); } $form->addItem($att); } $form->addCommandButton("saveNewAccountMail", $lng->txt("save")); $form->addCommandButton("cancelNewAccountMail", $lng->txt("cancel")); return $form; }
protected function initSettingsForm() { global $ilSetting; include_once 'Services/Form/classes/class.ilPropertyFormGUI.php'; $form = new ilPropertyFormGUI(); $form->setTitle($this->lng->txt("settings")); $form->setFormAction($this->ctrl->getFormAction($this, 'saveSettings')); // default repository view $options = array("flat" => $this->lng->txt("flatview"), "tree" => $this->lng->txt("treeview")); $si = new ilSelectInputGUI($this->lng->txt("def_repository_view"), "default_rep_view"); $si->setOptions($options); $si->setInfo($this->lng->txt("")); if ($ilSetting->get("default_repository_view") == "tree") { $si->setValue("tree"); } else { $si->setValue("flat"); } $form->addItem($si); // $options = array("" => $this->lng->txt("adm_rep_tree_only_container"), "tree" => $this->lng->txt("adm_all_resource_types")); // repository tree $radg = new ilRadioGroupInputGUI($this->lng->txt("adm_rep_tree_presentation"), "tree_pres"); $radg->setValue($ilSetting->get("repository_tree_pres")); $op1 = new ilRadioOption($this->lng->txt("adm_rep_tree_only_cntr"), "", $this->lng->txt("adm_rep_tree_only_cntr_info")); $radg->addOption($op1); $op2 = new ilRadioOption($this->lng->txt("adm_rep_tree_all_types"), "all_types", $this->lng->txt("adm_rep_tree_all_types_info")); // limit tree in courses and groups $cb = new ilCheckboxInputGUI($this->lng->txt("adm_rep_tree_limit_grp_crs"), "rep_tree_limit_grp_crs"); $cb->setChecked($ilSetting->get("rep_tree_limit_grp_crs")); $cb->setInfo($this->lng->txt("adm_rep_tree_limit_grp_crs_info")); $op2->addSubItem($cb); $radg->addOption($op2); $form->addItem($radg); /* OBSOLETE // synchronize repository tree with main view $cb = new ilCheckboxInputGUI($this->lng->txt("adm_synchronize_rep_tree"), "rep_tree_synchronize"); $cb->setInfo($this->lng->txt("adm_synchronize_rep_tree_info")); $cb->setChecked($ilSetting->get("rep_tree_synchronize")); $form->addItem($cb); */ /* DISABLED // repository access check $options = array( 0 => "0", 10 => "10", 30 => "30", 60 => "60", 120 => "120" ); $si = new ilSelectInputGUI($this->lng->txt("adm_repository_cache_time"), "rep_cache"); $si->setOptions($options); $si->setValue($ilSetting->get("rep_cache")); $si->setInfo($this->lng->txt("adm_repository_cache_time_info")." ". $this->lng->txt("adm_repository_cache_time_info2")); $form->addItem($si); */ // trash $cb = new ilCheckboxInputGUI($this->lng->txt("enable_trash"), "enable_trash"); $cb->setInfo($this->lng->txt("enable_trash_info")); if ($ilSetting->get("enable_trash")) { $cb->setChecked(true); } $form->addItem($cb); // change event require_once 'Services/Tracking/classes/class.ilChangeEvent.php'; $this->lng->loadLanguageModule("trac"); $event = new ilCheckboxInputGUI($this->lng->txt('trac_repository_changes'), 'change_event_tracking'); $event->setChecked(ilChangeEvent::_isActive()); $form->addItem($event); include_once "Services/Administration/classes/class.ilAdministrationSettingsFormHandler.php"; ilAdministrationSettingsFormHandler::addFieldsToForm(ilAdministrationSettingsFormHandler::FORM_REPOSITORY, $form, $this); // object lists $lists = new ilFormSectionHeaderGUI(); $lists->setTitle($this->lng->txt("rep_object_lists")); $form->addItem($lists); $sdesc = new ilCheckboxInputGUI($this->lng->txt("adm_rep_shorten_description"), "rep_shorten_description"); $sdesc->setInfo($this->lng->txt("adm_rep_shorten_description_info")); $sdesc->setChecked($ilSetting->get("rep_shorten_description")); $form->addItem($sdesc); $sdesclen = new ilTextInputGUI($this->lng->txt("adm_rep_shorten_description_length"), "rep_shorten_description_length"); $sdesclen->setValue($ilSetting->get("rep_shorten_description_length")); $sdesclen->setSize(3); $sdesc->addSubItem($sdesclen); // load action commands asynchronously $cb = new ilCheckboxInputGUI($this->lng->txt("adm_item_cmd_asynch"), "item_cmd_asynch"); $cb->setInfo($this->lng->txt("adm_item_cmd_asynch_info")); $cb->setChecked($ilSetting->get("item_cmd_asynch")); $form->addItem($cb); // notes/comments/tagging $pl = new ilCheckboxInputGUI($this->lng->txt('adm_show_comments_tagging_in_lists'), 'comments_tagging_in_lists'); $pl->setValue(1); $pl->setChecked($ilSetting->get('comments_tagging_in_lists')); $form->addItem($pl); $form->addCommandButton('saveSettings', $this->lng->txt('save')); return $form; }
/** * list files */ function renameFileForm() { global $lng, $ilCtrl; if (!isset($_POST["file"])) { $this->ilias->raiseError($this->lng->txt("no_checkbox"), $this->ilias->error_obj->MESSAGE); } if (count($_POST["file"]) > 1) { $this->ilias->raiseError($this->lng->txt("cont_select_max_one_item"), $this->ilias->error_obj->MESSAGE); } if (ilUtil::stripSlashes($_POST["file"][0]) == "..") { $this->ilias->raiseError($this->lng->txt("select_a_file"), $this->ilias->error_obj->MESSAGE); } $cur_subdir = str_replace(".", "", ilUtil::stripSlashes($_GET["cdir"])); $file = !empty($cur_subdir) ? $this->main_dir . "/" . $cur_subdir . "/" . ilUtil::stripSlashes($_POST["file"][0]) : $this->main_dir . "/" . ilUtil::stripSlashes($_POST["file"][0]); $this->ctrl->setParameter($this, "old_name", ilUtil::stripSlashes($_POST["file"][0])); include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); // file/dir name $ti = new ilTextInputGUI($this->lng->txt("name"), "new_name"); $ti->setMaxLength(200); $ti->setSize(40); $ti->setValue(ilUtil::stripSlashes($_POST["file"][0])); $form->addItem($ti); // save and cancel commands $form->addCommandButton("renameFile", $lng->txt("rename")); $form->addCommandButton("cancelRename", $lng->txt("cancel")); $form->setFormAction($ilCtrl->getFormAction($this, "renameFile")); if (@is_dir($file)) { $form->setTitle($this->lng->txt("cont_rename_dir")); } else { $form->setTitle($this->lng->txt("rename_file")); } $this->tpl->setContent($form->getHTML()); }
/** * Init category mapping form * @return */ protected function initCategoryMappingForm($a_mode = 'add') { global $ilDB; if (is_object($this->form)) { return true; } include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; include_once './Services/WebServices/ECS/classes/class.ilECSCategoryMappingRule.php'; $this->form = new ilPropertyFormGUI(); if ($a_mode == 'add') { $this->form->setTitle($this->lng->txt('ecs_new_category_mapping')); $this->form->setFormAction($this->ctrl->getFormAction($this, 'categoryMapping')); $this->form->addCommandButton('addCategoryMapping', $this->lng->txt('save')); $this->form->addCommandButton('categoryMapping', $this->lng->txt('cancel')); } else { $this->form->setTitle($this->lng->txt('ecs_edit_category_mapping')); $this->form->setFormAction($this->ctrl->getFormAction($this, 'editCategoryMapping')); $this->form->addCommandButton('updateCategoryMapping', $this->lng->txt('save')); $this->form->addCommandButton('categoryMapping', $this->lng->txt('cancel')); } $imp = new ilCustomInputGUI($this->lng->txt('ecs_import_id'), 'import_id'); $imp->setRequired(true); $tpl = new ilTemplate('tpl.ecs_import_id_form.html', true, true, 'Services/WebServices/ECS'); $tpl->setVariable('SIZE', 5); $tpl->setVariable('MAXLENGTH', 11); $tpl->setVariable('POST_VAR', 'import_id'); $tpl->setVariable('PROPERTY_VALUE', $this->rule->getContainerId()); if ($this->settings->getImportId()) { $tpl->setVariable('COMPLETE_PATH', $this->buildPath($this->rule->getContainerId())); } $imp->setHTML($tpl->get()); $imp->setInfo($this->lng->txt('ecs_import_id_info')); $this->form->addItem($imp); include_once './Services/WebServices/ECS/classes/class.ilECSCategoryMapping.php'; $select = new ilSelectInputGUI($this->lng->txt('ecs_attribute_name'), 'field'); $select->setValue($this->rule->getFieldName()); $select->setRequired(true); $select->setOptions(ilECSCategoryMapping::getPossibleFields()); $this->form->addItem($select); // Value $value = new ilRadioGroupInputGUI($this->lng->txt('ecs_cat_mapping_type'), 'type'); $value->setValue($this->rule->getMappingType()); $value->setRequired(true); $fixed = new ilRadioOption($this->lng->txt('ecs_cat_mapping_fixed'), ilECSCategoryMappingRule::TYPE_FIXED); $fixed->setInfo($this->lng->txt('ecs_cat_mapping_fixed_info')); $fixed_val = new ilTextInputGUI($this->lng->txt('ecs_cat_mapping_values'), 'mapping_value'); $fixed_val->setValue($this->rule->getMappingValue()); $fixed_val->setMaxLength(255); $fixed_val->setSize(40); $fixed_val->setRequired(true); $fixed->addSubItem($fixed_val); $value->addOption($fixed); $duration = new ilRadioOption($this->lng->txt('ecs_cat_mapping_duration'), ilECSCategoryMappingRule::TYPE_DURATION); $duration->setInfo($this->lng->txt('ecs_cat_mapping_duration_info')); $dur_start = new ilDateTimeInputGUI($this->lng->txt('from'), 'dur_begin'); $dur_start->setDate($this->rule->getDateRangeStart()); $duration->addSubItem($dur_start); $dur_end = new ilDateTimeInputGUI($this->lng->txt('to'), 'dur_end'); $dur_end->setDate($this->rule->getDateRangeEnd()); $duration->addSubItem($dur_end); $value->addOption($duration); $type = new ilRadioOption($this->lng->txt('ecs_cat_mapping_by_type'), ilECSCategoryMappingRule::TYPE_BY_TYPE); $type->setInfo($this->lng->txt('ecs_cat_mapping_by_type_info')); $options = ilECSUtils::getPossibleRemoteTypes(true); $types = new ilSelectInputGUI($this->lng->txt('type'), 'by_type'); $types->setOptions($options); $types->setValue($this->rule->getByType()); $types->setRequired(true); $type->addSubitem($types); $value->addOption($type); $this->form->addItem($value); }
/** * Add basic question form properties: * assessment: title, author, description, question, working time * * @return int Default Nr of Tries */ function addBasicQuestionFormProperties($form) { // title $title = new ilTextInputGUI($this->lng->txt("title"), "title"); $title->setValue($this->object->getTitle()); $title->setRequired(TRUE); $form->addItem($title); if (!$this->object->getSelfAssessmentEditingMode()) { // author $author = new ilTextInputGUI($this->lng->txt("author"), "author"); $author->setValue($this->object->getAuthor()); $author->setRequired(TRUE); $form->addItem($author); // description $description = new ilTextInputGUI($this->lng->txt("description"), "comment"); $description->setValue($this->object->getComment()); $description->setRequired(FALSE); $form->addItem($description); } else { // author as hidden field $hi = new ilHiddenInputGUI("author"); $author = ilUtil::prepareFormOutput($this->object->getAuthor()); if (trim($author) == "") { $author = "-"; } $hi->setValue($author); $form->addItem($hi); } // questiontext $question = new ilTextAreaInputGUI($this->lng->txt("question"), "question"); $question->setValue($this->object->prepareTextareaOutput($this->object->getQuestion())); $question->setRequired(TRUE); $question->setRows(10); $question->setCols(80); if (!$this->object->getSelfAssessmentEditingMode()) { if ($this->object->getAdditionalContentEditingMode() != assQuestion::ADDITIONAL_CONTENT_EDITING_MODE_PAGE_OBJECT) { $question->setUseRte(TRUE); include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php"; $question->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("assessment")); $question->addPlugin("latex"); $question->addButton("latex"); $question->addButton("pastelatex"); $question->setRTESupport($this->object->getId(), "qpl", "assessment"); } } else { $question->setRteTags(self::getSelfAssessmentTags()); $question->setUseTagsForRteOnly(false); } $form->addItem($question); if (!$this->object->getSelfAssessmentEditingMode()) { // duration $duration = new ilDurationInputGUI($this->lng->txt("working_time"), "Estimated"); $duration->setShowHours(TRUE); $duration->setShowMinutes(TRUE); $duration->setShowSeconds(TRUE); $ewt = $this->object->getEstimatedWorkingTime(); $duration->setHours($ewt["h"]); $duration->setMinutes($ewt["m"]); $duration->setSeconds($ewt["s"]); $duration->setRequired(FALSE); $form->addItem($duration); } else { // number of tries if (strlen($this->object->getNrOfTries())) { $nr_tries = $this->object->getNrOfTries(); } else { $nr_tries = $this->object->getDefaultNrOfTries(); } if ($nr_tries < 1) { $nr_tries = ""; } $ni = new ilNumberInputGUI($this->lng->txt("qst_nr_of_tries"), "nr_of_tries"); $ni->setValue($nr_tries); $ni->setMinValue(0); $ni->setSize(5); $ni->setMaxLength(5); $form->addItem($ni); } }
/** * Init form * * @param string $a_cmd * @return ilPropertyFormGUI */ public function initForm($a_cmd = "") { global $ilCtrl, $lng; $lng->loadLanguageModule('crs'); include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; $form = new ilPropertyFormGUI(); $form->setFormAction($ilCtrl->getFormAction($this->parent_obj, $a_cmd)); $form->setTarget('_blank'); $form->setTitle($lng->txt('sess_gen_attendance_list')); $title = new ilTextInputGUI($lng->txt('title'), 'title'); $title->setValue($this->title); $form->addItem($title); $desc = new ilTextInputGUI($lng->txt('description'), 'desc'); $desc->setValue($this->description); $form->addItem($desc); if (sizeof($this->presets)) { $preset = new ilCheckboxGroupInputGUI($lng->txt('user_detail'), 'preset'); $preset_value = array(); foreach ($this->presets as $id => $item) { $preset->addOption(new ilCheckboxOption($item[0], $id)); if ($item[1]) { $preset_value[] = $id; } } $preset->setValue($preset_value); $form->addItem($preset); } $blank = new ilTextInputGUI($lng->txt('event_blank_columns'), 'blank'); $blank->setMulti(true); $form->addItem($blank); if ($this->pre_blanks) { $blank->setValue($this->pre_blanks); } $part = new ilFormSectionHeaderGUI(); $part->setTitle($lng->txt('event_participant_selection')); $form->addItem($part); // Admins $admin = new ilCheckboxInputGUI($lng->txt('event_tbl_admins'), 'show_admins'); $admin->setOptionTitle($lng->txt('event_inc_admins')); $admin->setValue(1); $form->addItem($admin); // Tutors $tutor = new ilCheckboxInputGUI($lng->txt('event_tbl_tutors'), 'show_tutors'); $tutor->setOptionTitle($lng->txt('event_inc_tutors')); $tutor->setValue(1); $form->addItem($tutor); // Members $member = new ilCheckboxInputGUI($lng->txt('event_tbl_members'), 'show_members'); $member->setOptionTitle($lng->txt('event_inc_members')); $member->setValue(1); $member->setChecked(true); $form->addItem($member); $form->addCommandButton($a_cmd, $lng->txt('sess_print_attendance_list')); if ($this->id && $a_cmd) { include_once "Services/User/classes/class.ilUserFormSettings.php"; $settings = new ilUserFormSettings($this->id); $settings->exportToForm($form); } return $form; }
public function populateQuestionSpecificFormPart(ilPropertyFormGUI $form) { // maxsize $maxsize = new ilNumberInputGUI($this->lng->txt("maxsize"), "maxsize"); $maxsize->setValue($this->object->getMaxSize()); $maxsize->setInfo($this->lng->txt("maxsize_info")); $maxsize->setSize(10); $maxsize->setMinValue(0); $maxsize->setMaxValue($this->determineMaxFilesize()); $maxsize->setRequired(FALSE); $form->addItem($maxsize); // allowedextensions $allowedextensions = new ilTextInputGUI($this->lng->txt("allowedextensions"), "allowedextensions"); $allowedextensions->setInfo($this->lng->txt("allowedextensions_info")); $allowedextensions->setValue($this->object->getAllowedExtensions()); $allowedextensions->setRequired(FALSE); $form->addItem($allowedextensions); // points $points = new ilNumberInputGUI($this->lng->txt("points"), "points"); $points->allowDecimals(true); $points->setValue(is_numeric($this->object->getPoints()) && $this->object->getPoints() >= 0 ? $this->object->getPoints() : ''); $points->setRequired(TRUE); $points->setSize(3); $points->setMinValue(0.0); $points->setMinvalueShouldBeGreater(false); $form->addItem($points); $subcompl = new ilCheckboxInputGUI($this->lng->txt('ass_completion_by_submission'), 'completion_by_submission'); $subcompl->setInfo($this->lng->txt('ass_completion_by_submission_info')); $subcompl->setValue(1); $subcompl->setChecked($this->object->isCompletionBySubmissionEnabled()); $form->addItem($subcompl); return $form; }
/** * Init renaming form. * * @param int $a_mode Edit Mode */ protected function initRenameForm() { global $lng, $ilCtrl; include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form = new ilPropertyFormGUI(); // new name $ti = new ilTextInputGUI($lng->txt("wiki_new_page_name"), "new_page_name"); $ti->setMaxLength(200); $ti->setSize(50); $ti->setValue($this->getPageObject()->getTitle()); $ti->setRequired(true); $this->form->addItem($ti); $this->form->addCommandButton("renamePage", $lng->txt("wiki_rename")); $this->form->addCommandButton("preview", $lng->txt("cancel")); $this->form->setTitle($lng->txt("wiki_rename_page")); $this->form->setFormAction($ilCtrl->getFormAction($this)); }
/** * init edit/create category form * * @access protected * @return */ protected function initFormCategory($a_mode) { global $rbacsystem, $ilUser; include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; include_once './Services/Calendar/classes/class.ilCalendarCategory.php'; include_once './Services/Calendar/classes/class.ilCalendarCategories.php'; $cat_info = ilCalendarCategories::_getInstance()->getCategoryInfo((int) $_GET['category_id']); $this->form = new ilPropertyFormGUI(); #$this->form->setTableWidth('40%'); switch ($a_mode) { case 'edit': $category = new ilCalendarCategory((int) $_GET['category_id']); $this->form->setTitle($this->lng->txt('cal_edit_category')); $this->ctrl->saveParameter($this, array('seed', 'category_id')); $this->form->setFormAction($this->ctrl->getFormAction($this)); if ($this->isEditable()) { $this->form->addCommandButton('update', $this->lng->txt('save')); /* if($cat_info['type'] == ilCalendarCategory::TYPE_USR) { $this->form->addCommandButton('shareSearch',$this->lng->txt('cal_share')); } $this->form->addCommandButton('confirmDelete',$this->lng->txt('delete')); */ $this->form->addCommandButton('manage', $this->lng->txt('cancel')); } break; case 'create': $this->editable = true; $category = new ilCalendarCategory(0); $this->ctrl->saveParameter($this, array('category_id')); $this->form->setFormAction($this->ctrl->getFormAction($this)); $this->form->setTitle($this->lng->txt('cal_add_category')); $this->form->addCommandButton('save', $this->lng->txt('save')); $this->form->addCommandButton('manage', $this->lng->txt('cancel')); break; } // Calendar name $title = new ilTextInputGUI($this->lng->txt('cal_calendar_name'), 'title'); if ($a_mode == 'edit') { $title->setDisabled(!$this->isEditable()); } $title->setRequired(true); $title->setMaxLength(64); $title->setSize(32); $title->setValue($category->getTitle()); $this->form->addItem($title); include_once './Services/Calendar/classes/class.ilCalendarSettings.php'; if ($a_mode == 'create' and $rbacsystem->checkAccess('edit_event', ilCalendarSettings::_getInstance()->getCalendarSettingsId())) { $type = new ilRadioGroupInputGUI($this->lng->txt('cal_cal_type'), 'type'); $type->setValue($category->getType()); $type->setRequired(true); $opt = new ilRadioOption($this->lng->txt('cal_type_personal'), ilCalendarCategory::TYPE_USR); $type->addOption($opt); $opt = new ilRadioOption($this->lng->txt('cal_type_system'), ilCalendarCategory::TYPE_GLOBAL); $type->addOption($opt); $type->setInfo($this->lng->txt('cal_type_info')); $this->form->addItem($type); } $color = new ilColorPickerInputGUI($this->lng->txt('cal_calendar_color'), 'color'); $color->setValue($category->getColor()); if (!$this->isEditable()) { $color->setDisabled(true); } $color->setRequired(true); $this->form->addItem($color); $location = new ilRadioGroupInputGUI($this->lng->txt('cal_type_rl'), 'type_rl'); $location->setDisabled($a_mode == 'edit'); $location_local = new ilRadioOption($this->lng->txt('cal_type_local'), ilCalendarCategory::LTYPE_LOCAL); $location->addOption($location_local); $location_remote = new ilRadioOption($this->lng->txt('cal_type_remote'), ilCalendarCategory::LTYPE_REMOTE); $location->addOption($location_remote); $location->setValue($category->getLocationType()); $url = new ilTextInputGUI($this->lng->txt('cal_remote_url'), 'remote_url'); $url->setDisabled($a_mode == 'edit'); $url->setValue($category->getRemoteUrl()); $url->setMaxLength(500); $url->setSize(60); $url->setRequired(true); $location_remote->addSubItem($url); $user = new ilTextInputGUI($this->lng->txt('username'), 'remote_user'); $user->setDisabled($a_mode == 'edit'); $user->setValue($category->getRemoteUser()); $user->setMaxLength(50); $user->setSize(20); $user->setRequired(false); $location_remote->addSubItem($user); $pass = new ilPasswordInputGUI($this->lng->txt('password'), 'remote_pass'); $pass->setDisabled($a_mode == 'edit'); $pass->setValue($category->getRemotePass()); $pass->setMaxLength(50); $pass->setSize(20); $pass->setRetype(false); $pass->setInfo($this->lng->txt('remote_pass_info')); $location_remote->addSubItem($pass); $this->form->addItem($location); }
public function editCurrencyObject() { $currency_id = $_POST['currency_id']; $obj_currency = ilPaymentCurrency::_getCurrency($currency_id); $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment'); $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this)); $form->setTitle($this->lng->txt('paya_edit_currency')); $o_Unit = new ilTextInputGUI($this->lng->txt('paya_currency_unit'), 'currency_unit'); $o_Unit->setValue($obj_currency[$currency_id]['unit']); $o_Unit->setPostVar('currency_unit'); $o_Unit->setRequired(true); $o_Isocode = new ilTextInputGUI($this->lng->txt('iso_code'), 'iso_code'); $o_Isocode->setValue($obj_currency[$currency_id]['iso_code']); $o_Isocode->setPostVar('iso_code'); $o_Isocode->setRequired(true); $o_Symbol = new ilTextInputGUI($this->lng->txt('symbol'), 'symbol'); $o_Symbol->setValue($obj_currency[$currency_id]['symbol']); $o_Symbol->setPostVar('symbol'); $o_Symbol->setRequired(true); $o_Conversionrate = new IlTextInputGUI($this->lng->txt('conversion_rate'), 'conversion_rate'); $o_Conversionrate->setValue($obj_currency[$currency_id]['conversion_rate']); $o_Conversionrate->setPostVar('conversion_rate'); $o_Conversionrate->setRequired(true); $o_hidden = new ilHiddenInputGUI('currency_id'); $o_hidden->setValue($obj_currency[$currency_id]['currency_id']); $o_hidden->setPostVar('currency_id'); $form->addItem($o_hidden); $form->addItem($o_Unit); $form->addItem($o_Isocode); $form->addItem($o_Symbol); $form->addItem($o_Conversionrate); $form->addCommandButton('updateCurrency', $this->lng->txt('save')); $form->addCommandButton('currencies', $this->lng->txt('cancel')); $this->tpl->setVariable('FORM', $form->getHTML()); }
protected function initAddNewEntryForm($a_id = null) { global $ilCtrl; if (!$a_id) { $a_id = $_POST["id"]; } if (!$a_id || !in_array($a_id, ilObjLanguageAccess::_getSavedTopics())) { $ilCtrl->redirect($this, "view"); } include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($ilCtrl->getFormAction($this, "saveNewEntry")); $form->setTitle($this->lng->txt("adm_missing_entry_add")); $mods = ilObjLanguageAccess::_getSavedModules(); $options = array_combine($mods, $mods); $mod = new ilSelectInputGUI(ucfirst($this->lng->txt("module")), "mod"); $mod->setOptions(array("" => $this->lng->txt("please_select")) + $options); $mod->setRequired(true); $form->addItem($mod); $id = new ilTextInputGUI(ucfirst($this->lng->txt("identifier")), "id"); $id->setValue($a_id); $id->setDisabled(true); $form->addItem($id); foreach ($this->lng->getInstalledLanguages() as $lang_key) { $trans = new ilTextInputGUI($this->lng->txt("meta_l_" . $lang_key), "trans_" . $lang_key); if (in_array($lang_key, array("de", "en"))) { $trans->setRequired(true); } $form->addItem($trans); } $form->addCommandButton("saveNewEntry", $this->lng->txt("save")); $form->addCommandButton("view", $this->lng->txt("cancel")); return $form; }
function initAddPageLayoutForm() { global $lng, $ilCtrl; $lng->loadLanguageModule("content"); include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form_gui = new ilPropertyFormGUI(); $form_gui->setFormAction($ilCtrl->getFormAction($this)); $form_gui->setTitle($lng->txt("sty_create_pgl")); include_once "Services/Form/classes/class.ilRadioMatrixInputGUI.php"; $title_input = new ilTextInputGUI($lng->txt("title"), "pgl_title"); $title_input->setSize(50); $title_input->setMaxLength(128); $title_input->setValue($this->layout_object->title); $title_input->setTitle($lng->txt("title")); $title_input->setRequired(true); $desc_input = new ilTextAreaInputGUI($lng->txt("description"), "pgl_desc"); $desc_input->setValue($this->layout_object->description); $desc_input->setRows(3); $desc_input->setCols(37); // special page? $options = array("0" => $lng->txt("cont_layout_template"), "1" => $lng->txt("cont_special_page")); $si = new ilSelectInputGUI($this->lng->txt("type"), "special_page"); $si->setOptions($options); // modules $mods = new ilCheckboxGroupInputGUI($this->lng->txt("modules"), "module"); // $mods->setRequired(true); foreach (ilPageLayout::getAvailableModules() as $mod_id => $mod_caption) { $mod = new ilCheckboxOption($mod_caption, $mod_id); $mods->addOption($mod); } $ttype_input = new ilSelectInputGUI($lng->txt("sty_based_on"), "pgl_template"); $arr_templates = ilPageLayout::getLayouts(); $arr_templates1 = ilPageLayout::getLayouts(false, true); foreach ($arr_templates1 as $v) { $arr_templates[] = $v; } $options = array(); $options['-1'] = $lng->txt("none"); foreach ($arr_templates as $templ) { $templ->readObject(); $key = $templ->getId(); $value = $templ->getTitle(); $options[$key] = $value; } $ttype_input->setOptions($options); $ttype_input->setValue(-1); $ttype_input->setRequired(true); $desc_input->setTitle($lng->txt("description")); $desc_input->setRequired(false); $form_gui->addItem($title_input); $form_gui->addItem($desc_input); $form_gui->addItem($si); $form_gui->addItem($mods); $form_gui->addItem($ttype_input); $form_gui->addCommandButton("createPg", $lng->txt("save")); $form_gui->addCommandButton("cancelCreate", $lng->txt("cancel")); return $form_gui; }
protected function initSearchForm() { global $ilCtrl; if ($_GET["ref"] != "wsp") { $this->saveMailData(); $title = $this->lng->txt('search_recipients'); } else { $this->lng->loadLanguageModule("wsp"); $title = $this->lng->txt("wsp_share_search_users"); } // searchform include_once 'Services/Form/classes/class.ilPropertyFormGUI.php'; $form = new ilPropertyFormGUI(); $form->setTitle($title); $form->setId('search_rcp'); $form->setFormAction($ilCtrl->getFormAction($this, 'search')); $inp = new ilTextInputGUI($this->lng->txt("search_for"), 'search'); $inp->setSize(30); $dsDataLink = $ilCtrl->getLinkTarget($this, 'lookupRecipientAsync', '', true, false); $inp->setDataSource($dsDataLink); if (strlen(trim($_SESSION["mail_search_search"])) > 0) { $inp->setValue(ilUtil::prepareFormOutput(trim($_SESSION["mail_search_search"]), true)); } $form->addItem($inp); $form->addCommandButton('search', $this->lng->txt("search")); $form->addCommandButton('cancel', $this->lng->txt("cancel")); return $form; }
/** * Edit disk quota settings. */ public function editDiskQuotaSettings() { global $rbacsystem, $ilErr, $ilSetting, $tpl, $lng, $ilCtrl; if (!$rbacsystem->checkAccess("visible,read", $this->object->getRefId())) { $ilErr->raiseError($lng->txt("no_permission"), $ilErr->WARNING); } $this->tabs_gui->setTabActive('disk_quota'); $this->addDiskQuotaSubtabs('settings'); require_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; require_once "./Services/Form/classes/class.ilCheckboxInputGUI.php"; require_once "./Services/Form/classes/class.ilRadioGroupInputGUI.php"; require_once "./Services/Form/classes/class.ilRadioOption.php"; require_once "./Services/Form/classes/class.ilTextAreaInputGUI.php"; require_once "./Services/WebDAV/classes/class.ilDAVServer.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($ilCtrl->getFormAction($this)); $form->setTitle($lng->txt("settings")); // Enable disk quota $cb_prop = new ilCheckboxInputGUI($lng->txt("enable_disk_quota"), "enable_disk_quota"); $cb_prop->setValue('1'); $cb_prop->setChecked($this->disk_quota_obj->isDiskQuotaEnabled()); $cb_prop->setInfo($lng->txt('enable_disk_quota_info')); $form->addItem($cb_prop); // Enable disk quota reminder mail $cb_prop_reminder = new ilCheckboxInputGUI($lng->txt("enable_disk_quota_reminder_mail"), "enable_disk_quota_reminder_mail"); $cb_prop_reminder->setValue('1'); $cb_prop_reminder->setChecked($this->disk_quota_obj->isDiskQuotaReminderMailEnabled()); $cb_prop_reminder->setInfo($lng->txt('disk_quota_reminder_mail_desc')); $cb_prop->addSubItem($cb_prop_reminder); // Enable summary mail for certain users $cb_prop_summary = new ilCheckboxInputGUI($lng->txt("enable_disk_quota_summary_mail"), "enable_disk_quota_summary_mail"); $cb_prop_summary->setValue(1); $cb_prop_summary->setChecked($this->disk_quota_obj->isDiskQuotaSummaryMailEnabled()); $cb_prop_summary->setInfo($lng->txt('enable_disk_quota_summary_mail_desc')); $cb_prop->addSubItem($cb_prop_summary); // Edit disk quota recipients $summary_rcpt = new ilTextInputGUI($lng->txt("disk_quota_summary_rctp"), "disk_quota_summary_rctp"); $summary_rcpt->setValue($this->disk_quota_obj->getSummaryRecipients()); $summary_rcpt->setInfo($lng->txt('disk_quota_summary_rctp_desc')); $cb_prop_summary->addSubItem($summary_rcpt); // command buttons $form->addCommandButton('saveDiskQuotaSettings', $lng->txt('save')); $form->addCommandButton('editDiskQuotaSettings', $lng->txt('cancel')); $tpl->setContent($form->getHTML()); }
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); }
/** * show information screen */ function infoScreen() { global $ilAccess, $ilTabs, $ilUser, $ilToolbar; if (!$this->external_rater_360 && !$ilAccess->checkAccess("visible", "", $this->ref_id)) { $this->ilias->raiseError($this->lng->txt("msg_no_perm_read"), $this->ilias->error_obj->MESSAGE); } $ilTabs->activateTab("info_short"); include_once "./Modules/Survey/classes/class.ilSurveyExecutionGUI.php"; $output_gui =& new ilSurveyExecutionGUI($this->object); include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php"; $info = new ilInfoScreenGUI($this); $info->enablePrivateNotes(); // "active" survey? $canStart = $this->object->canStartSurvey(null, $this->external_rater_360); $showButtons = $canStart["result"]; if (!$showButtons) { if ($canStart["edit_settings"] && $ilAccess->checkAccess("write", "", $this->ref_id)) { $canStart["messages"][] = "<a href=\"" . $this->ctrl->getLinkTarget($this, "properties") . "\">» " . $this->lng->txt("survey_edit_settings") . "</a>"; } ilUtil::sendInfo(implode("<br />", $canStart["messages"])); } $big_button = false; if ($showButtons) { // closing survey? $is_appraisee = false; if ($this->object->get360Mode() && $this->object->isAppraisee($ilUser->getId())) { $info->addSection($this->lng->txt("survey_360_appraisee_info")); $appr_data = $this->object->getAppraiseesData(); $appr_data = $appr_data[$ilUser->getId()]; $info->addProperty($this->lng->txt("survey_360_raters_status_info"), $appr_data["finished"]); if (!$appr_data["closed"]) { include_once "Services/UIComponent/Button/classes/class.ilLinkButton.php"; $button = ilLinkButton::getInstance(); $button->setCaption("survey_360_appraisee_close_action"); $button->setUrl($this->ctrl->getLinkTargetByClass("ilsurveyparticipantsgui", "confirmappraiseeclose")); $close_button_360 = '<div>' . $button->render() . '</div>'; $txt = "survey_360_appraisee_close_action_info"; if ($this->object->get360SkillService()) { $txt .= "_skill"; } $info->addProperty($this->lng->txt("status"), $close_button_360 . $this->lng->txt($txt)); } else { ilDatePresentation::setUseRelativeDates(false); $dt = new ilDateTime($appr_data["closed"], IL_CAL_UNIX); $info->addProperty($this->lng->txt("status"), sprintf($this->lng->txt("survey_360_appraisee_close_action_status"), ilDatePresentation::formatDate($dt))); } $is_appraisee = true; } // handle code // validate incoming $code_input = false; $anonymous_code = $_POST["anonymous_id"]; if ($anonymous_code) { $code_input = true; // if(!$this->object->isUnusedCode($anonymous_code, $ilUser->getId())) if (!$this->object->checkSurveyCode($anonymous_code)) { $anonymous_code = null; } else { // #15860 $this->object->bindSurveyCodeToUser($ilUser->getId(), $anonymous_code); } } if ($anonymous_code) { $_SESSION["anonymous_id"][$this->object->getId()] = $anonymous_code; } else { $anonymous_code = $_SESSION["anonymous_id"][$this->object->getId()]; if ($anonymous_code) { $code_input = true; } } // try to find code for current (registered) user from existing run if ($this->object->getAnonymize() && !$anonymous_code) { $anonymous_code = $this->object->findCodeForUser($ilUser->getId()); } // get existing runs for current user, might generate code $participant_status = $this->object->getUserSurveyExecutionStatus($anonymous_code); if ($participant_status) { $anonymous_code = $participant_status["code"]; $participant_status = $participant_status["runs"]; } // (final) check for proper anonymous code if (!$this->object->isAccessibleWithoutCode() && !$is_appraisee && $code_input && (!$anonymous_code || !$this->object->isAnonymousKey($anonymous_code))) { $anonymous_code = null; ilUtil::sendInfo($this->lng->txt("wrong_survey_code_used")); } // :TODO: really save in session? $_SESSION["anonymous_id"][$this->object->getId()] = $anonymous_code; // code is mandatory and not given yet if (!$is_appraisee && !$anonymous_code && !$this->object->isAccessibleWithoutCode()) { $info->setFormAction($this->ctrl->getFormAction($this, "infoScreen")); $info->addSection($this->lng->txt("anonymization")); $info->addProperty("", $this->lng->txt("anonymize_anonymous_introduction")); $info->addPropertyTextinput($this->lng->txt("enter_anonymous_id"), "anonymous_id", "", 8, "infoScreen", $this->lng->txt("submit"), true); } else { // trunk/default if (!$this->object->get360Mode()) { if ($anonymous_code) { $info->addHiddenElement("anonymous_id", $anonymous_code); } $survey_started = $this->object->isSurveyStarted($ilUser->getId(), $anonymous_code); if ($survey_started === 1) { if ($ilUser->getId() != ANONYMOUS_USER_ID) { if ($this->object->hasViewOwnResults()) { include_once "Services/UIComponent/Button/classes/class.ilLinkButton.php"; $button = ilLinkButton::getInstance(); $button->setCaption("svy_view_own_results"); $button->setUrl($this->ctrl->getLinkTarget($this, "viewUserResults")); $ilToolbar->addButtonInstance($button); } if ($this->object->hasMailOwnResults()) { if ($this->object->hasViewOwnResults()) { $ilToolbar->addSeparator(); } require_once "Services/Form/classes/class.ilTextInputGUI.php"; $mail = new ilTextInputGUI($this->lng->txt("email"), "mail"); $mail->setSize(25); $mail->setValue($ilUser->getEmail()); $ilToolbar->addInputItem($mail, true); $ilToolbar->setFormAction($this->ctrl->getFormAction($this, "mailUserResults")); include_once "Services/UIComponent/Button/classes/class.ilSubmitButton.php"; $button = ilSubmitButton::getInstance(); $button->setCaption("svy_mail_own_results"); $button->setCommand("mailUserResults"); $ilToolbar->addButtonInstance($button); } } ilUtil::sendInfo($this->lng->txt("already_completed_survey")); } elseif ($survey_started === 0) { $big_button = array("resume", $this->lng->txt("resume_survey")); } elseif ($survey_started === FALSE) { $big_button = array("start", $this->lng->txt("start_survey")); } } else { $appr_ids = array(); // use given code (if proper external one) if ($anonymous_code) { $anonymous_id = $this->object->getAnonymousIdByCode($anonymous_code); if ($anonymous_id) { $appr_ids = $this->object->getAppraiseesToRate(0, $anonymous_id); } } // registered user // if an auto-code was generated, we still have to check for the original user id if (!$appr_ids && $ilUser->getId() != ANONYMOUS_USER_ID) { $appr_ids = $this->object->getAppraiseesToRate($ilUser->getId()); } if (sizeof($appr_ids)) { // map existing runs to appraisees $active_appraisees = array(); if ($participant_status) { foreach ($participant_status as $item) { $active_appraisees[$item["appr_id"]] = $item["finished"]; } } $list = array(); foreach ($appr_ids as $appr_id) { if ($this->object->isAppraiseeClosed($appr_id)) { // closed $list[$appr_id] = $this->lng->txt("survey_360_appraisee_is_closed"); } else { if (array_key_exists($appr_id, $active_appraisees)) { // already done if ($active_appraisees[$appr_id]) { $list[$appr_id] = $this->lng->txt("already_completed_survey"); } else { $list[$appr_id] = array("resume", $this->lng->txt("resume_survey")); } } else { // start $list[$appr_id] = array("start", $this->lng->txt("start_survey")); } } } $info->addSection($this->lng->txt("survey_360_rate_other_appraisees")); include_once "Services/User/classes/class.ilUserUtil.php"; foreach ($list as $appr_id => $item) { $appr_name = ilUserUtil::getNamePresentation($appr_id, false, false, "", true); if (!is_array($item)) { $info->addProperty($appr_name, $item); } else { $this->ctrl->setParameter($output_gui, "appr_id", $appr_id); $href = $this->ctrl->getLinkTarget($output_gui, $item[0]); $this->ctrl->setParameter($output_gui, "appr_id", ""); include_once "Services/UIComponent/Button/classes/class.ilLinkButton.php"; $button = ilLinkButton::getInstance(); $button->setCaption($item[1], false); $button->setUrl($href); $big_button_360 = '<div>' . $button->render() . '</div>'; $info->addProperty($appr_name, $big_button_360); } } } else { if (!$is_appraisee) { ilUtil::sendFailure($this->lng->txt("survey_360_no_appraisees")); } } } } if ($this->object->get360Mode() && $this->object->get360SelfAppraisee() && !$this->object->isAppraisee($ilUser->getId()) && $ilUser->getId() != ANONYMOUS_USER_ID) { $link = $this->ctrl->getLinkTargetByClass("ilsurveyparticipantsgui", "addSelfAppraisee"); $link = '<a href="' . $link . '">' . $this->lng->txt("survey_360_add_self_appraisee") . '</a>'; $info->addProperty(" ", $link); } } if ($big_button) { $ilToolbar->setFormAction($this->ctrl->getFormAction($output_gui, "infoScreen")); include_once "Services/UIComponent/Button/classes/class.ilSubmitButton.php"; $button = ilSubmitButton::getInstance(); $button->setCaption($big_button[1], false); $button->setCommand($big_button[0]); $button->setPrimary(true); $ilToolbar->addButtonInstance($button); $ilToolbar->setCloseFormTag(false); $info->setOpenFormTag(false); } /* #12016 else { $info->setFormAction($this->ctrl->getFormAction($output_gui, "infoScreen")); } */ if (strlen($this->object->getIntroduction())) { $introduction = $this->object->getIntroduction(); $info->addSection($this->lng->txt("introduction")); $info->addProperty("", $this->object->prepareTextareaOutput($introduction) . "<br />" . $info->getHiddenToggleButton()); } else { $info->addSection(""); $info->addProperty("", $info->getHiddenToggleButton()); } $info->hideFurtherSections(false); if (!$this->object->get360Mode()) { $info->addSection($this->lng->txt("svy_general_properties")); $info->addProperty($this->lng->txt("survey_results_anonymization"), !$this->object->hasAnonymizedResults() ? $this->lng->txt("survey_results_personalized_info") : $this->lng->txt("survey_results_anonymized_info")); include_once "./Modules/Survey/classes/class.ilObjSurveyAccess.php"; if ($ilAccess->checkAccess("write", "", $this->ref_id) || ilObjSurveyAccess::_hasEvaluationAccess($this->object->getId(), $ilUser->getId())) { $info->addProperty($this->lng->txt("evaluation_access"), $this->lng->txt("evaluation_access_info")); } } $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType()); $this->ctrl->forwardCommand($info); }
/** * Init new/update group form */ protected function initGroupForm($a_group_id = 0) { include_once './Services/Calendar/classes/ConsultationHours/class.ilConsultationHourGroup.php'; $group = new ilConsultationHourGroup($a_group_id); include_once 'Services/Form/classes/class.ilPropertyFormGUI.php'; $form = new ilPropertyFormGUI(); $form->setFormAction($GLOBALS['ilCtrl']->getFormAction($this)); if ($a_group_id) { $form->setTitle($GLOBALS['lng']->txt('cal_ch_grp_update_tbl')); $form->addCommandButton('updateGroup', $GLOBALS['lng']->txt('save')); $form->addCommandButton('groupList', $GLOBALS['lng']->txt('cancel')); } else { $form->setTitle($GLOBALS['lng']->txt('cal_ch_grp_add_tbl')); $form->addCommandButton('saveGroup', $GLOBALS['lng']->txt('save')); $form->addCommandButton('appointmentList', $GLOBALS['lng']->txt('cancel')); } $title = new ilTextInputGUI($GLOBALS['lng']->txt('title'), 'title'); $title->setMaxLength(128); $title->setSize(40); $title->setRequired(true); $title->setValue($group->getTitle()); $form->addItem($title); $multiple = new ilNumberInputGUI($GLOBALS['lng']->txt('cal_ch_grp_multiple'), 'multiple'); $multiple->setRequired(true); $multiple->setMinValue(1); $multiple->setSize(1); $multiple->setMaxLength(2); $multiple->setInfo($GLOBALS['lng']->txt('cal_ch_grp_multiple_info')); $multiple->setValue($group->getMaxAssignments()); $form->addItem($multiple); return $form; }
/** * init auth mode determinitation form * * @access protected */ protected function initAuthModeDetermination() { if (is_object($this->form)) { return true; } // Are there any authentication methods that support automatic determination ? include_once 'Services/Authentication/classes/class.ilAuthModeDetermination.php'; $det = ilAuthModeDetermination::_getInstance(); if ($det->getCountActiveAuthModes() <= 1) { return false; } include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; $this->form = new ilPropertyFormGUI(); $this->form->setFormAction($this->ctrl->getFormAction($this)); $this->form->setTableWidth('100%'); $this->form->setTitle($this->lng->txt('auth_auth_settings')); $this->form->addCommandButton('updateAuthModeDetermination', $this->lng->txt('save')); require_once 'Services/Captcha/classes/class.ilCaptchaUtil.php'; $cap = new ilCheckboxInputGUI($this->lng->txt('adm_captcha_anonymous_short'), 'activate_captcha_anonym'); $cap->setInfo($this->lng->txt('adm_captcha_anonymous_auth')); $cap->setValue(1); if (!ilCaptchaUtil::checkFreetype()) { $cap->setAlert(ilCaptchaUtil::getPreconditionsMessage()); } $cap->setChecked(ilCaptchaUtil::isActiveForLogin()); $this->form->addItem($cap); $header = new ilFormSectionHeaderGUI(); $header->setTitle($this->lng->txt('auth_auth_mode_determination')); $this->form->addItem($header); $kind = new ilRadioGroupInputGUI($this->lng->txt('auth_kind_determination'), 'kind'); $kind->setInfo($this->lng->txt('auth_mode_determination_info')); $kind->setValue($det->getKind()); $kind->setRequired(true); $option_user = new ilRadioOption($this->lng->txt('auth_by_user'), 0); $kind->addOption($option_user); $option_determination = new ilRadioOption($this->lng->txt('auth_automatic'), 1); include_once 'Services/Authentication/classes/class.ilAuthUtils.php'; $auth_sequenced = $det->getAuthModeSequence(); $counter = 1; foreach ($auth_sequenced as $auth_mode) { switch ($auth_mode) { case AUTH_LDAP: $text = $this->lng->txt('auth_ldap'); break; case AUTH_RADIUS: $text = $this->lng->txt('auth_radius'); break; case AUTH_LOCAL: $text = $this->lng->txt('auth_local'); break; case AUTH_SOAP: $text = $this->lng->txt('auth_soap'); break; case AUTH_APACHE: $text = $this->lng->txt('auth_apache'); break; // begin-patch auth_plugin // begin-patch auth_plugin default: foreach (ilAuthUtils::getAuthPlugins() as $pl) { $option = $pl->getMultipleAuthModeOptions($auth_mode); $text = $option[$auth_mode]['txt']; } break; // end-patch auth_plugin } $pos = new ilTextInputGUI($text, 'position[' . $auth_mode . ']'); $pos->setValue($counter++); $pos->setSize(1); $pos->setMaxLength(1); $option_determination->addSubItem($pos); } $kind->addOption($option_determination); $this->form->addItem($kind); return true; }