/** * 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; }
public function setFormValues(ilPropertyFormGUI $form) { $form->getItemByPostVar('registration_type')->setValue($this->getCurrentObject()->getRegistrationType()); $form->getItemByPostVar('registration_membership_limited')->setChecked($this->getCurrentObject()->isRegistrationUserLimitEnabled()); $form->getItemByPostVar('registration_max_members')->setValue($this->getCurrentObject()->getRegistrationMaxUsers()); $form->getItemByPostVar('waiting_list')->setChecked($this->getCurrentObject()->isRegistrationWaitingListEnabled()); }
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; }
/** * Get multi language form */ function getMultiLangForm() { global $tpl, $lng, $ilCtrl, $ilUser; include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); // master language include_once "./Services/MetaData/classes/class.ilMDLanguageItem.php"; $options = ilMDLanguageItem::_getLanguages(); $si = new ilSelectInputGUI($lng->txt("cont_master_lang"), "master_lang"); $si->setOptions($options); $si->setValue($ilUser->getLanguage()); $form->addItem($si); // additional languages include_once "./Services/MetaData/classes/class.ilMDLanguageItem.php"; $options = ilMDLanguageItem::_getLanguages(); $options = array("" => $lng->txt("please_select")) + $options; $si = new ilSelectInputGUI($lng->txt("cont_additional_langs"), "additional_langs"); $si->setOptions($options); $si->setMulti(true); $form->addItem($si); $form->addCommandButton("saveMultilingualitySettings", $lng->txt("save")); $form->addCommandButton("cancel", $lng->txt("cancel")); $form->setTitle($lng->txt("cont_activate_multi_lang")); $form->setFormAction($ilCtrl->getFormAction($this)); return $form; }
protected function initPluginSettings() { $n = new ilNonEditableValueGUI($this->getPluginHookObject()->txt('info_token_expires')); $n->setValue(date(DATE_ISO8601, $this->getPluginObject()->getValidThrough())); $this->form->addItem($n); $this->form->getItemByPostVar('root_folder')->setDisabled(true); }
/** * @return string */ public function getHTML() { global $tpl, $ilTabs, $ilCtrl, $lng; $form = new ilPropertyFormGUI(); $ilTabs->clearTargets(); $ilTabs->setBackTarget($lng->txt("back"), $ilCtrl->getLinkTarget($this, 'showContent')); $form->setTitle($lng->txt('detail_view')); // add link button if a link is defined in the settings $set = new ilSetting("bibl"); $link = $set->get(strtolower($this->bibl_obj->getFiletype())); if (!empty($link)) { $form->addCommandButton('autoLink', 'Link'); } $attributes = $this->entry->getAttributes(); //translate array key in order to sort by those keys foreach ($attributes as $key => $attribute) { //Check if there is a specific language entry if ($lng->exists($key)) { $strDescTranslated = $lng->txt($key); } else { $arrKey = explode("_", $key); $is_standard_field = false; switch ($arrKey[0]) { case 'bib': $is_standard_field = ilBibTex::isStandardField($arrKey[2]); break; case 'ris': $is_standard_field = ilRis::isStandardField($arrKey[2]); break; } // var_dump($is_standard_field); // FSX if ($is_standard_field) { $strDescTranslated = $lng->txt($arrKey[0] . "_default_" . $arrKey[2]); } else { $strDescTranslated = $arrKey[2]; } } unset($attributes[$key]); $attributes[$strDescTranslated] = $attribute; } // sort attributes alphabetically by their array-key ksort($attributes, SORT_STRING); // render attributes to html foreach ($attributes as $key => $attribute) { $ci = new ilCustomInputGUI($key); $ci->setHtml($attribute); $form->addItem($ci); } // generate/render links to libraries $settings = ilBibliographicSetting::getAll(); foreach ($settings as $set) { $ci = new ilCustomInputGUI($set->getName()); $ci->setHtml($set->getButton($this->bibl_obj, $this->entry)); $form->addItem($ci); } $tpl->setPermanentLink("bibl", $this->bibl_obj->getRefId(), "_" . $_GET[ilObjBibliographicGUI::P_ENTRY_ID]); // set content and title return $form->getHTML(); //Permanent Link }
/** * 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; }
protected function importEditFormValues(ilPropertyFormGUI $a_form) { $max = $a_form->getInput("maxchars"); $this->object->setMaxChars(strlen($max) ? $max : null); $this->object->setTextWidth($a_form->getInput("textwidth")); $this->object->setTextHeight($a_form->getInput("textheight")); }
/** * @param ilObjBibliographic $bibl_obj * @return void * */ public function showDetails(ilObjBibliographic $bibl_obj) { global $tpl, $ilTabs, $ilCtrl, $lng; include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $ilTabs->clearTargets(); $ilTabs->setBackTarget("back", $ilCtrl->getLinkTarget($this, 'showContent')); $form->setTitle($lng->txt('detail_view')); $entry = new ilBibliographicEntry($bibl_obj->getFiletype(), $_GET['entryId']); $attributes = $entry->getAttributes(); //translate array key in order to sort by those keys foreach ($attributes as $key => $attribute) { //Check if there is a specific language entry if ($lng->exists($key)) { $strDescTranslated = $lng->txt($key); } else { $arrKey = explode("_", $key); $strDescTranslated = $lng->txt($arrKey[0] . "_default_" . $arrKey[2]); } unset($attributes[$key]); $attributes[$strDescTranslated] = $attribute; } // sort attributes alphabetically by their array-key ksort($attributes, SORT_STRING); // render attributes to html foreach ($attributes as $key => $attribute) { $ci = new ilCustomInputGUI($key); $ci->setHtml($attribute); $form->addItem($ci); } // set content and title $tpl->setContent($form->getHTML()); //Permanent Link $tpl->setPermanentLink("bibl", $bibl_obj->getRefId(), "_" . $_GET['entryId']); }
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; }
public function addCustomSettingsToForm(ilPropertyFormGUI $a_form) { global $lng, $ilSetting; $cb = new ilCheckboxInputGUI($lng->txt("cron_mail_notification_message"), "mail_notification_message"); $cb->setInfo($lng->txt("cron_mail_notification_message_info")); $cb->setChecked($ilSetting->get("mail_notification_message")); $a_form->addItem($cb); }
/** * @return ilPropertyFormGUI */ protected function getSettingsForm() { require_once 'Services/Form/classes/class.ilPropertyFormGUI.php'; $form = new ilPropertyFormGUI(); $form->setTitle($this->lng->txt('settings')); require_once 'Services/Administration/classes/class.ilAdministrationSettingsFormHandler.php'; ilAdministrationSettingsFormHandler::addFieldsToForm(ilAdministrationSettingsFormHandler::FORM_ACCESSIBILITY, $form, $this); return $form; }
/** * Configuration gui. */ function configure() { global $tpl; $pl = $this->getPluginObject(); $form = new ilPropertyFormGUI(); $form->setTitle($pl->txt('roomsharing_plugin_configuration')); $form->setDescription($pl->txt('roomsharing_plugin_config_not_required')); $tpl->setContent($form->getHTML()); }
/** * saves a given form object's specific form properties * relating to this question type * * (overwrites the method from ilAssMultiOptionQuestionFeedback, because of individual setting) * * @access public * @param ilPropertyFormGUI $form */ public function saveSpecificFormProperties(ilPropertyFormGUI $form) { if (!$this->questionOBJ->isAdditionalContentEditingModePageObject()) { $this->saveSpecificFeedbackSetting($this->questionOBJ->getId(), $form->getInput('feedback_setting')); foreach ($this->getAnswerOptionsByAnswerIndex() as $index => $answer) { $this->saveSpecificAnswerFeedbackContent($this->questionOBJ->getId(), $index, $form->getInput("feedback_answer_{$index}")); } } }
protected function initForm($submit_action) { $form = new ilPropertyFormGUI(); $input = new ilFileInputGUI($this->lng->txt("import_xml_file"), "import_file"); $input->setRequired(true); $form->addItem($input); $form->setFormAction($this->ctrl->getFormAction($this)); $form->addCommandButton($submit_action, $this->lng->txt("import")); return $form; }
protected function removeHiddenItems(ilPropertyFormGUI $form) { if ($this->settingsTemplate) { foreach ($this->settingsTemplate->getSettings() as $id => $item) { if ($item["hide"]) { $form->removeItemByPostVar($id); } } } }
/** * @param ilPropertyFormGUI $form * @param ilObjCloud $obj */ public function afterSavePluginCreation(ilObjCloud &$obj, ilPropertyFormGUI $form) { if ($form->getInput(self::F_BASE_FOLDER) == self::F_DEFAULT_BASE_FOLDER) { $root_folder = $obj->getTitle(); } else { $root_folder = $form->getInput(self::F_CUSTOM_BASE_FOLDER_INPUT); } $root_folder = '/ILIASCloud/' . ltrim($root_folder, "/"); $obj->setRootFolder($root_folder); }
/** * 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; }
/** * Get sub form html * */ final function getSubForm() { // subitems $pf = null; if (count($this->getSubItems()) > 0) { $pf = new ilPropertyFormGUI(); $pf->setMode("subform"); $pf->setItems($this->getSubItems()); } return $pf; }
protected function addCustomEditForm(ilPropertyFormGUI $a_form) { $radio_grp = new ilRadioGroupInputGUI($this->lng->txt('ecs_availability'), 'activation_type'); $radio_grp->setValue($this->object->getAvailabilityType()); $radio_grp->setDisabled(true); $radio_opt = new ilRadioOption($this->lng->txt('offline'), ilObjRemoteLearningModule::ACTIVATION_OFFLINE); $radio_grp->addOption($radio_opt); $radio_opt = new ilRadioOption($this->lng->txt('online'), ilObjRemoteLearningModule::ACTIVATION_ONLINE); $radio_grp->addOption($radio_opt); $a_form->addItem($radio_grp); }
/** * 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 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); }
/** * @param ilPropertyFormGUI $form * @param ilObjCloud $obj */ function afterSavePluginCreation(ilObjCloud &$obj, ilPropertyFormGUI $form) { if ($form->getInput(self::F_BASE_FOLDER) == self::F_DROPBOX_DEFAULT_BASE_FOLDER) { $obj->setRootFolder($obj->getTitle()); } else { $obj->setRootFolder($form->getInput(self::F_DROPBOX_CUSTOM_BASE_FOLDER_INPUT)); } if ($form->getInput(self::F_ONLINE) == "1") { $obj->setOnline(true); } $obj->doUpdate(); }
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; }
protected function importEditFormValues(ilPropertyFormGUI $a_form) { $this->object->setOrientation($a_form->getInput("orientation")); $this->object->categories->flushCategories(); foreach ($_POST['answers']['answer'] as $key => $value) { if (strlen($value)) { $this->object->getCategories()->addCategory($value, $_POST['answers']['other'][$key], 0, null, $_POST['answers']['scale'][$key]); } } if (strlen($_POST['answers']['neutral'])) { $this->object->getCategories()->addCategory($_POST['answers']['neutral'], 0, 1, null, $_POST['answers_neutral_scale']); } }
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; }
/** * Update properties */ public function uploadFiles() { $response = new stdClass(); $response->error = null; $response->debug = null; $this->initUploadForm(); if ($this->form->checkInput()) { try { $fileresult = $this->handleFileUpload($this->form->getInput("upload_files")); if ($fileresult) { $response = (object) array_merge((array) $response, (array) $fileresult); } } catch (ilException $e) { $response->error = $e->getMessage(); } } else { $error = new ilCloudException(ilCloudException::UPLOAD_FAILED); $response->error = $error->getMessage(); } // send response object (don't use 'application/json' as IE wants to download it!) header('Vary: Accept'); header('Content-type: text/plain'); echo ilJsonUtil::encode($response); exit; }
/** * Check input of form * * @param $a_mode 'create' | 'update' * * @return bool */ protected function checkInput($a_mode) { global $lng; $return = $this->form->checkInput(); // Additional check for text fields: The length property should be max 200 if the textarea option is not set if ($this->form->getInput('datatype') == ilDataCollectionDatatype::INPUTFORMAT_TEXT && (int) $this->form->getInput('prop_' . ilDataCollectionField::PROPERTYID_LENGTH) > 200 && !$this->form->getInput('prop_' . ilDataCollectionField::PROPERTYID_TEXTAREA)) { $inputObj = $this->form->getItemByPostVar('prop_' . ilDataCollectionField::PROPERTYID_LENGTH); $inputObj->setAlert($lng->txt("form_msg_value_too_high")); $return = false; } // Don't allow multiple fields with the same title in this table if ($a_mode == 'create') { if ($title = $this->form->getInput('title')) { if (ilDataCollectionTable::_hasFieldByTitle($title, $this->table_id)) { $inputObj = $this->form->getItemByPostVar('title'); $inputObj->setAlert($lng->txt("dcl_field_title_unique")); $return = false; } } } if (!$return) { ilUtil::sendFailure($lng->txt("form_input_not_valid")); } return $return; }
public function __construct(ilCtrl $ctrl, ilLanguage $lng, ilAssQuestionSkillAssignmentsGUI $parentGUI) { $this->ctrl = $ctrl; $this->lng = $lng; $this->parentGUI = $parentGUI; parent::__construct(); }