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); } }
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')); }
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)); $orientation->addOption(new ilRadioOption($this->lng->txt('combobox'), 2)); $a_form->addItem($orientation); // 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(true); $answers->setShowSavePhrase(true); $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()); if (!$this->object->getCategories()->getCategoryCount()) { $this->object->getCategories()->addCategory(""); } $answers->setValues($this->object->getCategories()); }
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); }
/** * Add membership form elements * @param ilPropertyFormGUI $form */ public final function addMembershipFormElements(ilPropertyFormGUI $form, $a_parent_post = '') { // Registration type $reg_type = new ilRadioGroupInputGUI($this->txt('reg_type'), 'registration_type'); //$reg_type->setValue($this->object->getRegistrationType()); if (in_array(ilMembershipRegistrationSettings::TYPE_DIRECT, $this->getOptions())) { $opt_dir = new ilRadioOption($this->txt('reg_direct'), ilMembershipRegistrationSettings::TYPE_DIRECT); #$this->lng->txt('grp_reg_direct_info')); $reg_type->addOption($opt_dir); } if (in_array(ilMembershipRegistrationSettings::TYPE_PASSWORD, $this->getOptions())) { $opt_pass = new ilRadioOption($this->txt('reg_pass'), ilMembershipRegistrationSettings::TYPE_PASSWORD); $pass = new ilTextInputGUI($GLOBALS['lng']->txt("password"), 'password'); $pass->setInfo($this->txt('reg_password_info')); #$pass->setValue($this->object->getPassword()); $pass->setSize(10); $pass->setMaxLength(32); $opt_pass->addSubItem($pass); $reg_type->addOption($opt_pass); } if (in_array(ilMembershipRegistrationSettings::TYPE_REQUEST, $this->getOptions())) { $opt_req = new ilRadioOption($this->txt('reg_request'), ilMembershipRegistrationSettings::TYPE_REQUEST, $this->txt('reg_request_info')); $reg_type->addOption($opt_req); } if (in_array(ilMembershipRegistrationSettings::TYPE_NONE, $this->getOptions())) { $opt_deact = new ilRadioOption($this->txt('reg_disabled'), ilMembershipRegistrationSettings::TYPE_NONE, $this->txt('reg_disabled_info')); $reg_type->addOption($opt_deact); } // Add to form $form->addItem($reg_type); if (in_array(ilMembershipRegistrationSettings::REGISTRATION_LIMITED_USERS, $this->getOptions())) { // max member $lim = new ilCheckboxInputGUI($this->txt('reg_max_members_short'), 'registration_membership_limited'); $lim->setValue(1); #$lim->setOptionTitle($this->lng->txt('reg_grp_max_members')); #$lim->setChecked($this->object->isMembershipLimited()); $max = new ilTextInputGUI($this->txt('reg_max_members'), 'registration_max_members'); #$max->setValue($this->object->getMaxMembers() ? $this->object->getMaxMembers() : ''); //$max->setTitle($this->lng->txt('members')); $max->setSize(3); $max->setMaxLength(4); $max->setInfo($this->txt('reg_max_members_info')); $lim->addSubItem($max); $wait = new ilCheckboxInputGUI($this->txt('reg_waiting_list'), 'waiting_list'); $wait->setValue(1); //$wait->setOptionTitle($this->lng->txt('grp_waiting_list')); $wait->setInfo($this->txt('reg_waiting_list_info')); #$wait->setChecked($this->object->isWaitingListEnabled() ? true : false); $lim->addSubItem($wait); $form->addItem($lim); } $this->setFormValues($form); }
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()); }
public function addToForm() { global $lng; $def = $this->getADT()->getCopyOfDefinition(); $selection = $this->getADT()->getSelection(); $options = $def->getOptions(); asort($options); // ? if (!$this->isRequired()) { $options = array("" => "-") + $options; } else { if ($this->getADT()->isNull()) { $options = array("" => $lng->txt("please_select")) + $options; } } if (!(bool) $this->force_radio) { $select = new ilSelectInputGUI($this->getTitle(), $this->getElementId()); $select->setOptions($options); } else { $select = new ilRadioGroupInputGUI($this->getTitle(), $this->getElementId()); foreach ($options as $value => $caption) { $option = new ilRadioOption($caption, $value); if (is_array($this->option_infos) && array_key_exists($value, $this->option_infos)) { $option->setInfo($this->option_infos[$value]); } $select->addOption($option); } } $this->addBasicFieldProperties($select, $def); $select->setValue($selection); $this->addToParentElement($select); }
/** * @param ilRadioOption $option */ public function initPluginCreationFormSection(ilRadioOption $option) { // $option->setInfo($this->txt('create_info1') . '</br>' . $this->txt('create_info2') . $this->getAdminConfigObject()->getAppName() // . $this->txt('create_info3')); $sub_selection = new ilRadioGroupInputGUI($this->txt(self::F_BASE_FOLDER), self::F_BASE_FOLDER); $sub_selection->setRequired(true); $option_default = new ilRadioOption($this->txt(self::F_DEFAULT_BASE_FOLDER), self::F_DEFAULT_BASE_FOLDER); $option_custom = new ilRadioOption($this->txt('custom_base_folder'), self::F_CUSTOM_FOLDER_SELECTION); $custom_base_folder_input = new ilTextInputGUI($this->txt(self::F_CUSTOM_BASE_FOLDER_INPUT), self::F_CUSTOM_BASE_FOLDER_INPUT); $custom_base_folder_input->setRequired(true); $custom_base_folder_input->setInfo($this->txt('custom_base_folder_input_info')); $option_custom->addSubItem($custom_base_folder_input); $sub_selection->addOption($option_default); $sub_selection->addOption($option_custom); $sub_selection->setValue(self::F_DEFAULT_BASE_FOLDER); $option->addSubItem($sub_selection); }
public function build(ilTestRandomQuestionSetSourcePoolDefinition $sourcePool, $availableTaxonomyIds) { $this->setFormAction($this->ctrl->getFormAction($this->questionSetConfigGUI)); $this->setTitle($this->lng->txt('tst_rnd_quest_set_cfg_pool_form')); $this->setId('tstRndQuestSetCfgPoolForm'); $this->addCommandButton($this->getSaveCommand(), $this->lng->txt('save')); $this->addCommandButton(ilTestRandomQuestionSetConfigGUI::CMD_SHOW_SRC_POOL_DEF_LIST, $this->lng->txt('cancel')); $hiddenDefId = new ilHiddenInputGUI('src_pool_def_id'); $hiddenDefId->setValue($sourcePool->getId()); $this->addItem($hiddenDefId); $hiddenPoolId = new ilHiddenInputGUI('quest_pool_id'); $hiddenPoolId->setValue($sourcePool->getPoolId()); $this->addItem($hiddenPoolId); $nonEditablePoolLabel = new ilNonEditableValueGUI($this->lng->txt('tst_inp_source_pool_label'), 'quest_pool_label'); $nonEditablePoolLabel->setValue($sourcePool->getPoolInfoLabel($this->lng)); $this->addItem($nonEditablePoolLabel); if (count($availableTaxonomyIds)) { $taxRadio = new ilRadioGroupInputGUI($this->lng->txt('tst_inp_source_pool_filter_tax'), 'filter_tax'); $taxRadio->setRequired(true); $taxRadio->addOption(new ilRadioOption($this->lng->txt('tst_inp_source_pool_no_tax_filter'), 0)); $taxRadio->setValue(0); require_once 'Services/Taxonomy/classes/class.ilTaxSelectInputGUI.php'; foreach ($availableTaxonomyIds as $taxId) { $taxonomy = new ilObjTaxonomy($taxId); $label = sprintf($this->lng->txt('tst_inp_source_pool_filter_tax_x'), $taxonomy->getTitle()); $taxRadioOption = new ilRadioOption($label, $taxId); $taxRadio->addOption($taxRadioOption); $taxSelect = new ilTaxSelectInputGUI($taxId, "filter_tax_{$taxId}", false); $taxSelect->setRequired(true); $taxRadioOption->addSubItem($taxSelect); if ($taxId == $sourcePool->getOriginalFilterTaxId()) { $taxRadio->setValue($sourcePool->getOriginalFilterTaxId()); $taxSelect->setValue($sourcePool->getOriginalFilterTaxNodeId()); } } $this->addItem($taxRadio); } else { $hiddenNoTax = new ilHiddenInputGUI('filter_tax'); $hiddenNoTax->setValue(0); $this->addItem($hiddenNoTax); $nonEditableNoTax = new ilNonEditableValueGUI($this->lng->txt('tst_inp_source_pool_filter_tax'), 'no_tax_label'); $nonEditableNoTax->setValue($this->lng->txt('tst_inp_no_available_tax_hint')); $this->addItem($nonEditableNoTax); } if ($this->questionSetConfig->isQuestionAmountConfigurationModePerPool()) { $questionAmountPerSourcePool = new ilNumberInputGUI($this->lng->txt('tst_inp_quest_amount_per_source_pool'), 'question_amount_per_pool'); $questionAmountPerSourcePool->setRequired(true); $questionAmountPerSourcePool->allowDecimals(false); $questionAmountPerSourcePool->setMinValue(0); $questionAmountPerSourcePool->setMinvalueShouldBeGreater(true); $questionAmountPerSourcePool->setSize(4); if ($sourcePool->getQuestionAmount()) { $questionAmountPerSourcePool->setValue($sourcePool->getQuestionAmount()); } $this->addItem($questionAmountPerSourcePool); } }
/** * completes a given form object with the specific form properties * required by this question type * * (overwrites the method from ilAssMultiOptionQuestionFeedback, because of individual setting) * * @access public * @param ilPropertyFormGUI $form */ public function completeSpecificFormProperties(ilPropertyFormGUI $form) { $header = new ilFormSectionHeaderGUI(); $header->setTitle($this->lng->txt('feedback_answers')); $form->addItem($header); if (!$this->questionOBJ->getSelfAssessmentEditingMode()) { require_once './Services/Form/classes/class.ilRadioGroupInputGUI.php'; require_once './Services/Form/classes/class.ilRadioOption.php'; $feedback = new ilRadioGroupInputGUI($this->lng->txt('feedback_setting'), 'feedback_setting'); $feedback->addOption(new ilRadioOption($this->lng->txt('feedback_all'), 1), true); $feedback->addOption(new ilRadioOption($this->lng->txt('feedback_checked'), 2)); $feedback->addOption(new ilRadioOption($this->lng->txt('feedback_correct'), 3)); $form->addItem($feedback); foreach ($this->getAnswerOptionsByAnswerIndex() as $index => $answer) { $propertyLabel = $this->questionOBJ->prepareTextareaOutput($this->buildAnswerOptionLabel($index, $answer), true); $propertyPostVar = "feedback_answer_{$index}"; $form->addItem($this->buildFeedbackContentFormProperty($propertyLabel, $propertyPostVar, $this->questionOBJ->isAdditionalContentEditingModePageObject())); } } }
/** * @param ilRadioOption $option * @throws ilCloudPluginConfigException */ public function initPluginCreationFormSection(ilRadioOption $option) { $option->setInfo($this->txt("create_info1") . "</br>" . $this->txt("create_info2") . $this->getAdminConfigObject()->getAppName() . $this->txt("create_info3")); $sub_selection = new ilRadioGroupInputGUI($this->txt(self::F_BASE_FOLDER), "dropbox_base_folder"); $sub_selection->setRequired(true); $option_default = new ilRadioOption($this->txt("default_base_folder"), self::F_DROPBOX_DEFAULT_BASE_FOLDER); $option_custom = new ilRadioOption($this->txt("custom_base_folder"), self::F_DROPBOX_CUSTOM_FOLDER_SELECTION); $custom_base_folder_input = new ilTextInputGUI($this->txt("custom_base_folder_input"), self::F_DROPBOX_CUSTOM_BASE_FOLDER_INPUT); $custom_base_folder_input->setRequired(true); $custom_base_folder_input->setInfo($this->txt("custom_base_folder_input_info")); $option_custom->addSubItem($custom_base_folder_input); $sub_selection->addOption($option_default); $sub_selection->addOption($option_custom); $sub_selection->setValue(self::F_DROPBOX_DEFAULT_BASE_FOLDER); $option->addSubItem($sub_selection); $sub_selection2 = new ilCheckboxInputGUI($this->txt(self::F_ONLINE), self::F_ONLINE); if ($this->getAdminConfigObject()->getValue('config_default_online')) { $sub_selection2->setChecked(true); } $option->addSubItem($sub_selection2); }
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; }
protected function addCustomEditForm(ilPropertyFormGUI $a_form) { $radio_grp = new ilRadioGroupInputGUI($this->lng->txt('grp_visibility'), 'activation_type'); $radio_grp->setValue($this->object->getAvailabilityType()); $radio_grp->setDisabled(true); $radio_opt = new ilRadioOption($this->lng->txt('grp_visibility_unvisible'), ilObjRemoteTest::ACTIVATION_OFFLINE); $radio_grp->addOption($radio_opt); $radio_opt = new ilRadioOption($this->lng->txt('grp_visibility_limitless'), ilObjRemoteTest::ACTIVATION_UNLIMITED); $radio_grp->addOption($radio_opt); // :TODO: not supported in ECS yet $radio_opt = new ilRadioOption($this->lng->txt('grp_visibility_until'), ilObjRemoteTest::ACTIVATION_LIMITED); $start = new ilDateTimeInputGUI($this->lng->txt('grp_start'), 'start'); $start->setDate(new ilDateTime(time(), IL_CAL_UNIX)); $start->setDisabled(true); $start->setShowTime(true); $radio_opt->addSubItem($start); $end = new ilDateTimeInputGUI($this->lng->txt('grp_end'), 'end'); $end->setDate(new ilDateTime(time(), IL_CAL_UNIX)); $end->setDisabled(true); $end->setShowTime(true); $radio_opt->addSubItem($end); $radio_grp->addOption($radio_opt); $a_form->addItem($radio_grp); }
/** * 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; }
/** * 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; }
/** * Get layout option * * @return object layout form option */ static function getLayoutOption($a_txt, $a_var, $a_def_option = "") { global $lng; // default layout $layout = new ilRadioGroupInputGUI($a_txt, $a_var); if ($a_def_option != "") { if (is_file($im = ilUtil::getImagePath("layout_" . $a_def_option . ".png"))) { $im_tag = ilUtil::img($im, $a_def_option); } $layout->addOption(new ilRadioOption("<table><tr><td>" . $im_tag . "</td><td><b>" . $lng->txt("cont_lm_default_layout") . "</b>: " . $lng->txt("cont_layout_" . $a_def_option) . "</td></tr></table>", "")); } foreach (ilObjContentObject::getAvailableLayouts() as $l) { $im_tag = ""; if (is_file($im = ilUtil::getImagePath("layout_" . $l . ".png"))) { $im_tag = ilUtil::img($im, $l); } $layout->addOption(new ilRadioOption("<table><tr><td style='padding: 0px 5px 5px;'>" . $im_tag . "</td><td style='padding:5px;'><b>" . $lng->txt("cont_layout_" . $l) . "</b>: " . $lng->txt("cont_layout_" . $l . "_desc") . "</td></tr></table>", $l)); } return $layout; }
public function initForm($a_as_multi_assignment = FALSE) { include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; $form = new ilPropertyFormGUI(); $form->setTitle($this->lng->txt('crs_loc_tst_assignment')); $form->setFormAction($this->ctrl->getFormAction($this->getGUI())); if ($a_as_multi_assignment) { $form->addCommandButton('saveMultiTestAssignment', $this->lng->txt('save')); } else { $form->addCommandButton('saveTest', $this->lng->txt('save')); } switch ($this->getTestType()) { case ilLOSettings::TYPE_TEST_INITIAL: $form->setTitle($this->lng->txt('crs_loc_settings_itest_tbl')); break; case ilLOSettings::TYPE_TEST_QUALIFIED: $form->setTitle($this->lng->txt('crs_loc_settings_qtest_tbl')); break; } $assignable = $this->getAssignableTests(); $cr_mode = new ilRadioGroupInputGUI($this->lng->txt('crs_loc_form_assign_it'), 'mode'); $cr_mode->setRequired(true); $cr_mode->setValue(self::TEST_NEW); $new = new ilRadioOption($this->lng->txt('crs_loc_form_tst_new'), self::TEST_NEW); switch ($this->getTestType()) { case ilLOSettings::TYPE_TEST_INITIAL: $new->setInfo($this->lng->txt("crs_loc_form_tst_new_initial_info")); break; case ilLOSettings::TYPE_TEST_QUALIFIED: $new->setInfo($this->lng->txt("crs_loc_form_tst_new_qualified_info")); break; } // title $ti = new ilTextInputGUI($this->lng->txt("title"), "title"); $ti->setMaxLength(128); $ti->setSize(40); $ti->setRequired(true); $new->addSubItem($ti); // description $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc"); $ta->setCols(40); $ta->setRows(2); $new->addSubItem($ta); // Question assignment type include_once './Modules/Test/classes/class.ilObjTest.php'; $this->lng->loadLanguageModule('assessment'); $qst = new ilRadioGroupInputGUI($this->lng->txt('tst_question_set_type'), 'qtype'); $qst->setRequired(true); $random = new ilRadioOption($this->lng->txt('tst_question_set_type_random'), ilObjTest::QUESTION_SET_TYPE_RANDOM); $qst->addOption($random); $fixed = new ilRadioOption($this->lng->txt('tst_question_set_type_fixed'), ilObjTest::QUESTION_SET_TYPE_FIXED); $qst->addOption($fixed); $new->addSubItem($qst); $cr_mode->addOption($new); // assign existing $existing = new ilRadioOption($this->lng->txt('crs_loc_form_assign'), self::TEST_ASSIGN); switch ($this->getTestType()) { case ilLOSettings::TYPE_TEST_INITIAL: $existing->setInfo($this->lng->txt("crs_loc_form_assign_initial_info")); break; case ilLOSettings::TYPE_TEST_QUALIFIED: $existing->setInfo($this->lng->txt("crs_loc_form_assign_qualified_info")); break; } if (!$assignable) { $existing->setDisabled(true); } $cr_mode->addOption($existing); $options = array(); $options[''] = $this->lng->txt('select_one'); foreach ((array) $assignable as $tst_ref_id) { $tst_obj_id = ilObject::_lookupObjId($tst_ref_id); $options[$tst_ref_id] = ilObject::_lookupTitle($tst_obj_id); } $selectable = new ilSelectInputGUI($this->lng->txt('crs_loc_form_available_tsts'), 'tst'); $selectable->setRequired(true); $selectable->setOptions($options); $existing->addSubItem($selectable); $form->addItem($cr_mode); if ($a_as_multi_assignment) { include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignments.php'; $assignments = ilLOTestAssignments::getInstance($this->getContainer()->getId()); include_once './Modules/Course/classes/class.ilCourseObjective.php'; $objective_ids = ilCourseObjective::_getObjectiveIds($this->getContainer()->getId(), FALSE); $options = array(); $options[''] = $this->lng->txt('select_one'); foreach ($objective_ids as $oid) { $already_assigned_tst = $assignments->getTestByObjective($oid, $this->getTestType()); if (!$already_assigned_tst) { $options[$oid] = ilCourseObjective::lookupObjectiveTitle($oid); } } $objective = new ilSelectInputGUI($this->lng->txt('crs_objectives'), 'objective'); $objective->setRequired(TRUE); $objective->setOptions($options); $form->addItem($objective); } return $form; }
/** * FORM NewsItem: Init form. * * @param int $a_mode Form Edit Mode (IL_FORM_EDIT | IL_FORM_CREATE) */ public function initFormNewsItem($a_mode) { global $lng, $ilTabs; $ilTabs->clearTargets(); //$this->setTabs(); $lng->loadLanguageModule("news"); include "Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form_gui = new ilPropertyFormGUI(); // Property Title $text_input = new ilTextInputGUI($lng->txt("news_news_item_title"), "news_title"); $text_input->setInfo(""); $text_input->setRequired(true); $text_input->setMaxLength(200); $this->form_gui->addItem($text_input); // Property Content $text_area = new ilTextAreaInputGUI($lng->txt("news_news_item_content"), "news_content"); $text_area->setInfo(""); $text_area->setRequired(false); $this->form_gui->addItem($text_area); // Property Visibility $radio_group = new ilRadioGroupInputGUI($lng->txt("news_news_item_visibility"), "news_visibility"); $radio_option = new ilRadioOption($lng->txt("news_visibility_users"), "users"); $radio_group->addOption($radio_option); $radio_option = new ilRadioOption($lng->txt("news_visibility_public"), "public"); $radio_group->addOption($radio_option); $radio_group->setInfo($lng->txt("news_news_item_visibility_info")); $radio_group->setRequired(false); $radio_group->setValue("users"); $this->form_gui->addItem($radio_group); // Property ContentLong $text_area = new ilTextAreaInputGUI($lng->txt("news_news_item_content_long"), "news_content_long"); $text_area->setInfo($lng->txt("news_news_item_content_long_info")); $text_area->setRequired(false); $text_area->setCols("40"); $text_area->setRows("8"); $text_area->setUseRte(true); $this->form_gui->addItem($text_area); // save and cancel commands if (in_array($a_mode, array(IL_FORM_CREATE, IL_FORM_RE_CREATE))) { $this->form_gui->addCommandButton("saveNewsItem", $lng->txt("save")); $this->form_gui->addCommandButton("cancelSaveNewsItem", $lng->txt("cancel")); } else { $this->form_gui->addCommandButton("updateNewsItem", $lng->txt("save")); $this->form_gui->addCommandButton("cancelUpdateNewsItem", $lng->txt("cancel")); } $this->form_gui->setTitle($lng->txt("news_news_item_head")); $this->form_gui->setFormAction($this->ctrl->getFormAction($this)); $this->form_gui->setTitleIcon(ilUtil::getImagePath("icon_news.png")); $news_set = new ilSetting("news"); if (!$news_set->get("enable_rss_for_internal")) { $this->form_gui->removeItemByPostVar("news_visibility"); } else { $nv = $this->form_gui->getItemByPostVar("news_visibility"); if (is_object($nv)) { $nv->setValue(ilNewsItem::_getDefaultVisibilityForRefId($_GET["ref_id"])); } } }
/** * Process the language maintenance */ function maintainObject() { require_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this)); $form->setTitle($this->lng->txt("language_maintenance")); $form->setPreventDoubleSubmission(false); $form->addCommandButton('maintainExecute', $this->lng->txt("language_process_maintenance")); $rg = new ilRadioGroupInputGUI($this->lng->txt("language_maintain_local_changes"), "maintain"); $ro = new ilRadioOption($this->lng->txt("language_save_local_changes"), "save"); $ro->setInfo(sprintf($this->lng->txt("language_save_local_changes_info"), $this->object->key)); $rg->addOption($ro); $ro = new ilRadioOption($this->lng->txt("language_load_local_changes"), "load"); $ro->setInfo(sprintf($this->lng->txt("language_load_local_changes_info"), $this->object->key)); $rg->addOption($ro); $ro = new ilRadioOption($this->lng->txt("language_clear_local_changes"), "clear"); $ro->setInfo(sprintf($this->lng->txt("language_clear_local_changes_info"), $this->object->key)); $rg->addOption($ro); if ($this->langmode) { $ro = new ilRadioOption($this->lng->txt("language_delete_local_additions"), "delete_added"); $ro->setInfo(sprintf($this->lng->txt("language_delete_local_additions_info"), $this->object->key)); $rg->addOption($ro); $ro = new ilRadioOption($this->lng->txt("language_merge_local_changes"), "merge"); $ro->setInfo(sprintf($this->lng->txt("language_merge_local_changes_info"), $this->object->key)); $rg->addOption($ro); $ro = new ilRadioOption($this->lng->txt("language_remove_local_file"), "remove_local_file"); $ro->setInfo(sprintf($this->lng->txt("language_remove_local_file_info"), $this->object->key)); $rg->addOption($ro); } $rg->setValue($this->session["maintain"]); $form->addItem($rg); $this->tpl->setContent($form->getHTML()); }
/** * 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); }
/** * Edit resources form. */ 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_resources")); } else { $form->setTitle($this->lng->txt("cont_update_resources")); } // count number of existing objects per type and collect item groups $ref_id = (int) $_GET["ref_id"]; $childs = $this->rep_tree->getChilds($ref_id); $type_counts = array(); $item_groups = array(); foreach ($childs as $c) { $type_counts[$c["type"]] += 1; if ($c["type"] == "itgr") { $item_groups[$c["ref_id"]] = $c["title"]; } } if (count($item_groups) > 0) { // radio group for type selection $radg = new ilRadioGroupInputGUI($lng->txt("cont_resources"), "res_type"); if (!$a_insert && $this->content_obj->getMainType() == "ItemGroup") { $radg->setValue("itgr"); } else { $radg->setValue("by_type"); } $op_type = new ilRadioOption($lng->txt("cont_resources_of_type"), "by_type", ""); $radg->addOption($op_type); $op_itemgroup = new ilRadioOption($lng->txt("obj_itgr"), "itgr", ""); $radg->addOption($op_itemgroup); $form->addItem($radg); } // type selection $type_prop = new ilSelectInputGUI($this->lng->txt("cont_type"), "type"); $obj_id = ilObject::_lookupObjId($_GET["ref_id"]); $obj_type = ilObject::_lookupType($obj_id); $sub_objs = $objDefinition->getGroupedRepositoryObjectTypes($obj_type); $types = array(); foreach ($sub_objs as $k => $so) { if ($k != "itgr") { $types[$k] = $this->lng->txt("objs_" . $k) . " (" . (int) $type_counts[$k] . ")"; } } $type_prop->setOptions($types); $selected = $a_insert ? "" : $this->content_obj->getResourceListType(); $type_prop->setValue($selected); if (count($item_groups) > 0) { $op_type->addSubItem($type_prop); } else { $form->addItem($type_prop); } if (count($item_groups) > 0) { // item groups $options = $item_groups; $si = new ilSelectInputGUI($this->lng->txt("obj_itgr"), "itgr"); $si->setOptions($options); $selected = $a_insert ? "" : $this->content_obj->getItemGroupRefId(); $op_itemgroup->addSubItem($si); } // save/cancel buttons if ($a_insert) { $form->addCommandButton("create_resources", $lng->txt("save")); $form->addCommandButton("cancelCreate", $lng->txt("cancel")); } else { $form->addCommandButton("update_resources", $lng->txt("save")); $form->addCommandButton("cancelUpdate", $lng->txt("cancel")); } $html = $form->getHTML(); $tpl->setContent($html); return $ret; }
/** * Allows to add suggested solutions for questions * * @access public */ public function suggestedsolution() { global $ilUser; global $ilAccess; if ($_POST["deleteSuggestedSolution"] == 1) { $this->object->deleteSuggestedSolutions(); ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true); $this->ctrl->redirect($this, "suggestedsolution"); } $save = is_array($_POST["cmd"]) && array_key_exists("suggestedsolution", $_POST["cmd"]) ? TRUE : FALSE; $output = ""; $solution_array = $this->object->getSuggestedSolution(0); $options = array("lm" => $this->lng->txt("obj_lm"), "st" => $this->lng->txt("obj_st"), "pg" => $this->lng->txt("obj_pg"), "git" => $this->lng->txt("glossary_term"), "file" => $this->lng->txt("fileDownload"), "text" => $this->lng->txt("solutionText")); if (strcmp($_POST["solutiontype"], "file") == 0 && strcmp($solution_array["type"], "file") != 0) { $solution_array = array("type" => "file"); } elseif (strcmp($_POST["solutiontype"], "text") == 0 && strcmp($solution_array["type"], "text") != 0) { $solution_array = array("type" => "text", "value" => $this->getSolutionOutput(0, NULL, FALSE, FALSE, TRUE, FALSE, TRUE)); } if ($save && strlen($_POST["filename"])) { $solution_array["value"]["filename"] = $_POST["filename"]; } if ($save && strlen($_POST["solutiontext"])) { $solution_array["value"] = $_POST["solutiontext"]; } include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; if (count($solution_array)) { $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this)); $form->setTitle($this->lng->txt("solution_hint")); $form->setMultipart(TRUE); $form->setTableWidth("100%"); $form->setId("suggestedsolutiondisplay"); // suggested solution output include_once "./Modules/TestQuestionPool/classes/class.ilSolutionTitleInputGUI.php"; $title = new ilSolutionTitleInputGUI($this->lng->txt("showSuggestedSolution"), "solutiontype"); $template = new ilTemplate("tpl.il_as_qpl_suggested_solution_input_presentation.html", TRUE, TRUE, "Modules/TestQuestionPool"); if (strlen($solution_array["internal_link"])) { $href = assQuestion::_getInternalLinkHref($solution_array["internal_link"]); $template->setCurrentBlock("preview"); $template->setVariable("TEXT_SOLUTION", $this->lng->txt("suggested_solution")); $template->setVariable("VALUE_SOLUTION", " <a href=\"{$href}\" target=\"content\">" . $this->lng->txt("view") . "</a> "); $template->parseCurrentBlock(); } elseif (strcmp($solution_array["type"], "file") == 0 && is_array($solution_array["value"])) { $href = $this->object->getSuggestedSolutionPathWeb() . $solution_array["value"]["name"]; $template->setCurrentBlock("preview"); $template->setVariable("TEXT_SOLUTION", $this->lng->txt("suggested_solution")); $template->setVariable("VALUE_SOLUTION", " <a href=\"{$href}\" target=\"content\">" . ilUtil::prepareFormOutput(strlen($solution_array["value"]["filename"]) ? $solution_array["value"]["filename"] : $solution_array["value"]["name"]) . "</a> "); $template->parseCurrentBlock(); } $template->setVariable("TEXT_TYPE", $this->lng->txt("type")); $template->setVariable("VALUE_TYPE", $options[$solution_array["type"]]); $title->setHtml($template->get()); $deletesolution = new ilCheckboxInputGUI("", "deleteSuggestedSolution"); $deletesolution->setOptionTitle($this->lng->txt("deleteSuggestedSolution")); $title->addSubItem($deletesolution); $form->addItem($title); if (strcmp($solution_array["type"], "file") == 0) { // file $file = new ilFileInputGUI($this->lng->txt("fileDownload"), "file"); $file->setRequired(TRUE); $file->enableFileNameSelection("filename"); //$file->setSuffixes(array("doc","xls","png","jpg","gif","pdf")); if ($_FILES["file"]["tmp_name"] && $file->checkInput()) { if (!file_exists($this->object->getSuggestedSolutionPath())) { ilUtil::makeDirParents($this->object->getSuggestedSolutionPath()); } $res = ilUtil::moveUploadedFile($_FILES["file"]["tmp_name"], $_FILES["file"]["name"], $this->object->getSuggestedSolutionPath() . $_FILES["file"]["name"]); if ($res) { ilUtil::renameExecutables($this->object->getSuggestedSolutionPath()); // remove an old file download if (is_array($solution_array["value"])) { @unlink($this->object->getSuggestedSolutionPath() . $solution_array["value"]["name"]); } $file->setValue($_FILES["file"]["name"]); $this->object->saveSuggestedSolution("file", "", 0, array("name" => $_FILES["file"]["name"], "type" => $_FILES["file"]["type"], "size" => $_FILES["file"]["size"], "filename" => $_POST["filename"])); $originalexists = $this->object->_questionExistsInPool($this->object->original_id); if (($_GET["calling_test"] || isset($_GET['calling_consumer']) && (int) $_GET['calling_consumer']) && $originalexists && assQuestion::_isWriteable($this->object->original_id, $ilUser->getId())) { return $this->originalSyncForm("suggestedsolution"); } else { ilUtil::sendSuccess($this->lng->txt("suggested_solution_added_successfully"), TRUE); $this->ctrl->redirect($this, "suggestedsolution"); } } else { // BH: $res as info string? wtf? it holds a bool or something else!!? ilUtil::sendInfo($res); } } else { if (is_array($solution_array["value"])) { $file->setValue($solution_array["value"]["name"]); $file->setFilename(strlen($solution_array["value"]["filename"]) ? $solution_array["value"]["filename"] : $solution_array["value"]["name"]); } } $form->addItem($file); $hidden = new ilHiddenInputGUI("solutiontype"); $hidden->setValue("file"); $form->addItem($hidden); } else { if (strcmp($solution_array["type"], "text") == 0) { $question = new ilTextAreaInputGUI($this->lng->txt("solutionText"), "solutiontext"); $question->setValue($this->object->prepareTextareaOutput($solution_array["value"])); $question->setRequired(TRUE); $question->setRows(10); $question->setCols(80); $question->setUseRte(TRUE); $question->addPlugin("latex"); $question->addButton("latex"); $question->setRTESupport($this->object->getId(), "qpl", "assessment"); $hidden = new ilHiddenInputGUI("solutiontype"); $hidden->setValue("text"); $form->addItem($hidden); $form->addItem($question); } } if ($ilAccess->checkAccess("write", "", $_GET['ref_id'])) { $form->addCommandButton("suggestedsolution", $this->lng->txt("save")); } if ($save) { if ($form->checkInput()) { switch ($solution_array["type"]) { case "file": $this->object->saveSuggestedSolution("file", "", 0, array("name" => $solution_array["value"]["name"], "type" => $solution_array["value"]["type"], "size" => $solution_array["value"]["size"], "filename" => $_POST["filename"])); break; case "text": $this->object->saveSuggestedSolution("text", "", 0, $solution_array["value"]); break; } $originalexists = $this->object->_questionExistsInPool($this->object->original_id); if (($_GET["calling_test"] || isset($_GET['calling_consumer']) && (int) $_GET['calling_consumer']) && $originalexists && assQuestion::_isWriteable($this->object->original_id, $ilUser->getId())) { return $this->originalSyncForm("suggestedsolution"); } else { ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true); $this->ctrl->redirect($this, "suggestedsolution"); } } } $output = $form->getHTML(); } $savechange = strcmp($this->ctrl->getCmd(), "saveSuggestedSolution") == 0 ? TRUE : FALSE; $changeoutput = ""; if ($ilAccess->checkAccess("write", "", $_GET['ref_id'])) { $formchange = new ilPropertyFormGUI(); $formchange->setFormAction($this->ctrl->getFormAction($this)); $formchange->setTitle(count($solution_array) ? $this->lng->txt("changeSuggestedSolution") : $this->lng->txt("addSuggestedSolution")); $formchange->setMultipart(FALSE); $formchange->setTableWidth("100%"); $formchange->setId("suggestedsolution"); $solutiontype = new ilRadioGroupInputGUI($this->lng->txt("suggestedSolutionType"), "solutiontype"); foreach ($options as $opt_value => $opt_caption) { $solutiontype->addOption(new ilRadioOption($opt_caption, $opt_value)); } if (count($solution_array)) { $solutiontype->setValue($solution_array["type"]); } $solutiontype->setRequired(TRUE); $formchange->addItem($solutiontype); $formchange->addCommandButton("saveSuggestedSolution", $this->lng->txt("select")); if ($savechange) { $formchange->checkInput(); } $changeoutput = $formchange->getHTML(); } $this->tpl->setVariable("ADM_CONTENT", $changeoutput . $output); }
/** * init edit/create category form * * @access protected * @return */ protected function initFormCategory($a_mode) { global $rbacsystem, $ilUser; include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; include_once './Services/Calendar/classes/class.ilCalendarCategory.php'; include_once './Services/Calendar/classes/class.ilCalendarCategories.php'; $cat_info = ilCalendarCategories::_getInstance()->getCategoryInfo((int) $_GET['category_id']); $this->form = new ilPropertyFormGUI(); #$this->form->setTableWidth('40%'); switch ($a_mode) { case 'edit': $category = new ilCalendarCategory((int) $_GET['category_id']); $this->form->setTitle($this->lng->txt('cal_edit_category')); $this->ctrl->saveParameter($this, array('seed', 'category_id')); $this->form->setFormAction($this->ctrl->getFormAction($this)); if ($this->isEditable()) { $this->form->addCommandButton('update', $this->lng->txt('save')); /* if($cat_info['type'] == ilCalendarCategory::TYPE_USR) { $this->form->addCommandButton('shareSearch',$this->lng->txt('cal_share')); } $this->form->addCommandButton('confirmDelete',$this->lng->txt('delete')); */ $this->form->addCommandButton('manage', $this->lng->txt('cancel')); } break; case 'create': $this->editable = true; $category = new ilCalendarCategory(0); $this->ctrl->saveParameter($this, array('category_id')); $this->form->setFormAction($this->ctrl->getFormAction($this)); $this->form->setTitle($this->lng->txt('cal_add_category')); $this->form->addCommandButton('save', $this->lng->txt('save')); $this->form->addCommandButton('manage', $this->lng->txt('cancel')); break; } // Calendar name $title = new ilTextInputGUI($this->lng->txt('cal_calendar_name'), 'title'); if ($a_mode == 'edit') { $title->setDisabled(!$this->isEditable()); } $title->setRequired(true); $title->setMaxLength(64); $title->setSize(32); $title->setValue($category->getTitle()); $this->form->addItem($title); include_once './Services/Calendar/classes/class.ilCalendarSettings.php'; if ($a_mode == 'create' and $rbacsystem->checkAccess('edit_event', ilCalendarSettings::_getInstance()->getCalendarSettingsId())) { $type = new ilRadioGroupInputGUI($this->lng->txt('cal_cal_type'), 'type'); $type->setValue($category->getType()); $type->setRequired(true); $opt = new ilRadioOption($this->lng->txt('cal_type_personal'), ilCalendarCategory::TYPE_USR); $type->addOption($opt); $opt = new ilRadioOption($this->lng->txt('cal_type_system'), ilCalendarCategory::TYPE_GLOBAL); $type->addOption($opt); $type->setInfo($this->lng->txt('cal_type_info')); $this->form->addItem($type); } $color = new ilColorPickerInputGUI($this->lng->txt('cal_calendar_color'), 'color'); $color->setValue($category->getColor()); if (!$this->isEditable()) { $color->setDisabled(true); } $color->setRequired(true); $this->form->addItem($color); $location = new ilRadioGroupInputGUI($this->lng->txt('cal_type_rl'), 'type_rl'); $location->setDisabled($a_mode == 'edit'); $location_local = new ilRadioOption($this->lng->txt('cal_type_local'), ilCalendarCategory::LTYPE_LOCAL); $location->addOption($location_local); $location_remote = new ilRadioOption($this->lng->txt('cal_type_remote'), ilCalendarCategory::LTYPE_REMOTE); $location->addOption($location_remote); $location->setValue($category->getLocationType()); $url = new ilTextInputGUI($this->lng->txt('cal_remote_url'), 'remote_url'); $url->setDisabled($a_mode == 'edit'); $url->setValue($category->getRemoteUrl()); $url->setMaxLength(500); $url->setSize(60); $url->setRequired(true); $location_remote->addSubItem($url); $user = new ilTextInputGUI($this->lng->txt('username'), 'remote_user'); $user->setDisabled($a_mode == 'edit'); $user->setValue($category->getRemoteUser()); $user->setMaxLength(50); $user->setSize(20); $user->setRequired(false); $location_remote->addSubItem($user); $pass = new ilPasswordInputGUI($this->lng->txt('password'), 'remote_pass'); $pass->setDisabled($a_mode == 'edit'); $pass->setValue($category->getRemotePass()); $pass->setMaxLength(50); $pass->setSize(20); $pass->setRetype(false); $pass->setInfo($this->lng->txt('remote_pass_info')); $location_remote->addSubItem($pass); $this->form->addItem($location); }
public function 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()); }
/** * initEditCustomForm * * @param string $a_mode values: create | edit */ public function initForm($a_mode = "create") { global $ilCtrl, $lng; include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form = new ilPropertyFormGUI(); if ($a_mode == "edit") { $this->form->setTitle($lng->txt('dcl_edit_field')); $hidden_prop = new ilHiddenInputGUI("field_id"); $this->form->addItem($hidden_prop); $this->form->setFormAction($ilCtrl->getFormAction($this), "update"); $this->form->addCommandButton('update', $lng->txt('dcl_update_field')); } else { $this->form->setTitle($lng->txt('dcl_new_field')); $hidden_prop = new ilHiddenInputGUI("table_id"); $hidden_prop->setValue($this->field_obj->getTableId()); $this->form->addItem($hidden_prop); $this->form->setFormAction($ilCtrl->getFormAction($this), "save"); $this->form->addCommandButton('save', $lng->txt('dcl_create_field')); } $this->form->addCommandButton('cancel', $lng->txt('cancel')); $text_prop = new ilTextInputGUI($lng->txt("title"), "title"); $text_prop->setRequired(true); $text_prop->setValidationRegexp("/^[a-zA-Z\\d -.,äöüÄÖÜàéèÀÉÈç¢]*\$/i"); $this->form->addItem($text_prop); $edit_datatype = new ilRadioGroupInputGUI($lng->txt('dcl_datatype'), 'datatype'); foreach (ilDataCollectionDatatype::getAllDatatypes() as $datatype) { $opt = new ilRadioOption($lng->txt('dcl_' . $datatype['title']), $datatype['id']); foreach (ilDataCollectionDatatype::getProperties($datatype['id']) as $property) { //Type Reference: List Tabels if ($datatype['id'] == ilDataCollectionDatatype::INPUTFORMAT_REFERENCE and $property['id'] == ilDataCollectionField::PROPERTYID_REFERENCE) { // Get Tables require_once "./Modules/DataCollection/classes/class.ilDataCollectionTable.php"; $tables = $this->parent_obj->getDataCollectionObject()->getTables(); foreach ($tables as $table) { foreach ($table->getRecordFields() as $field) { //referencing references may lead to endless loops. if ($field->getDatatypeId() != ilDataCollectionDatatype::INPUTFORMAT_REFERENCE) { $options[$field->getId()] = $table->getTitle() . "->" . $field->getTitle(); } } } $table_selection = new ilSelectInputGUI('', 'prop_' . $property['id']); $table_selection->setOptions($options); //$table_selection->setValue($this->table_id); $opt->addSubItem($table_selection); } elseif ($property['datatype_id'] == $datatype['id']) { if ($property['inputformat'] == ilDataCollectionDatatype::INPUTFORMAT_BOOLEAN) { $subitem = new ilCheckboxInputGUI($lng->txt('dcl_' . $property['title']), 'prop_' . $property['id']); $opt->addSubItem($subitem); } else { $subitem = new ilTextInputGUI($lng->txt('dcl_' . $property['title']), 'prop_' . $property['id']); $opt->addSubItem($subitem); } } } $edit_datatype->addOption($opt); } $edit_datatype->setRequired(true); //you can't change type but we still need it in POST if ($a_mode == "edit") { $edit_datatype->setDisabled(true); } $this->form->addItem($edit_datatype); // Description $text_prop = new ilTextAreaInputGUI($lng->txt("dcl_field_description"), "description"); $this->form->addItem($text_prop); // Required $cb = new ilCheckboxInputGUI($lng->txt("dcl_field_required"), "required"); $this->form->addItem($cb); //Unique $cb = new ilCheckboxInputGUI($lng->txt("dcl_unique"), "unique"); $this->form->addItem($cb); }
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; }
/** * Insert new question form */ function insert($a_mode = "create") { global $ilUser, $lng, $ilCtrl; $this->setInsertTabs("new_question"); $this->displayValidationError(); // get all question types (@todo: we have to check, whether they are // suitable for self assessment or not) include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php"; $all_types = ilObjQuestionPool::_getSelfAssessmentQuestionTypes(); $options = array(); $all_types = ilUtil::sortArray($all_types, "order", "asc", true, true); foreach ($all_types as $k => $v) { $options[$v["type_tag"]] = $k; } // new table form (input of rows and columns) include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form_gui = new ilPropertyFormGUI(); $this->form_gui->setFormAction($ilCtrl->getFormAction($this)); $this->form_gui->setTitle($lng->txt("cont_ed_insert_pcqst")); // Select Question Type $qtype_input = new ilSelectInputGUI($lng->txt("cont_question_type"), "q_type"); $qtype_input->setOptions($options); $qtype_input->setRequired(true); $this->form_gui->addItem($qtype_input); // additional content editor // assessment include_once "./Modules/Test/classes/class.ilObjAssessmentFolder.php"; if (ilObjAssessmentFolder::isAdditionalQuestionContentEditingModePageObjectEnabled()) { $ri = new ilRadioGroupInputGUI($this->lng->txt("tst_add_quest_cont_edit_mode"), "add_quest_cont_edit_mode"); $ri->addOption(new ilRadioOption($this->lng->txt('tst_add_quest_cont_edit_mode_default'), assQuestion::ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT)); $ri->addOption(new ilRadioOption($this->lng->txt('tst_add_quest_cont_edit_mode_page_object'), assQuestion::ADDITIONAL_CONTENT_EDITING_MODE_PAGE_OBJECT)); $ri->setValue(assQuestion::ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT); $this->form_gui->addItem($ri, true); } else { $hi = new ilHiddenInputGUI("question_content_editing_type"); $hi->setValue(assQuestion::ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT); $this->form_gui->addItem($hi, true); } // Select Question Pool /* include_once("./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php"); $qpools = ilObjQuestionPool::_getAvailableQuestionpools(false, false, false, true, false, "write"); if (count($qpools) > 0) { $pool_options = array(); foreach ($qpools as $key => $value) { $pool_options[$key] = $value["title"]; } $pool_input = new ilSelectInputGUI($lng->txt("cont_question_pool"), "qpool_ref_id"); $pool_input->setOptions($pool_options); $pool_input->setRequired(true); $this->form_gui->addItem($pool_input); } else { $pool_input = new ilTextInputGUI($lng->txt("cont_question_pool"), "qpool_title"); $pool_input->setRequired(true); $this->form_gui->addItem($pool_input); } */ if ($a_mode == "edit_empty") { $this->form_gui->addCommandButton("edit", $lng->txt("save")); } else { $this->form_gui->addCommandButton("create_pcqst", $lng->txt("save")); $this->form_gui->addCommandButton("cancelCreate", $lng->txt("cancel")); } $this->tpl->setContent($this->form_gui->getHTML()); }
/** * init general settings form * @return */ protected function initFormGeneralSettings() { global $ilSetting; $this->setSubTabs('settings'); $this->tabs_gui->setTabActive('settings'); $this->tabs_gui->setSubTabActive('general_settings'); include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form = new ilPropertyFormGUI(); $this->form->setFormAction($this->ctrl->getFormAction($this, 'saveGeneralSettings')); $this->form->setTitle($this->lng->txt('general_settings')); $lua = new ilCheckboxInputGUI($this->lng->txt('enable_local_user_administration'), 'lua'); $lua->setInfo($this->lng->txt('enable_local_user_administration_info')); $lua->setValue(1); $this->form->addItem($lua); $lrua = new ilCheckboxInputGUI($this->lng->txt('restrict_user_access'), 'lrua'); $lrua->setInfo($this->lng->txt('restrict_user_access_info')); $lrua->setValue(1); $this->form->addItem($lrua); // enable alphabetical navigation in user administration $alph = new ilCheckboxInputGUI($this->lng->txt('user_adm_enable_alpha_nav'), 'user_adm_alpha_nav'); //$alph->setInfo($this->lng->txt('restrict_user_access_info')); $alph->setValue(1); $this->form->addItem($alph); // account codes $code = new ilCheckboxInputGUI($this->lng->txt("user_account_code_setting"), "user_reactivate_code"); $code->setInfo($this->lng->txt('user_account_code_setting_info')); $this->form->addItem($code); // delete own account $own = new ilCheckboxInputGUI($this->lng->txt("user_allow_delete_own_account"), "user_own_account"); $this->form->addItem($own); $own_email = new ilEMailInputGUI($this->lng->txt("user_delete_own_account_notification_email"), "user_own_account_email"); $own->addSubItem($own_email); // BEGIN SESSION SETTINGS // create session handling radio group $ssettings = new ilRadioGroupInputGUI($this->lng->txt('sess_mode'), 'session_handling_type'); // first option, fixed session duration $fixed = new ilRadioOption($this->lng->txt('sess_fixed_duration'), ilSession::SESSION_HANDLING_FIXED); // create session reminder subform $cb = new ilCheckboxInputGUI($this->lng->txt("session_reminder"), "session_reminder_enabled"); $expires = ilSession::getSessionExpireValue(); $time = ilFormat::_secondsToString($expires, true); $cb->setInfo($this->lng->txt("session_reminder_info") . "<br />" . sprintf($this->lng->txt('session_reminder_session_duration'), $time)); $fixed->addSubItem($cb); // add session handling to radio group $ssettings->addOption($fixed); // second option, session control $ldsh = new ilRadioOption($this->lng->txt('sess_load_dependent_session_handling'), ilSession::SESSION_HANDLING_LOAD_DEPENDENT); // add session control subform require_once 'Services/Authentication/classes/class.ilSessionControl.php'; // this is the max count of active sessions // that are getting started simlutanously $sub_ti = new ilTextInputGUI($this->lng->txt('session_max_count'), 'session_max_count'); $sub_ti->setMaxLength(5); $sub_ti->setSize(5); $sub_ti->setInfo($this->lng->txt('session_max_count_info')); if (!$ilSetting->get('session_allow_client_maintenance', ilSessionControl::DEFAULT_ALLOW_CLIENT_MAINTENANCE)) { $sub_ti->setDisabled(true); } $ldsh->addSubItem($sub_ti); // after this (min) idle time the session can be deleted, // if there are further requests for new sessions, // but max session count is reached yet $sub_ti = new ilTextInputGUI($this->lng->txt('session_min_idle'), 'session_min_idle'); $sub_ti->setMaxLength(5); $sub_ti->setSize(5); $sub_ti->setInfo($this->lng->txt('session_min_idle_info')); if (!$ilSetting->get('session_allow_client_maintenance', ilSessionControl::DEFAULT_ALLOW_CLIENT_MAINTENANCE)) { $sub_ti->setDisabled(true); } $ldsh->addSubItem($sub_ti); // after this (max) idle timeout the session expires // and become invalid, so it is not considered anymore // when calculating current count of active sessions $sub_ti = new ilTextInputGUI($this->lng->txt('session_max_idle'), 'session_max_idle'); $sub_ti->setMaxLength(5); $sub_ti->setSize(5); $sub_ti->setInfo($this->lng->txt('session_max_idle_info')); if (!$ilSetting->get('session_allow_client_maintenance', ilSessionControl::DEFAULT_ALLOW_CLIENT_MAINTENANCE)) { $sub_ti->setDisabled(true); } $ldsh->addSubItem($sub_ti); // this is the max duration that can elapse between the first and the secnd // request to the system before the session is immidietly deleted $sub_ti = new ilTextInputGUI($this->lng->txt('session_max_idle_after_first_request'), 'session_max_idle_after_first_request'); $sub_ti->setMaxLength(5); $sub_ti->setSize(5); $sub_ti->setInfo($this->lng->txt('session_max_idle_after_first_request_info')); if (!$ilSetting->get('session_allow_client_maintenance', ilSessionControl::DEFAULT_ALLOW_CLIENT_MAINTENANCE)) { $sub_ti->setDisabled(true); } $ldsh->addSubItem($sub_ti); // add session control to radio group $ssettings->addOption($ldsh); // add radio group to form if ($ilSetting->get('session_allow_client_maintenance', ilSessionControl::DEFAULT_ALLOW_CLIENT_MAINTENANCE)) { // just shows the status wether the session //setting maintenance is allowed by setup $this->form->addItem($ssettings); } else { // just shows the status wether the session //setting maintenance is allowed by setup $ti = new ilNonEditableValueGUI($this->lng->txt('session_config'), "session_config"); $ti->setValue($this->lng->txt('session_config_maintenance_disabled')); $ssettings->setDisabled(true); $ti->addSubItem($ssettings); $this->form->addItem($ti); } // END SESSION SETTINGS $this->lng->loadLanguageModule('ps'); $pass = new ilFormSectionHeaderGUI(); $pass->setTitle($this->lng->txt('ps_password_settings')); $this->form->addItem($pass); // password generation $cb = new ilCheckboxInputGUI($this->lng->txt("passwd_generation"), "passwd_auto_generate"); $cb->setChecked($ilSetting->get("passwd_auto_generate")); $cb->setInfo($this->lng->txt("passwd_generation_info")); $this->form->addItem($cb); $check = new ilCheckboxInputGUI($this->lng->txt('ps_password_change_on_first_login_enabled'), 'password_change_on_first_login_enabled'); $check->setInfo($this->lng->txt('ps_password_change_on_first_login_enabled_info')); $this->form->addItem($check); include_once './Services/PrivacySecurity/classes/class.ilSecuritySettings.php'; $check = new ilCheckboxInputGUI($this->lng->txt('ps_password_must_not_contain_loginame'), 'password_must_not_contain_loginame'); $check->setInfo($this->lng->txt('ps_password_must_not_contain_loginame_info')); $this->form->addItem($check); $check = new ilCheckboxInputGUI($this->lng->txt('ps_password_chars_and_numbers_enabled'), 'password_chars_and_numbers_enabled'); //$check->setOptionTitle($this->lng->txt('ps_password_chars_and_numbers_enabled')); $check->setInfo($this->lng->txt('ps_password_chars_and_numbers_enabled_info')); $this->form->addItem($check); $check = new ilCheckboxInputGUI($this->lng->txt('ps_password_special_chars_enabled'), 'password_special_chars_enabled'); //$check->setOptionTitle($this->lng->txt('ps_password_special_chars_enabled')); $check->setInfo($this->lng->txt('ps_password_special_chars_enabled_info')); $this->form->addItem($check); $text = new ilNumberInputGUI($this->lng->txt('ps_password_min_length'), 'password_min_length'); $text->setInfo($this->lng->txt('ps_password_min_length_info')); $text->setSize(1); $text->setMaxLength(2); $this->form->addItem($text); $text = new ilNumberInputGUI($this->lng->txt('ps_password_max_length'), 'password_max_length'); $text->setInfo($this->lng->txt('ps_password_max_length_info')); $text->setSize(2); $text->setMaxLength(3); $this->form->addItem($text); $text = new ilNumberInputGUI($this->lng->txt('ps_password_uppercase_chars_num'), 'password_ucase_chars_num'); $text->setInfo($this->lng->txt('ps_password_uppercase_chars_num_info')); $text->setMinValue(0); $text->setSize(2); $text->setMaxLength(3); $this->form->addItem($text); $text = new ilNumberInputGUI($this->lng->txt('ps_password_lowercase_chars_num'), 'password_lowercase_chars_num'); $text->setInfo($this->lng->txt('ps_password_lowercase_chars_num_info')); $text->setMinValue(0); $text->setSize(2); $text->setMaxLength(3); $this->form->addItem($text); $text = new ilNumberInputGUI($this->lng->txt('ps_password_max_age'), 'password_max_age'); $text->setInfo($this->lng->txt('ps_password_max_age_info')); $text->setSize(2); $text->setMaxLength(3); $this->form->addItem($text); // password assistance $cb = new ilCheckboxInputGUI($this->lng->txt("enable_password_assistance"), "password_assistance"); $cb->setInfo($this->lng->txt("password_assistance_info")); $this->form->addItem($cb); $pass = new ilFormSectionHeaderGUI(); $pass->setTitle($this->lng->txt('ps_security_protection')); $this->form->addItem($pass); $text = new ilNumberInputGUI($this->lng->txt('ps_login_max_attempts'), 'login_max_attempts'); $text->setInfo($this->lng->txt('ps_login_max_attempts_info')); $text->setSize(1); $text->setMaxLength(2); $this->form->addItem($text); // prevent login from multiple pcs at the same time $objCb = new ilCheckboxInputGUI($this->lng->txt('ps_prevent_simultaneous_logins'), 'ps_prevent_simultaneous_logins'); $objCb->setValue(1); $objCb->setInfo($this->lng->txt('ps_prevent_simultaneous_logins_info')); $this->form->addItem($objCb); $log = new ilFormSectionHeaderGUI(); $log->setTitle($this->lng->txt('loginname_settings')); $this->form->addItem($log); $chbChangeLogin = new ilCheckboxInputGUI($this->lng->txt('allow_change_loginname'), 'allow_change_loginname'); $chbChangeLogin->setValue(1); $this->form->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->form->addCommandButton('saveGeneralSettings', $this->lng->txt('save')); }
public function adoptTeamAssignmentsFormObject() { global $ilCtrl, $ilTabs, $lng, $tpl; $this->checkPermission("write"); if (!$this->ass) { $ilCtrl->redirect($this, "listAssignments"); } $ilTabs->activateTab("content"); $this->addContentSubTabs("list_assignments"); include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setTitle($lng->txt("exc_team_assignment_adopt")); $form->setFormAction($ilCtrl->getFormAction($this, "adoptTeamAssignments")); $options = ilExAssignment::getAdoptableTeamAssignments($this->ass->getExerciseId()); // we must not have existing teams in assignment if (array_key_exists($this->ass->getId(), $options)) { $ilCtrl->redirect($this, "listAssignments"); } $teams = new ilRadioGroupInputGUI($lng->txt("exc_assignment"), "ass_adpt"); $teams->setValue(-1); $teams->addOption(new ilRadioOption($lng->txt("exc_team_assignment_adopt_none"), -1)); foreach ($options as $id => $item) { $option = new ilRadioOption($item["title"], $id); $option->setInfo($lng->txt("exc_team_assignment_adopt_teams") . ": " . $item["teams"]); $teams->addOption($option); } $form->addItem($teams); $form->addCommandButton("adoptTeamAssignments", $lng->txt("save")); $form->addCommandButton("listAssignments", $lng->txt("cancel")); $tpl->setContent($form->getHTML()); }
/** * Init category mapping form * @return */ protected function initCategoryMappingForm($a_mode = 'add') { global $ilDB; if (is_object($this->form)) { return true; } include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; include_once './Services/WebServices/ECS/classes/class.ilECSCategoryMappingRule.php'; $this->form = new ilPropertyFormGUI(); if ($a_mode == 'add') { $this->form->setTitle($this->lng->txt('ecs_new_category_mapping')); $this->form->setFormAction($this->ctrl->getFormAction($this, 'categoryMapping')); $this->form->addCommandButton('addCategoryMapping', $this->lng->txt('save')); $this->form->addCommandButton('categoryMapping', $this->lng->txt('cancel')); } else { $this->form->setTitle($this->lng->txt('ecs_edit_category_mapping')); $this->form->setFormAction($this->ctrl->getFormAction($this, 'editCategoryMapping')); $this->form->addCommandButton('updateCategoryMapping', $this->lng->txt('save')); $this->form->addCommandButton('categoryMapping', $this->lng->txt('cancel')); } $imp = new ilCustomInputGUI($this->lng->txt('ecs_import_id'), 'import_id'); $imp->setRequired(true); $tpl = new ilTemplate('tpl.ecs_import_id_form.html', true, true, 'Services/WebServices/ECS'); $tpl->setVariable('SIZE', 5); $tpl->setVariable('MAXLENGTH', 11); $tpl->setVariable('POST_VAR', 'import_id'); $tpl->setVariable('PROPERTY_VALUE', $this->rule->getContainerId()); if ($this->settings->getImportId()) { $tpl->setVariable('COMPLETE_PATH', $this->buildPath($this->rule->getContainerId())); } $imp->setHTML($tpl->get()); $imp->setInfo($this->lng->txt('ecs_import_id_info')); $this->form->addItem($imp); include_once './Services/WebServices/ECS/classes/class.ilECSCategoryMapping.php'; $select = new ilSelectInputGUI($this->lng->txt('ecs_attribute_name'), 'field'); $select->setValue($this->rule->getFieldName()); $select->setRequired(true); $select->setOptions(ilECSCategoryMapping::getPossibleFields()); $this->form->addItem($select); // Value $value = new ilRadioGroupInputGUI($this->lng->txt('ecs_cat_mapping_type'), 'type'); $value->setValue($this->rule->getMappingType()); $value->setRequired(true); $fixed = new ilRadioOption($this->lng->txt('ecs_cat_mapping_fixed'), ilECSCategoryMappingRule::TYPE_FIXED); $fixed->setInfo($this->lng->txt('ecs_cat_mapping_fixed_info')); $fixed_val = new ilTextInputGUI($this->lng->txt('ecs_cat_mapping_values'), 'mapping_value'); $fixed_val->setValue($this->rule->getMappingValue()); $fixed_val->setMaxLength(255); $fixed_val->setSize(40); $fixed_val->setRequired(true); $fixed->addSubItem($fixed_val); $value->addOption($fixed); $duration = new ilRadioOption($this->lng->txt('ecs_cat_mapping_duration'), ilECSCategoryMappingRule::TYPE_DURATION); $duration->setInfo($this->lng->txt('ecs_cat_mapping_duration_info')); $dur_start = new ilDateTimeInputGUI($this->lng->txt('from'), 'dur_begin'); $dur_start->setDate($this->rule->getDateRangeStart()); $duration->addSubItem($dur_start); $dur_end = new ilDateTimeInputGUI($this->lng->txt('to'), 'dur_end'); $dur_end->setDate($this->rule->getDateRangeEnd()); $duration->addSubItem($dur_end); $value->addOption($duration); $type = new ilRadioOption($this->lng->txt('ecs_cat_mapping_by_type'), ilECSCategoryMappingRule::TYPE_BY_TYPE); $type->setInfo($this->lng->txt('ecs_cat_mapping_by_type_info')); $options = ilECSUtils::getPossibleRemoteTypes(true); $types = new ilSelectInputGUI($this->lng->txt('type'), 'by_type'); $types->setOptions($options); $types->setValue($this->rule->getByType()); $types->setRequired(true); $type->addSubitem($types); $value->addOption($type); $this->form->addItem($value); }