/** * 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; }
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; }
/** * Init courses form * * @param bool $a_insert * @return ilPropertyFormGUI */ protected function initForm($a_insert = false) { global $ilCtrl; include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($ilCtrl->getFormAction($this)); if ($a_insert) { $form->setTitle($this->lng->txt("cont_insert_amd_page_list")); } else { $form->setTitle($this->lng->txt("cont_update_amd_page_list")); } $form->setDescription($this->lng->txt("wiki_page_list_form_info")); include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php'; $this->record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_SEARCH, 'wiki', $this->getPage()->getWikiId(), 'wpg', $this->getPage()->getId()); $this->record_gui->setPropertyForm($form); $this->record_gui->setSelectedOnly(true); if (!$a_insert) { $this->record_gui->setSearchFormValues($this->content_obj->getFieldValues()); } $this->record_gui->parse(); if ($a_insert) { $form->addCommandButton("create_amd_page_list", $this->lng->txt("select")); $form->addCommandButton("cancelCreate", $this->lng->txt("cancel")); } else { $form->addCommandButton("update", $this->lng->txt("select")); $form->addCommandButton("cancelUpdate", $this->lng->txt("cancel")); } return $form; }
/** * Init settings form */ protected function initSettingsForm() { global $ilCtrl; include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; $form = new ilPropertyFormGUI(); $form->setFormAction($ilCtrl->getFormAction($this)); $form->setTitle($GLOBALS['lng']->txt('settings')); $form->addCommandButton('update', $GLOBALS['lng']->txt('save')); $form->addCommandButton('settings', $GLOBALS['lng']->txt('cancel')); // activation $active = new ilCheckboxInputGUI($GLOBALS['lng']->txt('fm_settings_active'), 'active'); $active->setInfo($GLOBALS['lng']->txt('fm_settings_active_info')); $active->setValue(1); $active->setChecked(ilFMSettings::getInstance()->isEnabled()); $form->addItem($active); // one frame $local = new ilCheckboxInputGUI($GLOBALS['lng']->txt('fm_settings_local'), 'local'); $local->setInfo($GLOBALS['lng']->txt('fm_settings_local_info')); $local->setValue(1); $local->setChecked(ilFMSettings::getInstance()->IsLocalFSEnabled()); $form->addItem($local); $fs = new ilNumberInputGUI($GLOBALS['lng']->txt('fm_settings_filesize'), 'filesize'); $fs->setSuffix('MiB'); $fs->setSize(3); $fs->setMaxLength(3); $fs->setMinValue(1); $fs->setMaxValue(999); $fs->setInfo($GLOBALS['lng']->txt('fm_settings_filesize_info')); $fs->setValue(ilFMSettings::getInstance()->getMaxFileSize()); $form->addItem($fs); return $form; }
/** * Creates an output of the edit form for the question * * @param bool $checkonly * * @return bool */ public function editQuestion($checkonly = FALSE) { $save = $this->isSaveCommand(); $this->getQuestionTemplate(); include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this)); $form->setTitle($this->outQuestionType()); $form->setMultipart(TRUE); $form->setTableWidth("100%"); $form->setId("assnumeric"); $this->addBasicQuestionFormProperties($form); $this->populateQuestionSpecificFormPart($form); $this->populateAnswerSpecificFormPart($form); $this->populateTaxonomyFormSection($form); $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; }
function initEditForm($a_job_id) { global $ilCtrl, $lng; $job = ilCronManager::getJobInstanceById($a_job_id); if (!$job) { $ilCtrl->redirect($this, "render"); } $ilCtrl->setParameter($this, "jid", $a_job_id); $data = array_pop(ilCronManager::getCronJobData($job->getId())); include_once "Services/Cron/classes/class.ilCronJob.php"; include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($ilCtrl->getFormAction($this, "update")); $form->setTitle($lng->txt("cron_action_edit") . ': "' . $job->getTitle() . '"'); if ($job->hasFlexibleSchedule()) { $type = new ilRadioGroupInputGUI($lng->txt("cron_schedule_type"), "type"); $type->setRequired(true); $type->setValue($data["schedule_type"]); $type->addOption(new ilRadioOption($lng->txt("cron_schedule_daily"), ilCronJob::SCHEDULE_TYPE_DAILY)); $type->addOption(new ilRadioOption($lng->txt("cron_schedule_weekly"), ilCronJob::SCHEDULE_TYPE_WEEKLY)); $type->addOption(new ilRadioOption($lng->txt("cron_schedule_monthly"), ilCronJob::SCHEDULE_TYPE_MONTHLY)); $type->addOption(new ilRadioOption($lng->txt("cron_schedule_quarterly"), ilCronJob::SCHEDULE_TYPE_QUARTERLY)); $type->addOption(new ilRadioOption($lng->txt("cron_schedule_yearly"), ilCronJob::SCHEDULE_TYPE_YEARLY)); $min = new ilRadioOption(sprintf($lng->txt("cron_schedule_in_minutes"), "x"), ilCronJob::SCHEDULE_TYPE_IN_MINUTES); $mini = new ilNumberInputGUI($lng->txt("cron_schedule_value"), "smini"); $mini->setRequired(true); $mini->setSize(5); if ($data["schedule_type"] == ilCronJob::SCHEDULE_TYPE_IN_MINUTES) { $mini->setValue($data["schedule_value"]); } $min->addSubItem($mini); $type->addOption($min); $hr = new ilRadioOption(sprintf($lng->txt("cron_schedule_in_hours"), "x"), ilCronJob::SCHEDULE_TYPE_IN_HOURS); $hri = new ilNumberInputGUI($lng->txt("cron_schedule_value"), "shri"); $hri->setRequired(true); $hri->setSize(5); if ($data["schedule_type"] == ilCronJob::SCHEDULE_TYPE_IN_HOURS) { $hri->setValue($data["schedule_value"]); } $hr->addSubItem($hri); $type->addOption($hr); $dy = new ilRadioOption(sprintf($lng->txt("cron_schedule_in_days"), "x"), ilCronJob::SCHEDULE_TYPE_IN_DAYS); $dyi = new ilNumberInputGUI($lng->txt("cron_schedule_value"), "sdyi"); $dyi->setRequired(true); $dyi->setSize(5); if ($data["schedule_type"] == ilCronJob::SCHEDULE_TYPE_IN_DAYS) { $dyi->setValue($data["schedule_value"]); } $dy->addSubItem($dyi); $type->addOption($dy); $form->addItem($type); } if ($job->hasCustomSettings()) { $job->addCustomSettingsToForm($form); } $form->addCommandButton("update", $lng->txt("save")); $form->addCommandButton("render", $lng->txt("cancel")); return $form; }
/** * Init consultation hours form * * @param bool $a_insert * @return ilPropertyFormGUI */ protected function initForm($a_insert = false) { global $ilCtrl, $ilUser, $lng; include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($ilCtrl->getFormAction($this)); if ($a_insert) { $form->setTitle($this->lng->txt("cont_insert_consultation_hours")); } else { $form->setTitle($this->lng->txt("cont_update_consultation_hours")); } $mode = new ilRadioGroupInputGUI($this->lng->txt("cont_cach_mode"), "mode"); $mode->setRequired(true); $form->addItem($mode); $opt_auto = new ilRadioOption($this->lng->txt("cont_cach_mode_automatic"), "auto"); $opt_auto->setInfo($this->lng->txt("cont_cach_mode_automatic_info")); $mode->addOption($opt_auto); $opt_manual = new ilRadioOption($this->lng->txt("cont_cach_mode_manual"), "manual"); $opt_manual->setInfo($this->lng->txt("cont_cach_mode_manual_info")); $mode->addOption($opt_manual); if (!$this->getPageConfig()->getEnablePCType("PlaceHolder")) { include_once "Services/Calendar/classes/ConsultationHours/class.ilConsultationHourGroups.php"; $grp_ids = ilConsultationHourGroups::getGroupsOfUser($ilUser->getId()); if (sizeof($grp_ids)) { $this->lng->loadLanguageModule("dateplaner"); $groups = new ilCheckboxGroupInputGUI($this->lng->txt("cal_ch_app_grp"), "grp"); $groups->setRequired(true); $opt_manual->addSubItem($groups); foreach ($grp_ids as $grp_obj) { $groups->addOption(new ilCheckboxOption($grp_obj->getTitle(), $grp_obj->getGroupId())); } } else { $opt_manual->setDisabled(true); } } else { $opt_manual->setDisabled(true); } if ($a_insert) { $mode->setValue("auto"); $form->addCommandButton("create_consultation_hours", $this->lng->txt("select")); $form->addCommandButton("cancelCreate", $this->lng->txt("cancel")); } else { // set values $grp_ids = $this->content_obj->getGroupIds(); if (sizeof($grp_ids)) { $mode->setValue("manual"); $groups->setValue($grp_ids); } else { $mode->setValue("auto"); } $form->addCommandButton("update", $this->lng->txt("select")); $form->addCommandButton("cancelUpdate", $this->lng->txt("cancel")); } return $form; }
/** * Init configuration form. * * @return object form object */ public function initConfigurationForm() { global $lng, $ilCtrl; $pl = $this->getPluginObject(); include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->addCommandButton("save", $lng->txt("save")); $form->setTitle($pl->txt("plugin_configuration")); $form->setFormAction($ilCtrl->getFormAction($this)); return $form; }
public function initUploadForm() { global $ilCtrl, $lng; include_once "./Services/Form/classes/class.ilDragDropFileInputGUI.php"; include_once "./Services/jQuery/classes/class.iljQueryUtil.php"; $this->form = new ilPropertyFormGUI(); $this->form->setId("upload"); $this->form->setMultipart(true); $this->form->setHideLabels(); $file = new ilDragDropFileInputGUI($lng->txt("cld_upload_flies"), "upload_files"); $file->setRequired(true); $this->form->addItem($file); $this->form->addCommandButton("uploadFiles", $lng->txt("upload")); $this->form->addCommandButton("cancelAll", $lng->txt("cancel")); $this->form->setTableWidth("100%"); $this->form->setTitle($lng->txt("upload_files_title")); $this->form->setTitleIcon(ilUtil::getImagePath('icon_file.gif'), $lng->txt('obj_file')); $this->form->setTitle($lng->txt("upload_files")); $this->form->setFormAction($ilCtrl->getFormAction($this, "uploadFiles")); $this->form->setTarget("cld_blank_target"); }
/** * */ protected function initSettingsForm() { if (null == $this->form) { $this->form = new ilPropertyFormGUI(); $this->form->setTitle($this->lng->txt('tos_tos_settings')); $this->form->setFormAction($this->ctrl->getFormAction($this, 'saveSettings')); $status = new ilCheckboxInputGUI($this->lng->txt('tos_status_enable'), 'tos_status'); $status->setInfo($this->lng->txt('tos_status_desc')); $this->form->addItem($status); $this->form->addCommandButton('saveSettings', $this->lng->txt('save')); } }
function initForm($a_mode) { global $ilCtrl, $lng, $ilSetting; include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form_gui = new ilPropertyFormGUI(); $form_gui->setFormAction($ilCtrl->getFormAction($this)); $form_gui->setTitle($lng->txt("cont_ed_pglprop")); // title $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); // description $desc_input = new ilTextAreaInputGUI($lng->txt("description"), "pgl_desc"); $desc_input->setValue($this->layout_object->description); $desc_input->setRows(3); $desc_input->setCols(37); $desc_input->setTitle($lng->txt("description")); $desc_input->setRequired(false); // modules $mods = new ilCheckboxGroupInputGUI($this->lng->txt("modules"), "module"); // $mods->setRequired(true); $mods->setValue($this->layout_object->getModules()); foreach (ilPageLayout::getAvailableModules() as $mod_id => $mod_caption) { $mod = new ilCheckboxOption($mod_caption, $mod_id); $mods->addOption($mod); } $form_gui->addItem($title_input); $form_gui->addItem($desc_input); $form_gui->addItem($mods); // style $fixed_style = $ilSetting->get("fixed_content_style_id"); $style_id = $this->layout_object->getStyleId(); if ($fixed_style > 0) { $st = new ilNonEditableValueGUI($lng->txt("cont_current_style")); $st->setValue(ilObject::_lookupTitle($fixed_style) . " (" . $this->lng->txt("global_fixed") . ")"); $form_gui->addItem($st); } else { include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $st_styles = ilObjStyleSheet::_getStandardStyles(true, false); $st_styles[0] = $this->lng->txt("default"); ksort($st_styles); $style_sel = new ilSelectInputGUI($lng->txt("obj_sty"), "style_id"); $style_sel->setOptions($st_styles); $style_sel->setValue($style_id); $form_gui->addItem($style_sel); } $form_gui->addCommandButton("updateProperties", $lng->txt($a_mode)); return $form_gui; }
/** * 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 initPropertiesForm() { $this->form = new ilPropertyFormGUI(); // Title $ti = new ilTextInputGUI($this->txt('title'), 'title'); $ti->setRequired(true); $this->form->addItem($ti); // Description $ta = new ilTextAreaInputGUI($this->txt('description'), 'desc'); $this->form->addItem($ta); $this->form->addCommandButton('updateProperties', $this->txt('save')); $this->form->setTitle($this->txt('edit_properties')); $this->form->setFormAction($this->ctrl->getFormAction($this)); }
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()); } }
/** * Init ADT-based form * * @return ilADTGroupFormBridge $a_form */ protected function initForm() { global $tpl, $lng, $ilCtrl; include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($ilCtrl->getFormAction($this->gui, "updateAction")); $adt_form = ilADTFactory::getInstance()->getFormBridgeForInstance($this->object->getProperties()); // has to be done BEFORE prepareFormElements() ... $adt_form->setForm($form); $this->prepareFormElements($adt_form); $adt_form->addToForm(); $adt_form->addJS($tpl); // :TODO: $form->addCommandButton("updateAction", $lng->txt("save")); return $adt_form; }
private function showPasswordFormCmd() { require_once 'Services/Form/classes/class.ilPropertyFormGUI.php'; require_once 'Services/Form/classes/class.ilPasswordInputGUI.php'; $form = new ilPropertyFormGUI(); $form->setTitle($this->lng->txt("tst_password_form")); $form->setDescription($this->lng->txt("tst_password_introduction")); $form->setFormAction($this->ctrl->getFormAction($this)); $form->addCommandButton(self::CMD_SAVE_ENTERED_PASSWORD, $this->lng->txt("submit")); $form->addCommandButton(self::CMD_BACK_TO_INFO_SCREEN, $this->lng->txt("cancel")); $inp = new ilPasswordInputGUI($this->lng->txt("tst_password"), 'password'); $inp->setRequired(true); $inp->setRetype(false); $form->addItem($inp); $this->tpl->setVariable($this->parentGUI->getContentBlockName(), $this->ctrl->getHTML($form)); }
protected function initFormSettings() { global $ilSetting; include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this, "saveSettings")); $form->setTitle($this->lng->txt("settings")); // dynamic web links $cb = new ilCheckboxInputGUI($this->lng->txt("links_dynamic"), "links_dynamic"); $cb->setInfo($this->lng->txt("links_dynamic_info")); $cb->setChecked($ilSetting->get("links_dynamic")); $form->addItem($cb); $form->addCommandButton("saveSettings", $this->lng->txt("save")); $form->addCommandButton("view", $this->lng->txt("cancel")); return $form; }
/** * Init Social Bookmark edit/create Form * * @param ilObjectGUI $formhandlerObject taken as form target * @param int $mode "create" / "edit" */ public static function _initForm($formhandlerObject, $mode = "create", $id = 0) { global $lng, $ilCtrl; include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setMultipart(true); // File Title $in_title = new ilTextInputGUI($lng->txt("title"), "title"); $in_title->setMaxLength(128); $in_title->setSize(40); $in_title->setRequired(true); $form->addItem($in_title); // Link $in_link = new ilTextInputGUI($lng->txt("link"), "link"); $in_link->setMaxLength(300); $in_link->setSize(40); $in_link->setRequired(true); $in_link->setInfo($lng->txt('socialbm_link_description')); $form->addItem($in_link); // File $in_file = new ilFileInputGUI($lng->txt("file"), "image_file"); $in_file->setSuffixes(array('bmp', 'gif', 'jpg', 'jpeg', 'png')); $form->addItem($in_file); // Activate on submit $in_activate = new ilCheckboxInputGUI($lng->txt("activate"), "activate"); $in_activate->setValue('1'); $form->addItem($in_activate); // save and cancel commands if ($mode == "create") { $form->addCommandButton("createSocialBookmark", $lng->txt("create")); $form->addCommandButton("editSocialBookmarks", $lng->txt("cancel")); $form->setTitle($lng->txt("adm_social_bm_create")); $in_file->setRequired(true); } else { if ($mode == "update") { $in_hidden = new ilHiddenInputGUI("sbm_id", $id); $form->addItem($in_hidden); $form->addCommandButton("updateSocialBookmark", $lng->txt("update")); $form->addCommandButton("cancel", $lng->txt("cancel")); $form->setTitle($lng->txt("adm_social_bm_edit")); $in_file->setRequired(false); } } $form->setTableWidth("60%"); $form->setFormAction($ilCtrl->getFormAction($formhandlerObject)); return $form; }
/** * structure / page object creation form */ function create() { $new_type = $_REQUEST["new_type"]; $this->ctrl->setParameter($this, "new_type", $new_type); include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this, "save")); $form->setTitle($this->lng->txt($new_type . "_new")); $title = new ilTextInputGUI($this->lng->txt("title"), "Fobject[title]"); $title->setRequired(true); $form->addItem($title); $desc = new ilTextAreaInputGUI($this->lng->txt("description"), "Fobject[desc]"); $form->addItem($desc); $form->addCommandButton("save", $this->lng->txt($new_type . "_add")); $form->addCommandButton("cancel", $this->lng->txt("cancel")); $this->tpl->setContent($form->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()); }
/** * Init create form * @param bool creation mode * @return ilPropertyFormGUI $form */ protected function initFormRoleTemplate($a_mode = self::FORM_MODE_CREATE) { include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; $form = new ilPropertyFormGUI(); if ($this->creation_mode) { $this->ctrl->setParameter($this, "new_type", 'rolt'); } $form->setFormAction($this->ctrl->getFormAction($this)); if ($a_mode == self::FORM_MODE_CREATE) { $form->setTitle($this->lng->txt('rolt_new')); $form->addCommandButton('save', $this->lng->txt('rolt_new')); } else { $form->setTitle($this->lng->txt('rolt_edit')); $form->addCommandButton('update', $this->lng->txt('save')); } $form->addCommandButton('cancel', $this->lng->txt('cancel')); $title = new ilTextInputGUI($this->lng->txt('title'), 'title'); if ($a_mode != self::FORM_MODE_CREATE) { if ($this->object->isInternalTemplate()) { $title->setDisabled(true); } $title->setValue($this->object->getTitle()); } $title->setSize(40); $title->setMaxLength(70); $title->setRequired(true); $form->addItem($title); $desc = new ilTextAreaInputGUI($this->lng->txt('description'), 'desc'); if ($a_mode != self::FORM_MODE_CREATE) { $desc->setValue($this->object->getDescription()); } $desc->setCols(40); $desc->setRows(3); $form->addItem($desc); if ($a_mode != self::FORM_MODE_CREATE) { $ilias_id = new ilNonEditableValueGUI($this->lng->txt("ilias_id"), "ilias_id"); $ilias_id->setValue('il_' . IL_INST_ID . '_' . ilObject::_lookupType($this->object->getId()) . '_' . $this->object->getId()); $form->addItem($ilias_id); } $pro = new ilCheckboxInputGUI($this->lng->txt('role_protect_permissions'), 'protected'); $pro->setChecked($GLOBALS['rbacreview']->isProtected($this->rolf_ref_id, $this->object->getId())); $pro->setValue(1); $form->addItem($pro); return $form; }
/** * Configure the displayed form for Settings edition. * * This method is called internally by @see */ protected function initSettingsForm() { /** * @var $ilCtrl ilCtrl */ global $ilCtrl; /* Configure global form attributes */ $this->form = new ilPropertyFormGUI(); $this->form->setTitle($this->txt('edit_properties')); $this->form->setFormAction($ilCtrl->getFormAction($this, 'updateSettings')); /* Configure form objects */ $ti = new ilTextInputGUI($this->txt('title'), 'title'); $ti->setRequired(true); $ta = new ilTextAreaInputGUI($this->txt('description'), 'desc'); $this->form->addItem($ti); $this->form->addItem($ta); $this->form->addCommandButton('updateSettings', $this->txt('save')); }
/** * Edit resources form. */ public function edit($a_insert = false) { global $ilCtrl, $tpl, $lng, $objDefinition; $this->displayValidationError(); // edit form include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($ilCtrl->getFormAction($this)); if ($a_insert) { $form->setTitle($this->lng->txt("cont_insert_login_page")); } else { $form->setTitle($this->lng->txt("cont_update_login_page")); } // type selection $type_prop = new ilRadioGroupInputGUI($this->lng->txt("cont_type"), "type"); foreach (ilPCLoginPageElement::getAllTypes() as $index => $lang_key) { $types[$index] = $this->lng->txt('cont_lpe_' . $lang_key); $option = new ilRadioOption($this->lng->txt('cont_lpe_' . $lang_key), $index); $type_prop->addOption($option); } $selected = $a_insert ? "" : $this->content_obj->getLoginPageElementType(); $type_prop->setValue($selected); $form->addItem($type_prop); // horizonal align $align_prop = new ilSelectInputGUI($this->lng->txt("cont_align"), "horizontal_align"); $options = array("Left" => $lng->txt("cont_left"), "Center" => $lng->txt("cont_center"), "Right" => $lng->txt("cont_right")); # "LeftFloat" => $lng->txt("cont_left_float"), # "RightFloat" => $lng->txt("cont_right_float")); $align_prop->setOptions($options); $align_prop->setValue($this->content_obj->getAlignment()); $form->addItem($align_prop); // save/cancel buttons if ($a_insert) { $form->addCommandButton("create_login_page_element", $lng->txt("save")); $form->addCommandButton("cancelCreate", $lng->txt("cancel")); } else { $form->addCommandButton("update_login_page_element", $lng->txt("save")); $form->addCommandButton("cancelUpdate", $lng->txt("cancel")); } $html = $form->getHTML(); $tpl->setContent($html); return $ret; }
protected function initFormSettings() { global $ilSetting; include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this, "saveSettings")); $form->setTitle($this->lng->txt("settings")); $this->addFieldsToForm($form); $this->lng->loadLanguageModule("mail"); // member notification $cn = new ilCheckboxInputGUI($this->lng->txt('mail_enable_' . $this->getParentObjType() . '_member_notification'), 'mail_member_notification'); $cn->setInfo($this->lng->txt('mail_enable_' . $this->getParentObjType() . '_member_notification_info')); $cn->setChecked($ilSetting->get('mail_' . $this->getParentObjType() . '_member_notification', true)); $form->addItem($cn); ilAdministrationSettingsFormHandler::addFieldsToForm($this->getAdministrationFormId(), $form, $this); $form->addCommandButton("saveSettings", $this->lng->txt("save")); $form->addCommandButton("view", $this->lng->txt("cancel")); return $form; }
/** * Init creation from */ function initForm() { global $ilCtrl, $lng; // edit form include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($ilCtrl->getFormAction($this)); $form->setTitle($this->lng->txt("cont_ed_insert_templ")); $radg = new ilRadioGroupInputGUI($lng->txt("cont_template"), "page_templ"); $radg->setRequired(true); $ts = $this->getPage()->getContentTemplates(); foreach ($ts as $t) { $op = new ilRadioOption($t["title"], $t["id"] . ":" . $t["parent_type"]); $radg->addOption($op); } $form->addItem($radg); $form->addCommandButton("create_templ", $lng->txt("insert")); $form->addCommandButton("cancelCreate", $lng->txt("cancel")); return $form; }
/** * Init configuration form. * * @return object form object */ public function initConfigurationForm() { global $lng, $ilCtrl; $pl = $this->getPluginObject(); include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); // setting 1 (a checkbox) $cb = new ilCheckboxInputGUI($pl->txt("setting_1"), "setting_1"); $form->addItem($cb); // setting 2 (text) $ti = new ilTextInputGUI($pl->txt("setting_2"), "setting_2"); $ti->setRequired(true); $ti->setMaxLength(10); $ti->setSize(10); $form->addItem($ti); $form->addCommandButton("save", $lng->txt("save")); $form->setTitle($pl->txt("example_plugin_configuration")); $form->setFormAction($ilCtrl->getFormAction($this)); return $form; }
/** * Edit question overview form. */ function edit($a_insert = false) { global $ilCtrl, $tpl, $lng; $this->displayValidationError(); // edit form include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($ilCtrl->getFormAction($this)); if ($a_insert) { $form->setTitle($this->lng->txt("cont_ed_insert_qover")); } else { $form->setTitle($this->lng->txt("cont_edit_qover")); } // short message $cb = new ilCheckboxInputGUI($this->lng->txt("cont_qover_short_message"), "short"); $cb->setInfo($this->lng->txt("cont_qover_short_message_info")); if (!$a_insert) { $cb->setChecked($this->content_obj->getShortMessage()); } else { $cb->setChecked(true); } $form->addItem($cb); // list wrong questions $cb = new ilCheckboxInputGUI($this->lng->txt("cont_qover_list_wrong_q"), "wrong_questions"); $cb->setInfo($this->lng->txt("cont_qover_list_wrong_q_info")); if (!$a_insert) { $cb->setChecked($this->content_obj->getListWrongQuestions()); } $form->addItem($cb); // save/cancel buttons if ($a_insert) { $form->addCommandButton("create_qover", $lng->txt("save")); $form->addCommandButton("cancelCreate", $lng->txt("cancel")); } else { $form->addCommandButton("update", $lng->txt("save")); $form->addCommandButton("cancelUpdate", $lng->txt("cancel")); } $html = $form->getHTML(); $tpl->setContent($html); return $ret; }
/** * Init configuration form. * * @return object form object */ public function initConfigurationForm() { global $lng, $ilCtrl; $pl = $this->getPluginObject(); include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); // Setting for the ephorus logging $ephorus_logging = new ilCheckboxInputGUI($pl->txt("ephorus_logging"), "ephorus_logging"); $ephorus_logging->setValue(1); $ephorus_logging->setInfo($pl->txt("ephorus_logging_description")); $form->addItem($ephorus_logging); // Setting for the hand-in code $handin_code = new ilTextInputGUI($pl->txt("handin_code"), "handin_code"); $handin_code->setRequired(true); $form->addItem($handin_code); // Setting for the hand-in address $handin_address = new ilTextInputGUI($pl->txt("handin_address"), "handin_address"); $handin_address->setSize(80); $handin_address->setRequired(true); $form->addItem($handin_address); // Setting for the index address $index_address = new ilTextInputGUI($pl->txt("index_address"), "index_address"); $index_address->setSize(80); $index_address->setRequired(true); $form->addItem($index_address); // Setting for the processtype $processtype = new ilSelectInputGUI($pl->txt("default_processtype"), "processtype"); $processtype->setOptions(array(1 => $pl->txt("default"), 3 => $pl->txt("private"))); $processtype->setInfo($pl->txt("default_processtype_description")); $form->addItem($processtype); // Setting for the disclosure $disclosure = new ilTextAreaInputGUI($pl->txt("disclosure"), "disclosure"); $disclosure->setCols(79); $disclosure->setRows(4); $form->addItem($disclosure); $form->addCommandButton("save", $lng->txt("save") . " / " . $pl->txt("check_connection")); $form->setTitle($pl->txt("ephorus_plugin_configuration")); $form->setFormAction($ilCtrl->getFormAction($this)); return $form; }
/** * Creates an output of the edit form for the question * * @param bool $checkonly * * @return bool */ public function editQuestion($checkonly = FALSE) { $save = $this->isSaveCommand(); $this->getQuestionTemplate(); include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this)); $form->setTitle($this->outQuestionType()); $isSingleline = $this->object->lastChange == 0 && !array_key_exists('types', $_POST) ? $this->object->getMultilineAnswerSetting() ? false : true : $this->object->isSingleline; if ($checkonly) { $isSingleline = $_POST['types'] == 0 ? true : false; } if ($isSingleline) { $form->setMultipart(TRUE); } else { $form->setMultipart(FALSE); } $form->setTableWidth("100%"); $form->setId("assmultiplechoice"); // title, author, description, question, working time (assessment mode) $this->addBasicQuestionFormProperties($form); $this->populateQuestionSpecificFormPart($form); $this->populateAnswerSpecificFormPart($form); $this->populateTaxonomyFormSection($form); $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; }
/** * @param assFormulaQuestionUnitCategory $cat * @return ilPropertyFormGUI */ protected function initUnitCategoryForm(assFormulaQuestionUnitCategory $cat = null) { if ($this->unit_cat_form instanceof ilPropertyFormGUI) { return $this->unit_cat_form; } $this->unit_cat_form = new ilPropertyFormGUI(); $title = new ilTextInputGUI($this->lng->txt('title'), 'category_name'); $title->setRequired(true); $this->unit_cat_form->addItem($title); if (null === $cat) { $this->unit_cat_form->setTitle($this->lng->txt('new_category')); $this->unit_cat_form->setFormAction($this->ctrl->getFormAction($this, 'addCategory')); $this->unit_cat_form->addCommandButton('addCategory', $this->lng->txt('save')); } else { $this->ctrl->setParameter($this, 'category_id', $cat->getId()); $this->unit_cat_form->addCommandButton('saveCategory', $this->lng->txt('save')); $this->unit_cat_form->setFormAction($this->ctrl->getFormAction($this, 'saveCategory')); $this->unit_cat_form->setTitle(sprintf($this->lng->txt('selected_category'), $cat->getDisplayString())); } $this->unit_cat_form->addCommandButton($this->getUnitCategoryOverviewCommand(), $this->lng->txt('cancel')); return $this->unit_cat_form; }