/** * Init form. * * @param string $a_mode edit mode */ public function initForm($a_mode = "edit") { global $lng, $ilCtrl; include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form = new ilPropertyFormGUI(); // title $ti = new ilTextInputGUI($lng->txt("title"), "title"); $ti->setMaxLength(200); $ti->setSize(50); $ti->setRequired(true); $this->form->addItem($ti); // order nr $ni = new ilNumberInputGUI($lng->txt("skmg_order_nr"), "order_nr"); $ni->setMaxLength(6); $ni->setSize(6); $ni->setRequired(true); $this->form->addItem($ni); // save and cancel commands if ($a_mode == "create") { $this->form->addCommandButton("save", $lng->txt("save")); $this->form->addCommandButton("cancelSave", $lng->txt("cancel")); $this->form->setTitle($lng->txt("skmg_create_skll")); } else { $this->form->addCommandButton("update", $lng->txt("save")); $this->form->setTitle($lng->txt("skmg_edit_skll")); } $ilCtrl->setParameter($this, "obj_id", $_GET["obj_id"]); $this->form->setFormAction($ilCtrl->getFormAction($this)); }
/** * @param array $row */ public function fillRow(array $row) { /** * @var $ilCtrl ilCtrl */ global $ilCtrl; if ($this->getParentObject()->isCRUDContext()) { $row['chb'] = ilUtil::formCheckbox(false, 'unit_ids[]', $row['unit_id']); $sequence = new ilNumberInputGUI('', 'sequence[' . $row['unit_id'] . ']'); $sequence->setValue($this->position++ * 10); $sequence->setMinValue(0); $sequence->setSize(3); $row['sequence'] = $sequence->render(); $action = new ilAdvancedSelectionListGUI(); $action->setId('asl_content_' . $row['unit_id']); $action->setAsynch(false); $action->setListTitle($this->lng->txt('actions')); $ilCtrl->setParameter($this->getParentObject(), 'unit_id', $row['unit_id']); $action->addItem($this->lng->txt('edit'), '', $ilCtrl->getLinkTarget($this->getParentObject(), 'showUnitModificationForm')); $action->addItem($this->lng->txt('delete'), '', $ilCtrl->getLinkTarget($this->getParentObject(), 'confirmDeleteUnit')); $ilCtrl->setParameter($this->getParentObject(), 'unit_id', ''); $row['actions'] = $action->getHtml(); } if ($row['unit_id'] == $row['baseunit_id']) { $row['baseunit'] = ''; } parent::fillRow($row); }
public function addToForm() { $def = $this->getADT()->getCopyOfDefinition(); $number = new ilNumberInputGUI($this->getTitle(), $this->getElementId()); $number->setSize(10); $number->setDecimals($def->getDecimals()); $this->addBasicFieldProperties($number, $def); $min = $def->getMin(); if ($min !== null) { $number->setMinValue($min); } $max = $def->getMax(); if ($max !== null) { $number->setMaxValue($max); $length = strlen($max) + $def->getDecimals() + 1; $number->setSize($length); $number->setMaxLength($length); } $suffix = $def->getSuffix(); if ($suffix !== null) { $number->setSuffix($suffix); } $number->setValue($this->getADT()->getNumber()); $this->addToParentElement($number); }
function initAddCodesForm() { global $ilCtrl, $lng; include_once 'Services/Form/classes/class.ilPropertyFormGUI.php'; $this->form_gui = new ilPropertyFormGUI(); $this->form_gui->setFormAction($ilCtrl->getFormAction($this, 'createCodes')); $this->form_gui->setTitle($lng->txt('user_account_codes_edit_header')); $count = new ilNumberInputGUI($lng->txt('user_account_codes_number'), 'acc_codes_number'); $count->setSize(4); $count->setMaxLength(4); $count->setMinValue(1); $count->setMaxValue(1000); $count->setRequired(true); $this->form_gui->addItem($count); $valid = new ilRadioGroupInputGUI($lng->txt('user_account_code_valid_until'), 'valid_type'); $valid->setRequired(true); $unl = new ilRadioOption($lng->txt('user_account_code_valid_until_unlimited'), 'valid_unlimited'); $valid->addOption($unl); $st = new ilRadioOption($lng->txt('user_account_code_valid_until_static'), 'valid_static'); $valid->addOption($st); $dt = new ilDateTimeInputGUI($lng->txt('date'), 'valid_date'); $dt->setRequired(true); $st->addSubItem($dt); $dyn = new ilRadioOption($lng->txt('user_account_code_valid_until_dynamic'), 'valid_dynamic'); $valid->addOption($dyn); $ds = new ilNumberInputGUI($lng->txt('days'), 'valid_days'); $ds->setSize(5); $ds->setRequired(true); $dyn->addSubItem($ds); $this->form_gui->addItem($valid); $this->form_gui->addCommandButton('createCodes', $lng->txt('create')); $this->form_gui->addCommandButton('listCodes', $lng->txt('cancel')); }
public function addCustomSettingsToForm(ilPropertyFormGUI $a_form) { global $lng, $ilSetting; $lng->loadLanguageModule('dateplaner'); $consultation_days = new ilNumberInputGUI($lng->txt('cal_ch_cron_reminder_days'), 'ch_reminder_days'); $consultation_days->setMinValue(1); $consultation_days->setMaxLength(2); $consultation_days->setSize(2); $consultation_days->setValue($ilSetting->get('ch_reminder_days', 2)); $consultation_days->setRequired(true); $a_form->addItem($consultation_days); }
public function build() { $this->setFormAction($this->ctrl->getFormAction($this->questionSetConfigGUI)); $this->setTitle($this->lng->txt('tst_rnd_quest_set_cfg_general_form')); $this->setId('tstRndQuestSetCfgGeneralForm'); $this->addCommandButton(ilTestRandomQuestionSetConfigGUI::CMD_SAVE_GENERAL_CONFIG_FORM, $this->lng->txt('save')); // Require Pools with Homogeneous Scored Questions $requirePoolsQuestionsHomoScored = new ilCheckboxInputGUI($this->lng->txt('tst_inp_all_quest_points_equal_per_pool'), 'quest_points_equal_per_pool'); $requirePoolsQuestionsHomoScored->setInfo($this->lng->txt('tst_inp_all_quest_points_equal_per_pool_desc')); $requirePoolsQuestionsHomoScored->setChecked($this->questionSetConfig->arePoolsWithHomogeneousScoredQuestionsRequired()); $this->addItem($requirePoolsQuestionsHomoScored); // question amount config mode (per test / per pool) $questionAmountConfigMode = new ilRadioGroupInputGUI($this->lng->txt('tst_inp_quest_amount_cfg_mode'), 'quest_amount_cfg_mode'); $questionAmountConfigMode->setValue($this->fetchValidQuestionAmountConfigModeWithFallbackModePerTest($this->questionSetConfig)); $questionAmountConfigModePerTest = new ilRadioOption($this->lng->txt('tst_inp_quest_amount_cfg_mode_test'), ilTestRandomQuestionSetConfig::QUESTION_AMOUNT_CONFIG_MODE_PER_TEST); $questionAmountConfigMode->addOption($questionAmountConfigModePerTest); $questionAmountConfigModePerPool = new ilRadioOption($this->lng->txt('tst_inp_quest_amount_cfg_mode_pool'), ilTestRandomQuestionSetConfig::QUESTION_AMOUNT_CONFIG_MODE_PER_POOL); $questionAmountConfigMode->addOption($questionAmountConfigModePerPool); $questionAmountConfigMode->setRequired(true); $this->addItem($questionAmountConfigMode); // question amount per test $questionAmountPerTest = new ilNumberInputGUI($this->lng->txt('tst_inp_quest_amount_per_test'), 'quest_amount_per_test'); $questionAmountPerTest->setRequired(true); $questionAmountPerTest->setMinValue(0); $questionAmountPerTest->allowDecimals(false); $questionAmountPerTest->setMinvalueShouldBeGreater(true); $questionAmountPerTest->setSize(4); $questionAmountPerTest->setValue($this->questionSetConfig->getQuestionAmountPerTest()); $questionAmountConfigModePerTest->addSubItem($questionAmountPerTest); if ($this->testOBJ->participantDataExist()) { $requirePoolsQuestionsHomoScored->setDisabled(true); $questionAmountConfigMode->setDisabled(true); $questionAmountPerTest->setDisabled(true); } }
public function initPluginSettings() { if ($this->getAdminConfigObject()->getDefaultAllowPublicLinksConfigAllowPublicLinks() && $this->getAdminConfigObject()->getDefaultAllowPublicLinks()) { $public_links = new ilCheckboxInputGUI($this->txt("activate_public_links"), "activate_public_links"); $public_links->setInfo($this->txt("info_activate_public_links")); $this->form->addItem($public_links); } if ($this->getAdminConfigObject()->getConfigMaxFileSize()) { $max_file_size = new ilNumberInputGUI($this->txt("max_file_size"), "max_file_size"); $max_file_size->setInfo($this->txt("info_max_file_size")); $max_file_size->setMaxLength(10); $max_file_size->setSize(10); $this->form->addItem($max_file_size); } }
/** * Init property form * * @return ilPropertyFormGUI $form */ protected function initFormSettings() { include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; $form = new ilPropertyFormGUI(); $form->setTitle($this->lng->txt('tracking_settings')); $form->setFormAction($this->ctrl->getFormAction($this)); // Mode $mod = new ilRadioGroupInputGUI($this->lng->txt('trac_mode'), 'modus'); $mod->setRequired(true); $mod->setValue($this->obj_lp->getCurrentMode()); $form->addItem($mod); foreach ($this->obj_lp->getValidModes() as $mode_key) { $opt = new ilRadioOption($this->obj_lp->getModeText($mode_key), $mode_key, $this->obj_lp->getModeInfoText($mode_key)); $opt->setValue($mode_key); $mod->addOption($opt); // :TODO: Subitem for visits ?! if ($mode_key == ilLPObjSettings::LP_MODE_VISITS) { $vis = new ilNumberInputGUI($this->lng->txt('trac_visits'), 'visits'); $vis->setSize(3); $vis->setMaxLength(4); $vis->setInfo(sprintf($this->lng->txt('trac_visits_info'), ilObjUserTracking::_getValidTimeSpan())); $vis->setRequired(true); $vis->setValue($this->obj_settings->getVisits()); $opt->addSubItem($vis); } } $form->addCommandButton('saveSettings', $this->lng->txt('save')); return $form; }
public function addCustomSettingsToForm(ilPropertyFormGUI $a_form) { global $lng, $ilSetting; $num_days = new ilNumberInputGUI($lng->txt('payment_notification_days'), 'payment_notification_days'); $num_days->setSize(3); $num_days->setMinValue(0); $num_days->setMaxValue(120); $num_days->setRequired(true); $num_days->setValue($ilSetting->get('payment_notification_days')); $num_days->setInfo($lng->txt('payment_notification_days_desc')); $a_form->addItem($num_days); }
protected function addFieldsToEditForm(ilPropertyFormGUI $a_form) { // maximum number of characters $maxchars = new ilNumberInputGUI($this->lng->txt("maxchars"), "maxchars"); $maxchars->setRequired(false); $maxchars->setSize(5); $maxchars->setDecimals(0); $a_form->addItem($maxchars); // textwidth $textwidth = new ilNumberInputGUI($this->lng->txt("width"), "textwidth"); $textwidth->setRequired(true); $textwidth->setSize(3); $textwidth->setDecimals(0); $textwidth->setMinValue(10); $a_form->addItem($textwidth); // textheight $textheight = new ilNumberInputGUI($this->lng->txt("height"), "textheight"); $textheight->setRequired(true); $textheight->setSize(3); $textheight->setDecimals(0); $textheight->setMinValue(1); $a_form->addItem($textheight); // values if ($this->object->getMaxChars() > 0) { $maxchars->setValue($this->object->getMaxChars()); } $textwidth->setValue($this->object->getTextWidth()); $textheight->setValue($this->object->getTextHeight()); }
public function addToForm() { global $lng; $adt = $this->getADT(); $default = false; if ($adt->isNull()) { // see ilPersonalProfileGUI::addLocationToForm() // use installation default include_once "./Services/Maps/classes/class.ilMapUtil.php"; $def = ilMapUtil::getDefaultSettings(); $adt->setLatitude($def["latitude"]); $adt->setLongitude($def["longitude"]); $adt->setZoom($def["zoom"]); $default = true; } $optional = new ilCheckboxInputGUI($this->getTitle(), $this->addToElementId("tgl")); if (!$default && !$adt->isNull()) { $optional->setChecked(true); } $loc = new ilLocationInputGUI($lng->txt("location"), $this->getElementId()); $loc->setLongitude($adt->getLongitude()); $loc->setLatitude($adt->getLatitude()); $loc->setZoom($adt->getZoom()); $optional->addSubItem($loc); $rad = new ilNumberInputGUI($lng->txt("form_location_radius"), $this->addToElementId("rad")); $rad->setSize(4); $rad->setSuffix($lng->txt("form_location_radius_km")); $rad->setValue($this->radius); $rad->setRequired(true); $optional->addSubItem($rad); $this->addToParentElement($optional); }
protected function initLicenseForm() { include_once 'Services/Form/classes/class.ilPropertyFormGUI.php'; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this, "updateLicense")); $form->setTitle($this->lng->txt('edit_license')); $exist = new ilNumberInputGUI($this->lng->txt("existing_licenses"), "licenses"); $exist->setInfo($this->lng->txt("zero_licenses_explanation")); $exist->setMaxLength(10); $exist->setSize(10); $exist->setValue($this->license->getLicenses()); $form->addItem($exist); $info_used = new ilNonEditableValueGUI($this->lng->txt("used_licenses")); $info_used->setInfo($this->lng->txt("used_licenses_explanation")); $info_used->setValue($this->license->getAccesses()); $form->addItem($info_used); $remaining_licenses = $this->license->getLicenses() == "0" ? $this->lng->txt("arbitrary") : $this->license->getRemainingLicenses(); $info_remain = new ilNonEditableValueGUI($this->lng->txt("remaining_licenses")); $info_remain->setInfo($this->lng->txt("remaining_licenses_explanation")); $info_remain->setValue($remaining_licenses); $form->addItem($info_remain); $info_potential = new ilNonEditableValueGUI($this->lng->txt("potential_accesses")); $info_potential->setInfo($this->lng->txt("potential_accesses_explanation")); $info_potential->setValue($this->license->getPotentialAccesses()); $form->addItem($info_potential); $comm = new ilTextAreaInputGUI($this->lng->txt("comment"), "remarks"); $comm->setRows(5); $comm->setValue($this->license->getRemarks()); $form->addItem($comm); $form->addCommandButton('updateLicense', $this->lng->txt('save')); return $form; }
/** * 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()); }
/** * Init property form * * @return ilPropertyFormGUI $form */ protected function initFormSettings() { include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; $form = new ilPropertyFormGUI(); $form->setTitle($this->lng->txt('tracking_settings')); $form->setFormAction($this->ctrl->getFormAction($this)); // Mode $mod = new ilRadioGroupInputGUI($this->lng->txt('trac_mode'), 'modus'); $mod->setRequired(true); $mod->setValue($this->obj_settings->getMode()); $form->addItem($mod); foreach ($this->obj_settings->getValidModes() as $mode_key => $mode_name) { $opt = new ilRadioOption($mode_name, $mode_key, ilLPObjSettings::_mode2InfoText($mode_key)); $opt->setValue($mode_key); $mod->addOption($opt); // Subitem for vistits if ($mode_key == LP_MODE_VISITS) { $vis = new ilNumberInputGUI($this->lng->txt('trac_visits'), 'visits'); $vis->setSize(3); $vis->setMaxLength(4); $vis->setInfo(sprintf($this->lng->txt('trac_visits_info'), ilObjUserTracking::_getValidTimeSpan())); $vis->setRequired(true); $vis->setValue($this->obj_settings->getVisits()); $opt->addSubItem($vis); } } /* // Info Active $act = new ilCustomInputGUI($this->lng->txt('trac_activated'), ''); $img = new ilTemplate('tpl.obj_settings_img_row.html',true,true,'Services/Tracking'); $img->setVariable("IMG_SRC", $activated = ilObjUserTracking::_enabledLearningProgress() ? ilUtil::getImagePath('icon_ok.png') : ilUtil::getImagePath('icon_not_ok.png') ); $act->setHTML($img->get()); $form->addItem($act); // Info Anonymized $ano = new ilCustomInputGUI($this->lng->txt('trac_anonymized'), ''); $img = new ilTemplate('tpl.obj_settings_img_row.html',true,true,'Services/Tracking'); $img->setVariable("IMG_SRC", $anonymized = !ilObjUserTracking::_enabledUserRelatedData() ? ilUtil::getImagePath('icon_ok.png') : ilUtil::getImagePath('icon_not_ok.png') ); $ano->setHTML($img->get()); $form->addItem($ano); */ $form->addCommandButton('saveSettings', $this->lng->txt('save')); return $form; }
public function addToForm() { $def = $this->getADT()->getCopyOfDefinition(); $number = new ilNumberInputGUI($this->getTitle(), $this->getElementId()); $number->setSize(10); $min = $def->getMin(); if ($min !== null) { $number->setMinValue($min); } $max = $def->getMax(); if ($max !== null) { $number->setMaxValue($max); $length = strlen($max); $number->setSize($length); $number->setMaxLength($length); } $this->addToParentElement($number); }
protected function addFieldsToEditForm(ilPropertyFormGUI $a_form) { // orientation $orientation = new ilRadioGroupInputGUI($this->lng->txt("orientation"), "orientation"); $orientation->setRequired(false); $orientation->addOption(new ilRadioOption($this->lng->txt('vertical'), 0)); $orientation->addOption(new ilRadioOption($this->lng->txt('horizontal'), 1)); $a_form->addItem($orientation); // minimum answers $minanswers = new ilCheckboxInputGUI($this->lng->txt("use_min_answers"), "use_min_answers"); $minanswers->setValue(1); $minanswers->setOptionTitle($this->lng->txt("use_min_answers_option")); $minanswers->setRequired(FALSE); $nranswers = new ilNumberInputGUI($this->lng->txt("nr_min_answers"), "nr_min_answers"); $nranswers->setSize(5); $nranswers->setDecimals(0); $nranswers->setRequired(false); $nranswers->setMinValue(1); $minanswers->addSubItem($nranswers); $nrmaxanswers = new ilNumberInputGUI($this->lng->txt("nr_max_answers"), "nr_max_answers"); $nrmaxanswers->setSize(5); $nrmaxanswers->setDecimals(0); $nrmaxanswers->setRequired(false); $nrmaxanswers->setMinValue(1); $minanswers->addSubItem($nrmaxanswers); $a_form->addItem($minanswers); // Answers include_once "./Modules/SurveyQuestionPool/classes/class.ilCategoryWizardInputGUI.php"; $answers = new ilCategoryWizardInputGUI($this->lng->txt("answers"), "answers"); $answers->setRequired(false); $answers->setAllowMove(true); $answers->setShowWizard(false); $answers->setShowSavePhrase(false); $answers->setUseOtherAnswer(true); $answers->setShowNeutralCategory(true); $answers->setNeutralCategoryTitle($this->lng->txt('svy_neutral_answer')); $answers->setDisabledScale(false); $a_form->addItem($answers); // values $orientation->setValue($this->object->getOrientation()); $minanswers->setChecked($this->object->use_min_answers); $nranswers->setValue($this->object->nr_min_answers); $nrmaxanswers->setValue($this->object->nr_max_answers); if (!$this->object->getCategories()->getCategoryCount()) { $this->object->getCategories()->addCategory(""); } $answers->setValues($this->object->getCategories()); }
/** * Init configuration form * @global type $ilCtrl */ protected function initConfigurationForm() { global $ilCtrl, $lng; $settings = ilFhoevEventSettings::getInstance(); include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; $form = new ilPropertyFormGUI(); $form->setTitle($this->getPluginObject()->txt('tbl_fhoev_event_settings')); $form->setFormAction($ilCtrl->getFormAction($this)); $form->addCommandButton('save', $lng->txt('save')); $form->setShowTopButtons(false); $lock = new ilCheckboxInputGUI($this->getPluginObject()->txt('tbl_settings_active'), 'active'); $lock->setValue(1); $lock->setChecked($settings->isActive()); $form->addItem($lock); $dtpl = new ilNumberInputGUI($this->getPluginObject()->txt('tbl_settings_dtpl'), 'dtpl'); $dtpl->setSize(8); $dtpl->setValue($settings->getTemplateId()); $dtpl->setRequired(TRUE); $dtpl->setMinValue(1); $form->addItem($dtpl); return $form; }
public function editPriceObject() { $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment'); $price_id = $_GET['price_id'] ? $_GET['price_id'] : $_POST['price_id']; $price = ilPaymentPrices::_getPrice($price_id); $this->ctrl->setParameter($this, 'pobject_id', (int) $_GET['pobject_id']); $tmp_pobject = ilPaymentObject::_getObjectData($_GET['pobject_id']); include_once 'Services/Form/classes/class.ilPropertyFormGUI.php'; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this)); $tmp_obj = ilObjectFactory::getInstanceByRefId($tmp_pobject['ref_id'], false); if ($tmp_obj) { $form->setTitle($tmp_obj->getTitle()); } else { $form->setTitle($this->lng->txt('object_not_found')); } //price_type $radio_group = new ilRadioGroupInputGUI('', 'price_type'); $radio_group->setTitle($this->lng->txt('duration')); $radio_group->setRequired(true); $radio_group->setValue($price['price_type']); $radio_group->setPostVar('price_type'); $radio_option_1 = new ilRadioOption($this->lng->txt('duration_month'), ilPaymentPrices::TYPE_DURATION_MONTH); // duration month $oDuration = new ilNumberInputGUI(); $oDuration->setTitle($this->lng->txt('paya_months')); $oDuration->setSize('20%'); $oDuration->setValue($price['duration']); $oDuration->setPostVar('duration_month'); $radio_option_1->addSubItem($oDuration); $radio_group->addOption($radio_option_1); $radio_option_3 = new ilRadioOption($this->lng->txt('duration_date'), ilPaymentPrices::TYPE_DURATION_DATE); // duration_date from $o_date_from = new ilDateTimeInputGUI(); $o_date_from->setTitle($this->lng->txt('cal_from')); $o_date_from->setDate(new ilDate($price['duration_from'], IL_CAL_DATE)); $o_date_from->setPostVar('duration_date_from'); $radio_option_3->addSubItem($o_date_from); // duration_date until $o_date_until = new ilDateTimeInputGUI(); $o_date_until->setTitle($this->lng->txt('cal_until')); $o_date_until->setDate(new ilDate($price['duration_until'], IL_CAL_DATE)); $o_date_until->setPostVar('duration_date_until'); $radio_option_3->addSubItem($o_date_until); $radio_group->addOption($radio_option_3); $radio_option_2 = new ilRadioOption($this->lng->txt('unlimited_duration'), ilPaymentPrices::TYPE_UNLIMITED_DURATION); $radio_group->addOption($radio_option_2); $form->addItem($radio_group); // description $oDescription = new ilTextAreaInputGUI($this->lng->txt('description'), 'description'); $oDescription->setRows(4); $oDescription->setCols(35); $oDescription->setValue($price['description']); $form->addItem($oDescription); // price $oPrice = new ilNumberInputGUI(); $oPrice->setTitle($this->lng->txt('price_a')); $oPrice->setSize('20%'); $oPrice->setRequired(true); $oPrice->setValue($price['price']); include_once './Services/Payment/classes/class.ilPaymentSettings.php'; $genSet = ilPaymentSettings::_getInstance(); $oPrice->setInfo($genSet->get('currency_unit')); $oPrice->setPostVar('price'); $oPrice->allowDecimals(true); $form->addItem($oPrice); //extension $oExtension = new ilCheckboxInputGUI($this->lng->txt('extension_price'), 'extension'); $oExtension->setChecked($price['extension']); $form->addItem($oExtension); $o_hidden_1 = new ilHiddenInputGUI('pobject_id'); $o_hidden_1->setValue((int) $_GET['pobject_id']); $o_hidden_1->setPostVar('pobject_id'); $o_hidden_2 = new ilHiddenInputGUI('price_id'); $o_hidden_2->setValue((int) $_GET['price_id']); $o_hidden_2->setPostVar('price_id'); $form->addItem($o_hidden_1); $form->addItem($o_hidden_2); $form->addCommandButton('updatePrice', $this->lng->txt('save')); $form->addCommandButton('editPrices', $this->lng->txt('cancel')); $this->tpl->setVariable('FORM', $form->getHTML()); }
/** * @param $form ilPropertyFormGUI * @return \ilPropertyFormGUI|void */ public function populateQuestionSpecificFormPart(ilPropertyFormGUI $form) { // errortext $errortext = new ilTextAreaInputGUI($this->lng->txt("errortext"), "errortext"); $errortext->setValue($this->object->getErrorText()); $errortext->setRequired(TRUE); $errortext->setInfo($this->lng->txt("errortext_info")); $errortext->setRows(10); $errortext->setCols(80); $form->addItem($errortext); if (!$this->object->getSelfAssessmentEditingMode()) { // textsize $textsize = new ilNumberInputGUI($this->lng->txt("textsize"), "textsize"); $textsize->setValue(strlen($this->object->getTextSize()) ? $this->object->getTextSize() : 100.0); $textsize->setInfo($this->lng->txt("textsize_errortext_info")); $textsize->setSize(6); $textsize->setSuffix("%"); $textsize->setMinValue(10); $textsize->setRequired(true); $form->addItem($textsize); } }
/** * Build property form * @param string $a_mode * @param int $id * @return object */ function initForm($a_mode = "create", $id = NULL) { global $lng, $ilCtrl; $lng->loadLanguageModule("dateplaner"); include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form_gui = new ilPropertyFormGUI(); $title = new ilTextInputGUI($lng->txt("title"), "title"); $title->setRequired(true); $title->setSize(40); $title->setMaxLength(120); $form_gui->addItem($title); /* $type = new ilRadioGroupInputGUI($lng->txt("book_schedule_type"), "type"); $type->setRequired(true); $form_gui->addItem($type); $fix = new ilRadioOption($lng->txt("book_schedule_type_fix"), "fix"); $fix->setInfo($lng->txt("book_schedule_type_fix_info")); $type->addOption($fix); $flex = new ilRadioOption($lng->txt("book_schedule_type_flexible"), "flexible"); $flex->setInfo($lng->txt("book_schedule_type_flexible_info")); $type->addOption($flex); $raster = new ilNumberInputGUI($lng->txt("book_schedule_raster"), "raster"); $raster->setRequired(true); $raster->setInfo($lng->txt("book_schedule_raster_info")); $raster->setMinValue(1); $raster->setSize(3); $raster->setMaxLength(3); $raster->setSuffix($lng->txt("book_minutes")); $flex->addSubItem($raster); $rent_min = new ilNumberInputGUI($lng->txt("book_schedule_rent_min"), "rent_min"); $rent_min->setInfo($lng->txt("book_schedule_rent_info")); $rent_min->setMinValue(1); $rent_min->setSize(3); $rent_min->setMaxLength(3); $flex->addSubItem($rent_min); $rent_max = new ilNumberInputGUI($lng->txt("book_schedule_rent_max"), "rent_max"); $rent_max->setInfo($lng->txt("book_schedule_rent_info")); $rent_max->setMinValue(1); $rent_max->setSize(3); $rent_max->setMaxLength(3); $flex->addSubItem($rent_max); $break = new ilNumberInputGUI($lng->txt("book_schedule_break"), "break"); $break->setInfo($lng->txt("book_schedule_break_info")); $break->setMinValue(1); $break->setSize(3); $break->setMaxLength(3); $flex->addSubItem($break); */ include_once "Modules/BookingManager/classes/class.ilScheduleInputGUI.php"; $definition = new ilScheduleInputGUI($lng->txt("book_schedule_days"), "days"); $definition->setInfo($lng->txt("book_schedule_days_info")); $definition->setRequired(true); $form_gui->addItem($definition); $deadline = new ilNumberInputGUI($lng->txt("book_deadline"), "deadline"); $deadline->setInfo($lng->txt("book_deadline_info")); $deadline->setSuffix($lng->txt("book_hours")); $deadline->setMinValue(0); $deadline->setSize(3); $deadline->setMaxLength(3); $form_gui->addItem($deadline); if ($a_mode == "edit") { $form_gui->setTitle($lng->txt("book_edit_schedule")); $item = new ilHiddenInputGUI('schedule_id'); $item->setValue($id); $form_gui->addItem($item); include_once 'Modules/BookingManager/classes/class.ilBookingSchedule.php'; $schedule = new ilBookingSchedule($id); $title->setValue($schedule->getTitle()); $deadline->setValue($schedule->getDeadline()); /* if($schedule->getRaster()) { $type->setValue("flexible"); $raster->setValue($schedule->getRaster()); $rent_min->setValue($schedule->getMinRental()); $rent_max->setValue($schedule->getMaxRental()); $break->setValue($schedule->getAutoBreak()); } else { $type->setValue("fix"); } */ $definition->setValue($schedule->getDefinitionBySlots()); $form_gui->addCommandButton("update", $lng->txt("save")); } else { $form_gui->setTitle($lng->txt("book_add_schedule")); $form_gui->addCommandButton("save", $lng->txt("save")); $form_gui->addCommandButton("render", $lng->txt("cancel")); } $form_gui->setFormAction($ilCtrl->getFormAction($this)); return $form_gui; }
/** * Creates an output of the edit form for the question * * @access public */ function editQuestion($checkonly = FALSE) { $save = $this->isSaveCommand(); $this->getQuestionTemplate(); include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $orderingtype = array_key_exists('ordering_type', $_POST) ? $_POST['ordering_type'] : $this->object->getOrderingType(); if (strcmp($this->ctrl->getCmd(), 'changeToText') == 0) { $orderingtype = OQ_TERMS; } if (strcmp($this->ctrl->getCmd(), 'changeToPictures') == 0) { $orderingtype = OQ_PICTURES; } $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this)); $form->setTitle($this->outQuestionType()); $form->setMultipart($orderingtype == OQ_PICTURES ? TRUE : FALSE); $form->setTableWidth("100%"); $form->setId("ordering"); // Edit mode $hidden = new ilHiddenInputGUI("ordering_type"); $hidden->setValue($orderingtype); $form->addItem($hidden); // title, author, description, question, working time (assessment mode) $this->addBasicQuestionFormProperties($form); if (!$this->getSelfAssessmentEditingMode()) { $element_height = new ilNumberInputGUI($this->lng->txt("element_height"), "element_height"); $element_height->setValue($this->object->getElementHeight()); $element_height->setRequired(false); $element_height->setMaxLength(6); $element_height->setMinValue(20); $element_height->setSize(6); $element_height->setInfo($this->lng->txt("element_height_info")); $form->addItem($element_height); } if ($orderingtype == OQ_PICTURES) { $geometry = new ilNumberInputGUI($this->lng->txt("thumb_geometry"), "thumb_geometry"); $geometry->setValue($this->object->getThumbGeometry()); $geometry->setRequired(true); $geometry->setMaxLength(6); $geometry->setMinValue(20); $geometry->setSize(6); $geometry->setInfo($this->lng->txt("thumb_geometry_info")); $form->addItem($geometry); } if (count($this->object->getAnswers()) == 0) { $this->object->addAnswer(); } // Answers if ($orderingtype == OQ_PICTURES) { include_once "./Modules/TestQuestionPool/classes/class.ilImageWizardInputGUI.php"; $answers = new ilImageWizardInputGUI($this->lng->txt("answers"), "answers"); $answers->setRequired(TRUE); $answers->setQuestionObject($this->object); $answers->setInfo($this->lng->txt('ordering_answer_sequence_info')); $answers->setAllowMove(TRUE); $answervalues = array(); foreach ($this->object->getAnswers() as $index => $answervalue) { $answervalues[$index] = $answervalue->getAnswertext(); } $answers->setValues($answervalues); $form->addItem($answers); } else { $answers = new ilTextWizardInputGUI($this->lng->txt("answers"), "answers"); $answers->setRequired(TRUE); $answers->setInfo($this->lng->txt('ordering_answer_sequence_info')); $answers->setAllowMove(TRUE); $answervalues = array(); foreach ($this->object->getAnswers() as $index => $answervalue) { $answervalues[$index] = $answervalue->getAnswertext(); } ksort($answervalues); $answers->setValues($answervalues); $form->addItem($answers); } // points $points = new ilNumberInputGUI($this->lng->txt("points"), "points"); $points->setValue($this->object->getPoints()); $points->setRequired(TRUE); $points->setSize(3); $points->setMinValue(0); $points->setMinvalueShouldBeGreater(true); $form->addItem($points); if (true || !$this->getSelfAssessmentEditingMode()) { if ($orderingtype == OQ_PICTURES) { $form->addCommandButton("changeToText", $this->lng->txt("order_terms")); } else { $form->addCommandButton("changeToPictures", $this->lng->txt("order_pictures")); } } $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; }
/** * builds the questions hints form * * @access private * @global ilCtrl $ilCtrl * @global ilLanguage $lng * @return ilPropertyFormGUI $form */ private function buildForm(ilAssQuestionHint $questionHint = null) { global $ilCtrl, $lng; require_once 'Services/Form/classes/class.ilPropertyFormGUI.php'; require_once 'Services/Form/classes/class.ilTextAreaInputGUI.php'; require_once 'Services/Form/classes/class.ilNumberInputGUI.php'; require_once 'Services/Form/classes/class.ilHiddenInputGUI.php'; $form = new ilPropertyFormGUI(); $form->setTableWidth('100%'); if (!$this->questionOBJ->isAdditionalContentEditingModePageObject()) { // form input: hint text $areaInp = new ilTextAreaInputGUI($lng->txt('tst_question_hints_form_label_hint_text'), 'hint_text'); $areaInp->setRequired(true); $areaInp->setRows(10); $areaInp->setCols(80); if (!$this->questionOBJ->getPreventRteUsage()) { $areaInp->setUseRte(true); } include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php"; $areaInp->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("assessment")); $areaInp->setRTESupport($this->questionOBJ->getId(), 'qpl', 'assessment'); $areaInp->addPlugin("latex"); $areaInp->addButton("latex"); $areaInp->addButton("pastelatex"); $form->addItem($areaInp); } // form input: hint points $numInp = new ilNumberInputGUI($lng->txt('tst_question_hints_form_label_hint_points'), 'hint_points'); $numInp->allowDecimals(true); $numInp->setRequired(true); $numInp->setSize(3); $form->addItem($numInp); if ($questionHint instanceof ilAssQuestionHint) { // build form title for an existing hint $form->setTitle(sprintf($lng->txt('tst_question_hints_form_header_edit'), $questionHint->getIndex(), $this->questionOBJ->getTitle())); // hidden input: hint id $hiddenInp = new ilHiddenInputGUI('hint_id'); $form->addItem($hiddenInp); // init values require_once 'Services/Utilities/classes/class.ilUtil.php'; if (!$this->questionOBJ->isAdditionalContentEditingModePageObject()) { $areaInp->setValue(ilUtil::prepareTextareaOutput($questionHint->getText(), true)); } $numInp->setValue($questionHint->getPoints()); $hiddenInp->setValue($questionHint->getId()); } else { // build form title for a new hint $form->setTitle(sprintf($lng->txt('tst_question_hints_form_header_create'), $this->questionOBJ->getTitle())); } if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) { if ($questionHint instanceof ilAssQuestionHint) { $saveCmdLabel = $lng->txt('tst_question_hints_form_cmd_save_points'); } else { $saveCmdLabel = $lng->txt('tst_question_hints_form_cmd_save_points_and_edit_page'); } } else { $saveCmdLabel = $lng->txt('tst_question_hints_form_cmd_save'); } $form->setFormAction($ilCtrl->getFormAction($this)); $form->addCommandButton(self::CMD_CANCEL_FORM, $lng->txt('cancel')); $form->addCommandButton(self::CMD_SAVE_FORM, $saveCmdLabel); return $form; }
/** * Init settings property form * * @access protected */ protected function initFormSettings() { if (is_object($this->form)) { return true; } include_once 'Services/Calendar/classes/class.ilCalendarUtil.php'; include_once 'Services/Form/classes/class.ilPropertyFormGUI.php'; $this->form = new ilPropertyFormGUI(); $this->form->setFormAction($this->ctrl->getFormAction($this)); $this->form->setTitle($this->lng->txt('cal_global_settings')); $this->form->addCommandButton('save', $this->lng->txt('save')); #$this->form->addCommandButton('cancel',$this->lng->txt('cancel')); $check = new ilCheckboxInputGUI($this->lng->txt('enable_calendar'), 'enable'); $check->setValue(1); $check->setChecked($this->settings->isEnabled() ? true : false); $this->form->addItem($check); $server_tz = new ilNonEditableValueGUI($this->lng->txt('cal_server_tz')); $server_tz->setValue(ilTimeZone::_getDefaultTimeZone()); $this->form->addItem($server_tz); $select = new ilSelectInputGUI($this->lng->txt('cal_def_timezone'), 'default_timezone'); $select->setOptions(ilCalendarUtil::_getShortTimeZoneList()); $select->setInfo($this->lng->txt('cal_def_timezone_info')); $select->setValue($this->settings->getDefaultTimeZone()); $this->form->addItem($select); $year = date("Y"); $select = new ilSelectInputGUI($this->lng->txt('cal_def_date_format'), 'default_date_format'); $select->setOptions(array(ilCalendarSettings::DATE_FORMAT_DMY => '31.10.' . $year, ilCalendarSettings::DATE_FORMAT_YMD => $year . "-10-31", ilCalendarSettings::DATE_FORMAT_MDY => "10/31/" . $year)); $select->setInfo($this->lng->txt('cal_def_date_format_info')); $select->setValue($this->settings->getDefaultDateFormat()); $this->form->addItem($select); $select = new ilSelectInputGUI($this->lng->txt('cal_def_time_format'), 'default_time_format'); $select->setOptions(array(ilCalendarSettings::TIME_FORMAT_24 => '13:00', ilCalendarSettings::TIME_FORMAT_12 => '1:00pm')); $select->setInfo($this->lng->txt('cal_def_time_format_info')); $select->setValue($this->settings->getDefaultTimeFormat()); $this->form->addItem($select); // Weekstart $radio = new ilRadioGroupInputGUI($this->lng->txt('cal_def_week_start'), 'default_week_start'); $radio->setValue($this->settings->getDefaultWeekStart()); $option = new ilRadioOption($this->lng->txt('l_su'), 0); $radio->addOption($option); $option = new ilRadioOption($this->lng->txt('l_mo'), 1); $radio->addOption($option); $this->form->addItem($radio); // Day start $day_start = new ilSelectInputGUI($this->lng->txt('cal_day_start'), 'dst'); $day_start->setOptions(ilCalendarUtil::getHourSelection($this->settings->getDefaultTimeFormat())); $day_start->setValue($this->settings->getDefaultDayStart()); $this->form->addItem($day_start); $day_end = new ilSelectInputGUI($this->lng->txt('cal_day_end'), 'den'); $day_end->setOptions(ilCalendarUtil::getHourSelection($this->settings->getDefaultTimeFormat())); $day_end->setValue($this->settings->getDefaultDayEnd()); $this->form->addItem($day_end); $sync = new ilCheckboxInputGUI($this->lng->txt('cal_webcal_sync'), 'webcal'); $sync->setValue(1); $sync->setChecked($this->settings->isWebCalSyncEnabled()); $sync->setInfo($this->lng->txt('cal_webcal_sync_info')); $sync_min = new ilNumberInputGUI('', 'webcal_hours'); $sync_min->setSize(2); $sync_min->setMaxLength(3); $sync_min->setValue($this->settings->getWebCalSyncHours()); $sync_min->setSuffix($this->lng->txt('hours')); $sync->addSubItem($sync_min); $this->form->addItem($sync); // enable milestone planning in groups $mil = new ilFormSectionHeaderGUI(); $mil->setTitle($this->lng->txt('cal_milestone_settings')); $this->form->addItem($mil); $checkm = new ilCheckboxInputGUI($this->lng->txt('cal_enable_group_milestones'), 'enable_grp_milestones'); $checkm->setValue(1); $checkm->setChecked($this->settings->getEnableGroupMilestones() ? true : false); $checkm->setInfo($this->lng->txt('cal_enable_group_milestones_desc')); $this->form->addItem($checkm); // Consultation hours $con = new ilFormSectionHeaderGUI(); $con->setTitle($this->lng->txt('cal_ch_form_header')); $this->form->addItem($con); $ch = new ilCheckboxInputGUI($this->lng->txt('cal_ch_form'), 'ch'); $ch->setInfo($this->lng->txt('cal_ch_form_info')); $ch->setValue(1); $ch->setChecked($this->settings->areConsultationHoursEnabled()); $this->form->addItem($ch); // repository visibility default $rep = new ilFormSectionHeaderGUI(); $rep->setTitle($GLOBALS['lng']->txt('cal_setting_global_vis_repos')); $this->form->addItem($rep); $crs = new ilCheckboxInputGUI($GLOBALS['lng']->txt('cal_setting_global_crs_vis'), 'visible_crs'); $crs->setInfo($GLOBALS['lng']->txt('cal_setting_global_crs_vis_info')); $crs->setValue(1); $crs->setInfo($GLOBALS['lng']->txt('cal_setting_global_crs_vis_info')); $crs->setChecked($this->settings->isCourseCalendarEnabled()); $this->form->addItem($crs); $grp = new ilCheckboxInputGUI($GLOBALS['lng']->txt('cal_setting_global_grp_vis'), 'visible_grp'); $grp->setInfo($GLOBALS['lng']->txt('cal_setting_global_grp_vis_info')); $grp->setValue(1); $grp->setInfo($GLOBALS['lng']->txt('cal_setting_global_grp_vis_info')); $grp->setChecked($this->settings->isGroupCalendarEnabled()); $this->form->addItem($grp); // Notifications $not = new ilFormSectionHeaderGUI(); $not->setTitle($this->lng->txt('notifications')); $this->form->addItem($not); $cgn = new ilCheckboxInputGUI($this->lng->txt('cal_notification'), 'cn'); $cgn->setOptionTitle($this->lng->txt('cal_notification_crsgrp')); $cgn->setValue(1); $cgn->setChecked($this->settings->isNotificationEnabled()); $cgn->setInfo($this->lng->txt('cal_adm_notification_info')); $this->form->addItem($cgn); $cnu = new ilCheckboxInputGUI('', 'cnu'); $cnu->setOptionTitle($this->lng->txt('cal_notification_users')); $cnu->setValue(1); $cnu->setChecked($this->settings->isUserNotificationEnabled()); $cnu->setInfo($this->lng->txt('cal_adm_notification_user_info')); $this->form->addItem($cnu); // Registration $book = new ilFormSectionHeaderGUI(); $book->setTitle($this->lng->txt('cal_registrations')); $this->form->addItem($book); $cgn = new ilCheckboxInputGUI($this->lng->txt('cal_cg_registrations'), 'cgr'); $cgn->setValue(1); $cgn->setChecked($this->settings->isCGRegistrationEnabled()); $cgn->setInfo($this->lng->txt('cal_cg_registration_info')); $this->form->addItem($cgn); // Synchronisation cache $sec = new ilFormSectionHeaderGUI(); $sec->setTitle($this->lng->txt('cal_cache_settings')); $this->form->addItem($sec); $cache = new ilRadioGroupInputGUI($this->lng->txt('cal_sync_cache'), 'sync_cache'); $cache->setValue((int) $this->settings->isSynchronisationCacheEnabled()); $cache->setInfo($this->lng->txt('cal_sync_cache_info')); $cache->setRequired(true); $sync_cache = new ilRadioOption($this->lng->txt('cal_sync_disabled'), 0); $cache->addOption($sync_cache); $sync_cache = new ilRadioOption($this->lng->txt('cal_sync_enabled'), 1); $cache->addOption($sync_cache); $cache_t = new ilNumberInputGUI('', 'sync_cache_time'); $cache_t->setValue($this->settings->getSynchronisationCacheMinutes()); $cache_t->setMinValue(0); $cache_t->setSize(3); $cache_t->setMaxLength(3); $cache_t->setSuffix($this->lng->txt('form_minutes')); $sync_cache->addSubItem($cache_t); $this->form->addItem($cache); // Calendar cache $cache = new ilRadioGroupInputGUI($this->lng->txt('cal_cache'), 'cache'); $cache->setValue((int) $this->settings->isCacheUsed()); $cache->setInfo($this->lng->txt('cal_cache_info')); $cache->setRequired(true); $sync_cache = new ilRadioOption($this->lng->txt('cal_cache_disabled'), 0); $cache->addOption($sync_cache); $sync_cache = new ilRadioOption($this->lng->txt('cal_cache_enabled'), 1); $cache->addOption($sync_cache); $cache_t = new ilNumberInputGUI('', 'cache_time'); $cache_t->setValue($this->settings->getCacheMinutes()); $cache_t->setMinValue(0); $cache_t->setSize(3); $cache_t->setMaxLength(3); $cache_t->setSuffix($this->lng->txt('form_minutes')); $sync_cache->addSubItem($cache_t); $this->form->addItem($cache); }
private function initLoginSettingsForm() { $this->setSubTabs('settings'); $this->tabs_gui->setTabActive('settings'); $this->tabs_gui->setSubTabActive('loginname_settings'); include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $this->loginSettingsForm = new ilPropertyFormGUI(); $this->loginSettingsForm->setFormAction($this->ctrl->getFormAction($this, 'saveLoginnameSettings')); $this->loginSettingsForm->setTitle($this->lng->txt('loginname_settings')); $chbChangeLogin = new ilCheckboxInputGUI($this->lng->txt('allow_change_loginname'), 'allow_change_loginname'); $chbChangeLogin->setValue(1); $this->loginSettingsForm->addItem($chbChangeLogin); $chbCreateHistory = new ilCheckboxInputGUI($this->lng->txt('history_loginname'), 'create_history_loginname'); $chbCreateHistory->setInfo($this->lng->txt('loginname_history_info')); $chbCreateHistory->setValue(1); $chbChangeLogin->addSubItem($chbCreateHistory); $chbReuseLoginnames = new ilCheckboxInputGUI($this->lng->txt('reuse_of_loginnames_contained_in_history'), 'reuse_of_loginnames'); $chbReuseLoginnames->setValue(1); $chbReuseLoginnames->setInfo($this->lng->txt('reuse_of_loginnames_contained_in_history_info')); $chbChangeLogin->addSubItem($chbReuseLoginnames); $chbChangeBlockingTime = new ilNumberInputGUI($this->lng->txt('loginname_change_blocking_time'), 'loginname_change_blocking_time'); $chbChangeBlockingTime->allowDecimals(true); $chbChangeBlockingTime->setSuffix($this->lng->txt('days')); $chbChangeBlockingTime->setInfo($this->lng->txt('loginname_change_blocking_time_info')); $chbChangeBlockingTime->setSize(10); $chbChangeBlockingTime->setMaxLength(10); $chbChangeLogin->addSubItem($chbChangeBlockingTime); $this->loginSettingsForm->addCommandButton('saveLoginnameSettings', $this->lng->txt('save')); }
public function populateAnswerSpecificFormPart(\ilPropertyFormGUI $form) { // points $points = new ilNumberInputGUI($this->lng->txt("points"), "points"); $points->allowDecimals(true); $points->setValue($this->object->getPoints() > 0 ? $this->object->getPoints() : ''); $points->setRequired(TRUE); $points->setSize(3); $points->setMinValue(0.0); $points->setMinvalueShouldBeGreater(true); $form->addItem($points); $header = new ilFormSectionHeaderGUI(); $header->setTitle($this->lng->txt("range")); $form->addItem($header); // lower bound $lower_limit = new ilFormulaInputGUI($this->lng->txt("range_lower_limit"), "lowerlimit"); $lower_limit->setSize(25); $lower_limit->setMaxLength(20); $lower_limit->setRequired(true); $lower_limit->setValue($this->object->getLowerLimit()); $form->addItem($lower_limit); // upper bound $upper_limit = new ilFormulaInputGUI($this->lng->txt("range_upper_limit"), "upperlimit"); $upper_limit->setSize(25); $upper_limit->setMaxLength(20); $upper_limit->setRequired(true); $upper_limit->setValue($this->object->getUpperLimit()); $form->addItem($upper_limit); // reset input length, if max chars are set if ($this->object->getMaxChars() > 0) { $lower_limit->setSize($this->object->getMaxChars()); $lower_limit->setMaxLength($this->object->getMaxChars()); $upper_limit->setSize($this->object->getMaxChars()); $upper_limit->setMaxLength($this->object->getMaxChars()); } }
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); }
/** * Init assignment form. * * @param int $a_mode "create"/"edit" */ public function initAssignmentForm($a_mode = "create") { global $lng, $ilCtrl, $ilSetting; // init form $lng->loadLanguageModule("form"); include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form = new ilPropertyFormGUI(); $this->form->setTableWidth("600px"); if ($a_mode == "edit") { $this->form->setTitle($lng->txt("exc_edit_assignment")); } else { $this->form->setTitle($lng->txt("exc_new_assignment")); } $this->form->setFormAction($ilCtrl->getFormAction($this)); // type include_once "./Modules/Exercise/classes/class.ilExAssignment.php"; $types = array(ilExAssignment::TYPE_UPLOAD => $this->lng->txt("exc_type_upload"), ilExAssignment::TYPE_UPLOAD_TEAM => $this->lng->txt("exc_type_upload_team"), ilExAssignment::TYPE_TEXT => $this->lng->txt("exc_type_text")); if (!$ilSetting->get('disable_wsp_blogs')) { $types[ilExAssignment::TYPE_BLOG] = $this->lng->txt("exc_type_blog"); } if ($ilSetting->get('user_portfolios')) { $types[ilExAssignment::TYPE_PORTFOLIO] = $this->lng->txt("exc_type_portfolio"); } if (sizeof($types) > 1) { $ty = new ilSelectInputGUI($this->lng->txt("exc_assignment_type"), "type"); $ty->setOptions($types); $ty->setRequired(true); } else { $ty = new ilHiddenInputGUI("type"); $ty->setValue(ilExAssignment::TYPE_UPLOAD); } $this->form->addItem($ty); // title $ti = new ilTextInputGUI($this->lng->txt("title"), "title"); $ti->setMaxLength(200); $ti->setRequired(true); $this->form->addItem($ti); // start time y/n $cb = new ilCheckboxInputGUI($this->lng->txt("exc_start_time"), "start_time_cb"); $this->form->addItem($cb); // start time $edit_date = new ilDateTimeInputGUI("", "start_time"); $edit_date->setShowTime(true); $cb->addSubItem($edit_date); // deadline y/n $dcb = new ilCheckboxInputGUI($this->lng->txt("exc_deadline"), "deadline_cb"); $dcb->setChecked(true); $this->form->addItem($dcb); // Deadline $edit_date = new ilDateTimeInputGUI($lng->txt(""), "deadline"); $edit_date->setShowTime(true); $dcb->addSubItem($edit_date); // mandatory $cb = new ilCheckboxInputGUI($this->lng->txt("exc_mandatory"), "mandatory"); $cb->setInfo($this->lng->txt("exc_mandatory_info")); $cb->setChecked(true); $this->form->addItem($cb); // Work Instructions $desc_input = new ilTextAreaInputGUI($lng->txt("exc_instruction"), "instruction"); $desc_input->setRows(20); $desc_input->setUseRte(true); $desc_input->setRteTagSet("mini"); $this->form->addItem($desc_input); // files if ($a_mode == "create") { $files = new ilFileWizardInputGUI($this->lng->txt('objs_file'), 'files'); $files->setFilenames(array(0 => '')); $this->form->addItem($files); } // peer review $peer = new ilCheckboxInputGUI($lng->txt("exc_peer_review"), "peer"); $peer->setInfo($this->lng->txt("exc_peer_review_ass_setting_info")); $this->form->addItem($peer); if ($a_mode == "create") { $peer->setInfo($lng->txt("exc_peer_review_info")); } $peer_min = new ilNumberInputGUI($lng->txt("exc_peer_review_min_number"), "peer_min"); $peer_min->setInfo($lng->txt("exc_peer_review_min_number_info")); $peer_min->setRequired(true); $peer_min->setValue(5); $peer_min->setSize(3); $peer_min->setValue(2); $peer->addSubItem($peer_min); $peer_dl = new ilDateTimeInputGUI($lng->txt("exc_peer_review_deadline"), "peer_dl"); $peer_dl->setInfo($lng->txt("exc_peer_review_deadline_info")); $peer_dl->enableDateActivation("", "peer_dl_tgl"); $peer_dl->setShowTime(true); $peer->addSubItem($peer_dl); $peer_file = new ilCheckboxInputGUI($lng->txt("exc_peer_review_file"), "peer_file"); $peer_file->setInfo($lng->txt("exc_peer_review_file_info")); $peer->addSubItem($peer_file); $peer_prsl = new ilCheckboxInputGUI($lng->txt("exc_peer_review_personal"), "peer_prsl"); $peer_prsl->setInfo($lng->txt("exc_peer_review_personal_info")); $peer->addSubItem($peer_prsl); if ($a_mode != "create" && $this->ass && $this->ass->getDeadline() && $this->ass->getDeadline() < time()) { $peer_prsl->setDisabled(true); } // global feedback $fb = new ilCheckboxInputGUI($lng->txt("exc_global_feedback_file"), "fb"); $this->form->addItem($fb); $fb_file = new ilFileInputGUI($lng->txt("file"), "fb_file"); // $fb_file->setRequired(true); $fb_file->setALlowDeletion(true); $fb->addSubItem($fb_file); $fb_date = new ilRadioGroupInputGUI($lng->txt("exc_global_feedback_file_date"), "fb_date"); $fb_date->setRequired(true); $fb_date->addOption(new ilRadioOption($lng->txt("exc_global_feedback_file_date_deadline"), ilExAssignment::FEEDBACK_DATE_DEADLINE)); $fb_date->addOption(new ilRadioOption($lng->txt("exc_global_feedback_file_date_upload"), ilExAssignment::FEEDBACK_DATE_SUBMISSION)); $fb->addSubItem($fb_date); $fb_cron = new ilCheckboxInputGUI($lng->txt("exc_global_feedback_file_cron"), "fb_cron"); $fb_cron->setInfo($lng->txt("exc_global_feedback_file_cron_info")); $fb->addSubItem($fb_cron); // save and cancel commands if ($a_mode == "create") { $this->form->addCommandButton("saveAssignment", $lng->txt("save")); $this->form->addCommandButton("listAssignments", $lng->txt("cancel")); } else { $this->form->addCommandButton("updateAssignment", $lng->txt("save")); $this->form->addCommandButton("listAssignments", $lng->txt("cancel")); } }
protected function initCustomIconsForm() { global $ilSetting; include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; include_once "Services/Form/classes/class.ilCombinationInputGUI.php"; $form = new ilPropertyFormGUI(); $form->setTitle($this->lng->txt("rep_custom_icons")); $form->setFormAction($this->ctrl->getFormAction($this, 'saveCustomIcons')); $cb = new ilCheckboxInputGUI($this->lng->txt("enable_custom_icons"), "custom_icons"); $cb->setInfo($this->lng->txt("enable_custom_icons_info")); $cb->setChecked($ilSetting->get("custom_icons")); $form->addItem($cb); $size_big = new ilCombinationInputGUI($this->lng->txt("custom_icon_size_big")); $form->addItem($size_big); $width = new ilNumberInputGUI("", "custom_icon_big_width"); $width->setSize(3); $width->setValue($ilSetting->get("custom_icon_big_width")); $size_big->addCombinationItem("bgw", $width, $this->lng->txt("width")); $height = new ilNumberInputGUI("", "custom_icon_big_height"); $height->setSize(3); $height->setValue($ilSetting->get("custom_icon_big_height")); $size_big->addCombinationItem("bgh", $height, $this->lng->txt("height")); $size_small = new ilCombinationInputGUI($this->lng->txt("custom_icon_size_standard")); $form->addItem($size_small); $width = new ilNumberInputGUI("", "custom_icon_small_width"); $width->setSize(3); $width->setValue($ilSetting->get("custom_icon_small_width")); $size_small->addCombinationItem("smw", $width, $this->lng->txt("width")); $height = new ilNumberInputGUI("", "custom_icon_small_height"); $height->setSize(3); $height->setValue($ilSetting->get("custom_icon_small_height")); $size_small->addCombinationItem("smh", $height, $this->lng->txt("height")); $size_tiny = new ilCombinationInputGUI($this->lng->txt("custom_icon_size_tiny")); $form->addItem($size_tiny); $width = new ilNumberInputGUI("", "custom_icon_tiny_width"); $width->setSize(3); $width->setValue($ilSetting->get("custom_icon_tiny_width")); $size_tiny->addCombinationItem("tnw", $width, $this->lng->txt("width")); $height = new ilNumberInputGUI("", "custom_icon_tiny_height"); $height->setSize(3); $height->setValue($ilSetting->get("custom_icon_tiny_height")); $size_tiny->addCombinationItem("tnh", $height, $this->lng->txt("height")); $form->addCommandButton('saveCustomIcons', $this->lng->txt('save')); return $form; }
/** * Init form * @param int $a_mode * @return */ protected function initFormSequence($a_mode) { include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; include_once './Services/YUI/classes/class.ilYuiUtil.php'; ilYuiUtil::initDomEvent(); $this->form = new ilPropertyFormGUI(); $this->form->setFormAction($this->ctrl->getFormAction($this)); switch ($a_mode) { case self::MODE_CREATE: $this->form->setTitle($this->lng->txt('cal_ch_add_sequence')); $this->form->addCommandButton('saveSequence', $this->lng->txt('save')); $this->form->addCommandButton('appointmentList', $this->lng->txt('cancel')); break; /* case self::MODE_UPDATE: $this->form->setTitle($this->lng->txt('cal_ch_edit_sequence')); $this->form->addCommandButton('updateSequence', $this->lng->txt('save')); $this->form->addCommandButton('appointmentList', $this->lng->txt('cancel')); break; */ /* case self::MODE_UPDATE: $this->form->setTitle($this->lng->txt('cal_ch_edit_sequence')); $this->form->addCommandButton('updateSequence', $this->lng->txt('save')); $this->form->addCommandButton('appointmentList', $this->lng->txt('cancel')); break; */ case self::MODE_MULTI: $this->form->setTitle($this->lng->txt('cal_ch_multi_edit_sequence')); $this->form->addCommandButton('updateMulti', $this->lng->txt('save')); $this->form->addCommandButton('appointmentList', $this->lng->txt('cancel')); break; } // in case of existing groups show a selection include_once './Services/Calendar/classes/ConsultationHours/class.ilConsultationHourGroups.php'; if (count($options = ilConsultationHourGroups::getGroupSelectOptions($this->getUserId()))) { $group = new ilSelectInputGUI($this->lng->txt('cal_ch_grp_selection'), 'grp'); $group->setOptions($options); $group->setRequired(false); $this->form->addItem($group); } // Title $ti = new ilTextInputGUI($this->lng->txt('title'), 'ti'); $ti->setSize(32); $ti->setMaxLength(128); $ti->setRequired(true); $this->form->addItem($ti); if ($a_mode != self::MODE_MULTI) { // Start include_once './Services/Form/classes/class.ilDateTimeInputGUI.php'; $dur = new ilDateTimeInputGUI($this->lng->txt('cal_start'), 'st'); $dur->setShowTime(true); $dur->setMinuteStepSize(5); $this->form->addItem($dur); // Duration $du = new ilDurationInputGUI($this->lng->txt('cal_ch_duration'), 'du'); $du->setShowMinutes(true); $du->setShowHours(true); $this->form->addItem($du); // Number of appointments $nu = new ilNumberInputGUI($this->lng->txt('cal_ch_num_appointments'), 'ap'); $nu->setInfo($this->lng->txt('cal_ch_num_appointments_info')); $nu->setSize(2); $nu->setMaxLength(2); $nu->setRequired(true); $nu->setMinValue(1); $this->form->addItem($nu); // Recurrence include_once './Services/Calendar/classes/Form/class.ilRecurrenceInputGUI.php'; $rec = new ilRecurrenceInputGUI($this->lng->txt('cal_recurrences'), 'frequence'); $rec->setEnabledSubForms(array(IL_CAL_FREQ_DAILY, IL_CAL_FREQ_WEEKLY, IL_CAL_FREQ_MONTHLY)); $this->form->addItem($rec); } // Number of bookings $nu = new ilNumberInputGUI($this->lng->txt('cal_ch_num_bookings'), 'bo'); $nu->setSize(2); $nu->setMaxLength(2); $nu->setMinValue(1); $nu->setRequired(true); $this->form->addItem($nu); // Deadline $dead = new ilDurationInputGUI($this->lng->txt('cal_ch_deadline'), 'dead'); $dead->setInfo($this->lng->txt('cal_ch_deadline_info')); $dead->setShowMinutes(false); $dead->setShowHours(true); $dead->setShowDays(true); $this->form->addItem($dead); // Location $lo = new ilTextInputGUI($this->lng->txt('cal_where'), 'lo'); $lo->setSize(32); $lo->setMaxLength(128); $this->form->addItem($lo); // Description $de = new ilTextAreaInputGUI($this->lng->txt('description'), 'de'); $de->setRows(10); $de->setCols(60); $this->form->addItem($de); // Target Object $tgt = new ilTextInputGUI($this->lng->txt('cal_ch_target_object'), 'tgt'); $tgt->setInfo($this->lng->txt('cal_ch_target_object_info')); $tgt->setSize(16); $tgt->setMaxLength(128); $this->form->addItem($tgt); }
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 ilNumberInputGUI($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); $pltags = new ilCheckboxInputGUI($this->lng->txt('adm_show_comments_tagging_in_lists_tags'), 'comments_tagging_in_lists_tags'); $pltags->setValue(1); $pltags->setChecked($ilSetting->get('comments_tagging_in_lists_tags')); $pl->addSubItem($pltags); $form->addCommandButton('saveSettings', $this->lng->txt('save')); return $form; }