/** * Init property form * * @return ilPropertyFormGUI $form */ protected function initFormSettings() { include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; $form = new ilPropertyFormGUI(); $form->setTitle($this->lng->txt('tracking_settings')); $form->setFormAction($this->ctrl->getFormAction($this)); // Mode $mod = new ilRadioGroupInputGUI($this->lng->txt('trac_mode'), 'modus'); $mod->setRequired(true); $mod->setValue($this->obj_lp->getCurrentMode()); $form->addItem($mod); foreach ($this->obj_lp->getValidModes() as $mode_key) { $opt = new ilRadioOption($this->obj_lp->getModeText($mode_key), $mode_key, $this->obj_lp->getModeInfoText($mode_key)); $opt->setValue($mode_key); $mod->addOption($opt); // :TODO: Subitem for visits ?! if ($mode_key == ilLPObjSettings::LP_MODE_VISITS) { $vis = new ilNumberInputGUI($this->lng->txt('trac_visits'), 'visits'); $vis->setSize(3); $vis->setMaxLength(4); $vis->setInfo(sprintf($this->lng->txt('trac_visits_info'), ilObjUserTracking::_getValidTimeSpan())); $vis->setRequired(true); $vis->setValue($this->obj_settings->getVisits()); $opt->addSubItem($vis); } } $form->addCommandButton('saveSettings', $this->lng->txt('save')); return $form; }
public function 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); }
/** * 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); }
/** * 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; }
/** * add the configuration elements to a property form * @param object property form */ public function addFormProperties(ilPropertyFormGUI $a_form) { global $lng; $lng->loadLanguageModule('adve'); $availability = new ilRadioGroupInputGUI($lng->txt('char_selector'), 'char_selector_availability'); $inactive = new ilRadioOption($lng->txt('char_selector_inactive'), ilCharSelectorConfig::INACTIVE); $inactive->setInfo($lng->txt('char_selector_inactive_info_' . $this->config->getContext())); $inherit = new ilRadioOption($lng->txt('char_selector_inherit'), ilCharSelectorConfig::INHERIT); $inherit->setInfo($lng->txt('char_selector_inherit_info_' . $this->config->getContext())); $enabled = new ilRadioOption($lng->txt('char_selector_enabled'), ilCharSelectorConfig::ENABLED); $enabled->setInfo($lng->txt('char_selector_enabled_info_' . $this->config->getContext())); $disabled = new ilRadioOption($lng->txt('char_selector_disabled'), ilCharSelectorConfig::DISABLED); $disabled->setInfo($lng->txt('char_selector_disabled_info_' . $this->config->getContext())); $blocks = new ilSelectInputGUI($lng->txt('char_selector_blocks'), 'char_selector_blocks'); $blocks->setInfo($lng->txt('char_selector_blocks_info')); $blocks->setOptions($this->config->getBlockOptions()); $blocks->setMulti(true); $enabled->addSubItem($blocks); $custom_items = new ilTextAreaInputGUI($lng->txt('char_selector_custom_items'), 'char_selector_custom_items'); $tpl = new ilTemplate("tpl.char_selector_custom_info.html", true, true, "Services/UIComponent/CharSelector"); $tpl->setVariable('1', $lng->txt('char_selector_custom_items_info1')); $tpl->setVariable('2a', $lng->txt('char_selector_custom_items_info2a')); $tpl->setVariable('2b', $lng->txt('char_selector_custom_items_info2b')); $tpl->setVariable('3a', $lng->txt('char_selector_custom_items_info3a')); $tpl->setVariable('3b', $lng->txt('char_selector_custom_items_info3b')); $tpl->setVariable('4a', $lng->txt('char_selector_custom_items_info4a')); $tpl->setVariable('4b', $lng->txt('char_selector_custom_items_info4b')); $tpl->setVariable('5a', $lng->txt('char_selector_custom_items_info5a')); $tpl->setVariable('5b', $lng->txt('char_selector_custom_items_info5b')); $tpl->setVariable('6a', $lng->txt('char_selector_custom_items_info6a')); $tpl->setVariable('6b', $lng->txt('char_selector_custom_items_info6b')); $custom_items->setInfo($tpl->get()); $enabled->addSubItem($custom_items); switch ($this->config->getContext()) { case ilCharSelectorConfig::CONTEXT_ADMIN: $availability->addOption($inactive); $availability->addOption($enabled); $availability->addOption($disabled); $a_form->addItem($availability); break; case ilCharSelectorConfig::CONTEXT_USER: case ilCharSelectorConfig::CONTEXT_TEST: $availability->addOption($inherit); $availability->addOption($enabled); $availability->addOption($disabled); $a_form->addItem($availability); break; } }
/** * @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); }
/** * @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); }
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); }
/** * Init survey settings form * * @return ilPropertyFormGUI */ function initPropertiesForm() { $template_settings = $hide_rte_switch = null; $template = $this->object->getTemplate(); if ($template) { include_once "Services/Administration/classes/class.ilSettingsTemplate.php"; $template = new ilSettingsTemplate($template); $template_settings = $template->getSettings(); $hide_rte_switch = $template_settings["rte_switch"]["hide"]; } include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this)); $form->setTableWidth("100%"); $form->setId("survey_properties"); // general properties $header = new ilFormSectionHeaderGUI(); $header->setTitle($this->lng->txt("settings")); $form->addItem($header); // title & description (meta data) include_once 'Services/MetaData/classes/class.ilMD.php'; $md_obj = new ilMD($this->object->getId(), 0, "svy"); $md_section = $md_obj->getGeneral(); $title = new ilTextInputGUI($this->lng->txt("title"), "title"); $title->setRequired(true); $title->setValue($md_section->getTitle()); $form->addItem($title); $ids = $md_section->getDescriptionIds(); if ($ids) { $desc_obj = $md_section->getDescription(array_pop($ids)); $desc = new ilTextAreaInputGUI($this->lng->txt("description"), "description"); $desc->setCols(50); $desc->setRows(4); $desc->setValue($desc_obj->getDescription()); $form->addItem($desc); } // pool usage $pool_usage = new ilRadioGroupInputGUI($this->lng->txt("survey_question_pool_usage"), "use_pool"); $opt = new ilRadioOption($this->lng->txt("survey_question_pool_usage_active"), 1); $opt->setInfo($this->lng->txt("survey_question_pool_usage_active_info")); $pool_usage->addOption($opt); $opt = new ilRadioOption($this->lng->txt("survey_question_pool_usage_inactive"), 0); $opt->setInfo($this->lng->txt("survey_question_pool_usage_inactive_info")); $pool_usage->addOption($opt); $pool_usage->setValue($this->object->getPoolUsage()); $form->addItem($pool_usage); // 360°: appraisees if ($this->object->get360Mode()) { $self_eval = new ilCheckboxInputGUI($this->lng->txt("survey_360_self_evaluation"), "self_eval"); $self_eval->setInfo($this->lng->txt("survey_360_self_evaluation_info")); $self_eval->setChecked($this->object->get360SelfEvaluation()); $form->addItem($self_eval); $self_rate = new ilCheckboxInputGUI($this->lng->txt("survey_360_self_raters"), "self_rate"); $self_rate->setInfo($this->lng->txt("survey_360_self_raters_info")); $self_rate->setChecked($this->object->get360SelfRaters()); $form->addItem($self_rate); $self_appr = new ilCheckboxInputGUI($this->lng->txt("survey_360_self_appraisee"), "self_appr"); $self_appr->setInfo($this->lng->txt("survey_360_self_appraisee_info")); $self_appr->setChecked($this->object->get360SelfAppraisee()); $form->addItem($self_appr); } // activation include_once "Services/Object/classes/class.ilObjectActivation.php"; $this->lng->loadLanguageModule('rep'); $section = new ilFormSectionHeaderGUI(); $section->setTitle($this->lng->txt('rep_activation_availability')); $form->addItem($section); // additional info only with multiple references $act_obj_info = $act_ref_info = ""; if (sizeof(ilObject::_getAllReferences($this->object->getId())) > 1) { $act_obj_info = ' ' . $this->lng->txt('rep_activation_online_object_info'); $act_ref_info = $this->lng->txt('rep_activation_access_ref_info'); } $online = new ilCheckboxInputGUI($this->lng->txt('rep_activation_online'), 'online'); $online->setInfo($this->lng->txt('svy_activation_online_info') . $act_obj_info); $online->setChecked($this->object->isOnline()); $form->addItem($online); $act_type = new ilCheckboxInputGUI($this->lng->txt('rep_visibility_until'), 'access_type'); // $act_type->setInfo($this->lng->txt('svy_availability_until_info')); $act_type->setChecked($this->object->isActivationLimited()); $this->tpl->addJavaScript('./Services/Form/js/date_duration.js'); include_once "Services/Form/classes/class.ilDateDurationInputGUI.php"; $dur = new ilDateDurationInputGUI($this->lng->txt('rep_time_period'), "access_period"); $dur->setShowTime(true); $date = $this->object->getActivationStartDate(); $dur->setStart(new ilDateTime($date ? $date : time(), IL_CAL_UNIX)); $dur->setStartText($this->lng->txt('rep_activation_limited_start')); $date = $this->object->getActivationEndDate(); $dur->setEnd(new ilDateTime($date ? $date : time(), IL_CAL_UNIX)); $dur->setEndText($this->lng->txt('rep_activation_limited_end')); $act_type->addSubItem($dur); $visible = new ilCheckboxInputGUI($this->lng->txt('rep_activation_limited_visibility'), 'access_visiblity'); $visible->setInfo($this->lng->txt('svy_activation_limited_visibility_info')); $visible->setChecked($this->object->getActivationVisibility()); $act_type->addSubItem($visible); $form->addItem($act_type); // before start $section = new ilFormSectionHeaderGUI(); $section->setTitle($this->lng->txt('svy_settings_section_before_start')); $form->addItem($section); // introduction $intro = new ilTextAreaInputGUI($this->lng->txt("introduction"), "introduction"); $intro->setValue($this->object->prepareTextareaOutput($this->object->getIntroduction())); $intro->setRows(10); $intro->setCols(80); $intro->setUseRte(TRUE); $intro->setInfo($this->lng->txt("survey_introduction_info")); include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php"; $intro->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("survey")); $intro->addPlugin("latex"); $intro->addButton("latex"); $intro->addButton("pastelatex"); $intro->setRTESupport($this->object->getId(), "svy", "survey", null, $hide_rte_switch); $form->addItem($intro); // access $section = new ilFormSectionHeaderGUI(); $section->setTitle($this->lng->txt('svy_settings_section_access')); $form->addItem($section); // enable start date $start = $this->object->getStartDate(); $enablestartingtime = new ilCheckboxInputGUI($this->lng->txt("start_date"), "enabled_start_date"); $enablestartingtime->setValue(1); // $enablestartingtime->setOptionTitle($this->lng->txt("enabled")); $enablestartingtime->setChecked($start); // start date $startingtime = new ilDateTimeInputGUI('', 'start_date'); $startingtime->setShowTime(true); if ($start) { $startingtime->setDate(new ilDate($start, IL_CAL_TIMESTAMP)); } $enablestartingtime->addSubItem($startingtime); $form->addItem($enablestartingtime); // enable end date $end = $this->object->getEndDate(); $enableendingtime = new ilCheckboxInputGUI($this->lng->txt("end_date"), "enabled_end_date"); $enableendingtime->setValue(1); // $enableendingtime->setOptionTitle($this->lng->txt("enabled")); $enableendingtime->setChecked($end); // end date $endingtime = new ilDateTimeInputGUI('', 'end_date'); $endingtime->setShowTime(true); if ($end) { $endingtime->setDate(new ilDate($end, IL_CAL_TIMESTAMP)); } $enableendingtime->addSubItem($endingtime); $form->addItem($enableendingtime); // anonymization if (!$this->object->get360Mode()) { $codes = new ilCheckboxInputGUI($this->lng->txt("survey_access_codes"), "acc_codes"); $codes->setInfo($this->lng->txt("survey_access_codes_info")); $codes->setChecked(!$this->object->isAccessibleWithoutCode()); $form->addItem($codes); if ($this->object->_hasDatasets($this->object->getSurveyId())) { $codes->setDisabled(true); } } // question behaviour $section = new ilFormSectionHeaderGUI(); $section->setTitle($this->lng->txt('svy_settings_section_question_behaviour')); $form->addItem($section); // show question titles $show_question_titles = new ilCheckboxInputGUI($this->lng->txt("svy_show_questiontitles"), "show_question_titles"); $show_question_titles->setValue(1); $show_question_titles->setChecked($this->object->getShowQuestionTitles()); $form->addItem($show_question_titles); // finishing $info = new ilFormSectionHeaderGUI(); $info->setTitle($this->lng->txt("svy_settings_section_finishing")); $form->addItem($info); $view_own = new ilCheckboxInputGUI($this->lng->txt("svy_results_view_own"), "view_own"); $view_own->setInfo($this->lng->txt("svy_results_view_own_info")); $view_own->setChecked($this->object->hasViewOwnResults()); $form->addItem($view_own); $mail_own = new ilCheckboxInputGUI($this->lng->txt("svy_results_mail_own"), "mail_own"); $mail_own->setInfo($this->lng->txt("svy_results_mail_own_info")); $mail_own->setChecked($this->object->hasMailOwnResults()); $form->addItem($mail_own); // final statement $finalstatement = new ilTextAreaInputGUI($this->lng->txt("outro"), "outro"); $finalstatement->setValue($this->object->prepareTextareaOutput($this->object->getOutro())); $finalstatement->setRows(10); $finalstatement->setCols(80); $finalstatement->setUseRte(TRUE); $finalstatement->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("survey")); $finalstatement->addPlugin("latex"); $finalstatement->addButton("latex"); $finalstatement->addButton("pastelatex"); $finalstatement->setRTESupport($this->object->getId(), "svy", "survey", null, $hide_rte_switch); $form->addItem($finalstatement); // mail notification $mailnotification = new ilCheckboxInputGUI($this->lng->txt("mailnotification"), "mailnotification"); // $mailnotification->setOptionTitle($this->lng->txt("activate")); $mailnotification->setInfo($this->lng->txt("svy_result_mail_notification_info")); // #11762 $mailnotification->setValue(1); $mailnotification->setChecked($this->object->getMailNotification()); // addresses $mailaddresses = new ilTextInputGUI($this->lng->txt("mailaddresses"), "mailaddresses"); $mailaddresses->setValue($this->object->getMailAddresses()); $mailaddresses->setSize(80); $mailaddresses->setInfo($this->lng->txt('mailaddresses_info')); $mailaddresses->setRequired(true); // participant data $participantdata = new ilTextAreaInputGUI($this->lng->txt("mailparticipantdata"), "mailparticipantdata"); $participantdata->setValue($this->object->getMailParticipantData()); $participantdata->setRows(6); $participantdata->setCols(80); $participantdata->setUseRte(false); $participantdata->setInfo($this->lng->txt("mailparticipantdata_info")); // #12755 - because of privacy concerns we restrict user data to a minimum $placeholders = array("FIRST_NAME" => "firstname", "LAST_NAME" => "lastname", "LOGIN" => "login"); $txt = array(); foreach ($placeholders as $placeholder => $caption) { $txt[] = "[" . strtoupper($placeholder) . "]: " . $this->lng->txt($caption); } $txt = implode("<br />", $txt); $participantdatainfo = new ilNonEditableValueGUI($this->lng->txt("mailparticipantdata_placeholder"), "", true); $participantdatainfo->setValue($txt); $mailnotification->addSubItem($mailaddresses); $mailnotification->addSubItem($participantdata); $mailnotification->addSubItem($participantdatainfo); $form->addItem($mailnotification); // tutor notification - currently not available for 360° if (!$this->object->get360Mode()) { // parent course? global $tree; $has_parent = $tree->checkForParentType($this->object->getRefId(), "grp"); if (!$has_parent) { $has_parent = $tree->checkForParentType($this->object->getRefId(), "crs"); } $num_inv = sizeof($this->object->getInvitedUsers()); // notification $tut = new ilCheckboxInputGUI($this->lng->txt("survey_notification_tutor_setting"), "tut"); $tut->setChecked($this->object->getTutorNotificationStatus()); $form->addItem($tut); $tut_logins = array(); $tuts = $this->object->getTutorNotificationRecipients(); if ($tuts) { foreach ($tuts as $tut_id) { $tmp = ilObjUser::_lookupName($tut_id); if ($tmp["login"]) { $tut_logins[] = $tmp["login"]; } } } $tut_ids = new ilTextInputGUI($this->lng->txt("survey_notification_tutor_recipients"), "tut_ids"); $tut_ids->setDataSource($this->ctrl->getLinkTarget($this, "doAutoComplete", "", true)); $tut_ids->setRequired(true); $tut_ids->setMulti(true); $tut_ids->setMultiValues($tut_logins); $tut_ids->setValue(array_shift($tut_logins)); $tut->addSubItem($tut_ids); $tut_grp = new ilRadioGroupInputGUI($this->lng->txt("survey_notification_target_group"), "tut_grp"); $tut_grp->setRequired(true); $tut_grp->setValue($this->object->getTutorNotificationTarget()); $tut->addSubItem($tut_grp); $tut_grp_crs = new ilRadioOption($this->lng->txt("survey_notification_target_group_parent_course"), ilObjSurvey::NOTIFICATION_PARENT_COURSE); if (!$has_parent) { $tut_grp_crs->setInfo($this->lng->txt("survey_notification_target_group_parent_course_inactive")); } $tut_grp->addOption($tut_grp_crs); $tut_grp_inv = new ilRadioOption($this->lng->txt("survey_notification_target_group_invited"), ilObjSurvey::NOTIFICATION_INVITED_USERS); $tut_grp_inv->setInfo(sprintf($this->lng->txt("survey_notification_target_group_invited_info"), $num_inv)); $tut_grp->addOption($tut_grp_inv); } // reminders // reminder - currently not available for 360° if (!$this->object->get360Mode()) { $info = new ilFormSectionHeaderGUI(); $info->setTitle($this->lng->txt("svy_settings_section_reminders")); $form->addItem($info); $rmd = new ilCheckboxInputGUI($this->lng->txt("survey_reminder_setting"), "rmd"); $rmd->setChecked($this->object->getReminderStatus()); $form->addItem($rmd); $rmd_start = new ilDateTimeInputGUI($this->lng->txt("survey_reminder_start"), "rmd_start"); $rmd_start->setRequired(true); $start = $this->object->getReminderStart(); if ($start) { $rmd_start->setDate($start); } $rmd->addSubItem($rmd_start); $end = $this->object->getReminderEnd(); $rmd_end = new ilDateTimeInputGUI($this->lng->txt("survey_reminder_end"), "rmd_end"); $rmd_end->enableDateActivation("", "rmd_end_tgl", (bool) $end); if ($end) { $rmd_end->setDate($end); } $rmd->addSubItem($rmd_end); $rmd_freq = new ilNumberInputGUI($this->lng->txt("survey_reminder_frequency"), "rmd_freq"); $rmd_freq->setRequired(true); $rmd_freq->setSize(3); $rmd_freq->setSuffix($this->lng->txt("survey_reminder_frequency_days")); $rmd_freq->setValue($this->object->getReminderFrequency()); $rmd_freq->setMinValue(1); $rmd->addSubItem($rmd_freq); $rmd_grp = new ilRadioGroupInputGUI($this->lng->txt("survey_notification_target_group"), "rmd_grp"); $rmd_grp->setRequired(true); $rmd_grp->setValue($this->object->getReminderTarget()); $rmd->addSubItem($rmd_grp); $rmd_grp_crs = new ilRadioOption($this->lng->txt("survey_notification_target_group_parent_course"), ilObjSurvey::NOTIFICATION_PARENT_COURSE); if (!$has_parent) { $rmd_grp_crs->setInfo($this->lng->txt("survey_notification_target_group_parent_course_inactive")); } $rmd_grp->addOption($rmd_grp_crs); $rmd_grp_inv = new ilRadioOption($this->lng->txt("survey_notification_target_group_invited"), ilObjSurvey::NOTIFICATION_INVITED_USERS); $rmd_grp_inv->setInfo(sprintf($this->lng->txt("survey_notification_target_group_invited_info"), $num_inv)); $rmd_grp->addOption($rmd_grp_inv); } // results $results = new ilFormSectionHeaderGUI(); $results->setTitle($this->lng->txt("results")); $form->addItem($results); // evaluation access if (!$this->object->get360Mode()) { $evaluation_access = new ilRadioGroupInputGUI($this->lng->txt('evaluation_access'), "evaluation_access"); $option = new ilCheckboxOption($this->lng->txt("evaluation_access_off"), ilObjSurvey::EVALUATION_ACCESS_OFF, ''); $option->setInfo($this->lng->txt("svy_evaluation_access_off_info")); $evaluation_access->addOption($option); $option = new ilCheckboxOption($this->lng->txt("evaluation_access_all"), ilObjSurvey::EVALUATION_ACCESS_ALL, ''); $option->setInfo($this->lng->txt("svy_evaluation_access_all_info")); $evaluation_access->addOption($option); $option = new ilCheckboxOption($this->lng->txt("evaluation_access_participants"), ilObjSurvey::EVALUATION_ACCESS_PARTICIPANTS, ''); $option->setInfo($this->lng->txt("svy_evaluation_access_participants_info")); $evaluation_access->addOption($option); $evaluation_access->setValue($this->object->getEvaluationAccess()); $form->addItem($evaluation_access); $anonymization_options = new ilRadioGroupInputGUI($this->lng->txt("survey_results_anonymization"), "anonymization_options"); $option = new ilCheckboxOption($this->lng->txt("survey_results_personalized"), "statpers"); $option->setInfo($this->lng->txt("survey_results_personalized_info")); $anonymization_options->addOption($option); $option = new ilCheckboxOption($this->lng->txt("survey_results_anonymized"), "statanon"); $option->setInfo($this->lng->txt("survey_results_anonymized_info")); $anonymization_options->addOption($option); $anonymization_options->setValue($this->object->hasAnonymizedResults() ? "statanon" : "statpers"); $form->addItem($anonymization_options); if ($this->object->_hasDatasets($this->object->getSurveyId())) { $anonymization_options->setDisabled(true); } } else { $ts_results = new ilRadioGroupInputGUI($this->lng->txt("survey_360_results"), "ts_res"); $ts_results->setValue($this->object->get360Results()); $option = new ilRadioOption($this->lng->txt("survey_360_results_none"), ilObjSurvey::RESULTS_360_NONE); $option->setInfo($this->lng->txt("survey_360_results_none_info")); $ts_results->addOption($option); $option = new ilRadioOption($this->lng->txt("survey_360_results_own"), ilObjSurvey::RESULTS_360_OWN); $option->setInfo($this->lng->txt("survey_360_results_own_info")); $ts_results->addOption($option); $option = new ilRadioOption($this->lng->txt("survey_360_results_all"), ilObjSurvey::RESULTS_360_ALL); $option->setInfo($this->lng->txt("survey_360_results_all_info")); $ts_results->addOption($option); $form->addItem($ts_results); } // competence service activation for 360 mode include_once "./Services/Skill/classes/class.ilSkillManagementSettings.php"; $skmg_set = new ilSkillManagementSettings(); if ($this->object->get360Mode() && $skmg_set->isActivated()) { $other = new ilFormSectionHeaderGUI(); $other->setTitle($this->lng->txt("other")); $form->addItem($other); $skill_service = new ilCheckboxInputGUI($this->lng->txt("survey_activate_skill_service"), "skill_service"); $skill_service->setInfo($this->lng->txt("survey_activate_skill_service_info")); $skill_service->setChecked($this->object->get360SkillService()); $form->addItem($skill_service); } $form->addCommandButton("saveProperties", $this->lng->txt("save")); // remove items when using template if ($template_settings) { foreach ($template_settings as $id => $item) { if ($item["hide"]) { $form->removeItemByPostVar($id); } } } return $form; }
protected function initEditCustomForm(ilPropertyFormGUI $a_form) { // activation/availability include_once "Services/Object/classes/class.ilObjectActivation.php"; $this->lng->loadLanguageModule('rep'); $section = new ilFormSectionHeaderGUI(); $section->setTitle($this->lng->txt('rep_activation_availability')); $a_form->addItem($section); // additional info only with multiple references $act_obj_info = $act_ref_info = ""; if (sizeof(ilObject::_getAllReferences($this->object->getId())) > 1) { $act_obj_info = ' ' . $this->lng->txt('rep_activation_online_object_info'); $act_ref_info = $this->lng->txt('rep_activation_access_ref_info'); } $online = new ilCheckboxInputGUI($this->lng->txt('rep_activation_online'), 'online'); $online->setInfo($this->lng->txt('prtt_activation_online_info') . $act_obj_info); $a_form->addItem($online); $act_type = new ilRadioGroupInputGUI($this->lng->txt('rep_activation_access'), 'access_type'); $act_type->setInfo($act_ref_info); $opt = new ilRadioOption($this->lng->txt('rep_visibility_limitless'), ilObjectActivation::TIMINGS_DEACTIVATED); $opt->setInfo($this->lng->txt('prtt_availability_limitless_info')); $act_type->addOption($opt); $opt = new ilRadioOption($this->lng->txt('rep_visibility_until'), ilObjectActivation::TIMINGS_ACTIVATION); $opt->setInfo($this->lng->txt('prtt_availability_until_info')); $this->tpl->addJavaScript('./Services/Form/js/date_duration.js'); include_once "Services/Form/classes/class.ilDateDurationInputGUI.php"; $dur = new ilDateDurationInputGUI("", "access_period"); $dur->setShowTime(true); $date = $this->object->getActivationStartDate(); $dur->setStart(new ilDateTime($date ? $date : time(), IL_CAL_UNIX)); $dur->setStartText($this->lng->txt('rep_activation_limited_start')); $date = $this->object->getActivationEndDate(); $dur->setEnd(new ilDateTime($date ? $date : time(), IL_CAL_UNIX)); $dur->setEndText($this->lng->txt('rep_activation_limited_end')); $opt->addSubItem($dur); $visible = new ilCheckboxInputGUI($this->lng->txt('rep_activation_limited_visibility'), 'access_visiblity'); $visible->setInfo($this->lng->txt('prtt_activation_limited_visibility_info')); $opt->addSubItem($visible); $act_type->addOption($opt); $a_form->addItem($act_type); $section = new ilFormSectionHeaderGUI(); $section->setTitle($this->lng->txt('properties')); $a_form->addItem($section); parent::initEditCustomForm($a_form); }
public function showDetails() { global $ilMainMenu, $ilTabs, $ilToolbar, $ilUser; $this->__initPaymentObject(); $this->__initPricesObject(); $this->__initShoppingCartObject(); $ilToolbar->addButton($this->lng->txt('payment_back_to_shop'), 'ilias.php?baseClass=ilShopController'); $this->tpl->getStandardTemplate(); $ilTabs->setTabActive('buy'); $ilMainMenu->setActive('shop'); if ($this->pobject->getStatus() == $this->pobject->STATUS_EXPIRES) { ilUtil::sendInfo($this->lng->txt('pay_expires_info')); return false; } $extension_prices = array(); if ($ilUser->getId() != ANONYMOUS_USER_ID) { include_once './Services/Payment/classes/class.ilPaymentBookings.php'; $has_extension_price = ilPaymentBookings::_hasAccesstoExtensionPrice($ilUser->getId(), $this->pobject->getPobjectId()); if ($has_extension_price) { $extension_prices = $this->price_obj->getExtensionPrices(); } } $org_prices = $this->price_obj->getPrices(); $tmp_prices = array_merge($org_prices, $extension_prices); $prices = array(); foreach ($tmp_prices as $price) { // expired prices must be filtered out if ($price['price_type'] == ilPaymentPrices::TYPE_DURATION_DATE && $price['duration_until'] < date('Y-m-d')) { //do nothing } else { $prices[] = $price; } } include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this)); $buyedObject = ""; if ($this->sc_obj->isInShoppingCart($this->pobject->getPobjectId())) { $buyedObject = $this->sc_obj->getEntry($this->pobject->getPobjectId()); if (is_array($prices) && count($prices) > 1) { ilUtil::sendInfo($this->lng->txt('pay_item_already_in_sc_choose_another')); } else { ilUtil::sendInfo($this->lng->txt('pay_item_already_in_sc')); } } $this->ctrl->setParameter($this, "ref_id", $this->pobject->getRefId()); $subtype = ''; if ($this->object) { if ($this->object->getType() == 'exc') { $subtype = ' (' . $this->lng->txt($this->pobject->getSubtype()) . ')'; } $form->setTitle($this->object->getTitle() . ' ' . $subtype); $form->setTitleIcon(ilObject::_getIcon($this->object->getId())); } else { ilUtil::sendFailure($this->lng->txt('object_not_found')); } // payment infos $info = new ilNonEditableValueGUI($this->lng->txt('info')); $info->setValue($this->lng->txt('pay_info')); $form->addItem($info); if (is_array($buyedObject)) { if (is_array($prices) && count($prices) > 1) { $button_txt = $this->lng->txt('pay_change_price'); } else { $button_txt = $this->lng->txt('pay_add_to_shopping_cart'); } } else { $button_txt = $this->lng->txt('pay_add_to_shopping_cart'); } $rg_prices = new ilRadioGroupInputGUI($this->lng->txt('prices'), 'price_id'); if (is_array($prices)) { foreach ($prices as $price) { if (is_array($buyedObject) && $buyedObject["price_id"] == $price['price_id']) { $rg_prices->setValue($price['price_id']); } else { if (count($prices) == 1) { $rg_prices->setValue($price['price_id']); } } switch ($price['price_type']) { case ilPaymentPrices::TYPE_DURATION_MONTH: $txt_price = $price['duration'] . ' ' . $this->lng->txt('paya_months') . ': '; break; case ilPaymentPrices::TYPE_DURATION_DATE: $txt_price = ilDatePresentation::formatDate(new ilDate($price['duration_from'], IL_CAL_DATE)) . ' - ' . ilDatePresentation::formatDate(new ilDate($price['duration_until'], IL_CAL_DATE)) . ': '; break; case ilPaymentPrices::TYPE_UNLIMITED_DURATION: $txt_price = $this->lng->txt('unlimited_duration') . ': '; break; } $tmp_price = $price['price']; $extension_txt = ''; if ($price['extension'] == 1) { $extension_txt = '(' . $this->lng->txt('extension_price') . ')'; } $price_row = new ilRadioOption($txt_price . ' ' . ilPaymentPrices::_formatPriceToString((double) $tmp_price) . ' ' . $extension_txt, $price['price_id']); $price_row->setInfo($price['description']); $rg_prices->addOption($price_row); } $form->addItem($rg_prices); } $form->addCommandButton('addToShoppingCart', $button_txt); return $this->tpl->setContent($form->getHTML()); }
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()); }
public function initFormSearch() { global $ilCtrl; include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; $this->form = new ilPropertyFormGUI(); $this->form->setFormAction($this->ctrl->getFormAction($this, 'search')); $this->form->setTitle($this->getTitle()); $this->form->addCommandButton('performSearch', $this->lng->txt('search')); $this->form->addCommandButton('cancel', $this->lng->txt('cancel')); $kind = new ilRadioGroupInputGUI($this->lng->txt('search_type'), 'search_for'); $kind->setValue($this->search_type); $this->form->addItem($kind); // Users $users = new ilRadioOption($this->lng->txt('search_for_users'), 'usr'); // UDF include_once 'Services/Search/classes/class.ilUserSearchOptions.php'; foreach (ilUserSearchOptions::_getSearchableFieldsInfo(!$this->isSearchableCheckEnabled()) as $info) { switch ($info['type']) { case FIELD_TYPE_UDF_SELECT: case FIELD_TYPE_SELECT: $sel = new ilSelectInputGUI($info['lang'], "rep_query[usr][" . $info['db'] . "]"); $sel->setOptions($info['values']); $users->addSubItem($sel); break; case FIELD_TYPE_UDF_TEXT: case FIELD_TYPE_TEXT: if (isset($info['autoComplete']) and $info['autoComplete']) { $ilCtrl->setParameterByClass(get_class($this), 'autoCompleteField', $info['db']); $ul = new ilTextInputGUI($info['lang'], "rep_query[usr][" . $info['db'] . "]"); $ul->setDataSource($ilCtrl->getLinkTarget($this, "doUserAutoComplete", "", true)); $ul->setSize(30); $ul->setMaxLength(120); $users->addSubItem($ul); } else { $txt = new ilTextInputGUI($info['lang'], "rep_query[usr][" . $info['db'] . "]"); $txt->setSize(30); $txt->setMaxLength(120); $users->addSubItem($txt); } break; } } $kind->addOption($users); // Role $roles = new ilRadioOption($this->lng->txt('search_for_role_members'), 'role'); $role = new ilTextInputGUI($this->lng->txt('search_role_title'), 'rep_query[role][title]'); $role->setSize(30); $role->setMaxLength(120); $roles->addSubItem($role); $kind->addOption($roles); // Course $groups = new ilRadioOption($this->lng->txt('search_for_crs_members'), 'crs'); $group = new ilTextInputGUI($this->lng->txt('search_crs_title'), 'rep_query[crs][title]'); $group->setSize(30); $group->setMaxLength(120); $groups->addSubItem($group); $kind->addOption($groups); // Group $groups = new ilRadioOption($this->lng->txt('search_for_grp_members'), 'grp'); $group = new ilTextInputGUI($this->lng->txt('search_grp_title'), 'rep_query[grp][title]'); $group->setSize(30); $group->setMaxLength(120); $groups->addSubItem($group); $kind->addOption($groups); }
/** * 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()); }
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; }
/** * init form edit * * @access protected * @return */ protected function initFormEdit() { global $tree; include_once "Services/Object/classes/class.ilObjectActivation.php"; include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; $this->form = new ilPropertyFormGUI(); $this->form->setFormAction($this->ctrl->getFormAction($this)); $title = ilObject::_lookupTitle(ilObject::_lookupObjId($this->getItemId())); $this->form->setTitle($title . ': ' . $this->lng->txt('crs_edit_timings')); $timings = new ilRadioGroupInputGUI($this->lng->txt('timings'), 'timing_type'); // opt deactivated $dea = new ilRadioOption($this->lng->txt('crs_timings_disabled'), ilObjectActivation::TIMINGS_DEACTIVATED); $dea->setInfo($this->lng->txt('crs_timings_disabled_info')); $timings->addOption($dea); // Visiblity $vis = new ilRadioOption($this->lng->txt('crs_timings_availability_enabled'), ilObjectActivation::TIMINGS_ACTIVATION); #$vis->setInfo($this->lng->txt('crs_timings_visibility')); $start = new ilDateTimeInputGUI($this->lng->txt('crs_timings_start'), 'timing_start'); $start->setShowTime(true); #$start->setMinuteStepSize(5); $vis->addSubItem($start); $end = new ilDateTimeInputGUI($this->lng->txt('crs_timings_end'), 'timing_end'); $end->setShowTime(true); #$end->setMinuteStepSize(5); $vis->addSubItem($end); $isv = new ilCheckboxInputGUI($this->lng->txt('crs_timings_visibility_short'), 'visible'); $isv->setInfo($this->lng->txt('crs_timings_visibility')); $isv->setValue(1); $vis->addSubItem($isv); $timings->addOption($vis); // Timings $tim = new ilRadioOption($this->lng->txt('crs_timings_presetting'), ilObjectActivation::TIMINGS_PRESETTING); $tim->setInfo($this->lng->txt('crs_item_presetting_info')); $start = new ilDateTimeInputGUI($this->lng->txt('crs_timings_sug_begin'), 'sug_start'); $tim->addSubItem($start); $end = new ilDateTimeInputGUI($this->lng->txt('crs_timings_sug_end'), 'sug_end'); $tim->addSubItem($end); if ($tree->checkForParentType($this->parent_ref_id, 'crs')) { $cha = new ilCheckboxInputGUI($this->lng->txt('crs_timings_changeable'), 'changeable'); $tim->addSubItem($cha); $start = new ilDateTimeInputGUI($this->lng->txt('crs_timings_early_begin'), 'early_start'); $tim->addSubItem($start); $late = new ilDateTimeInputGUI($this->lng->txt('crs_timings_short_limit_start_end'), 'late_end'); $tim->addSubItem($late); } $timings->addOption($tim); $this->form->addItem($timings); $this->form->addCommandButton('update', $this->lng->txt('save')); $this->form->addCommandButton('cancel', $this->lng->txt('cancel')); }
public function getApacheAuthSettingsForm() { include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this)); $form->setTitle($this->lng->txt('apache_settings')); $chb_enabled = new ilCheckboxInputGUI($this->lng->txt('apache_enable_auth'), 'apache_enable_auth'); $form->addItem($chb_enabled); $chb_local_create_account = new ilCheckboxInputGUI($this->lng->txt('apache_autocreate'), 'apache_local_autocreate'); $chb_enabled->addSubitem($chb_local_create_account); global $rbacreview; $roles = $rbacreview->getGlobalRolesArray(); $select = new ilSelectInputGUI($this->lng->txt('apache_default_role'), 'apache_default_role'); $roleOptions = array(); foreach ($roles as $role) { $roleOptions[$role['obj_id']] = ilObject::_lookupTitle($role['obj_id']); } $select->setOptions($roleOptions); $select->setValue(4); $chb_local_create_account->addSubitem($select); $chb_local = new ilCheckboxInputGUI($this->lng->txt('apache_enable_local'), 'apache_enable_local'); $form->addItem($chb_local); $chb_ldap = new ilCheckboxInputGUI($this->lng->txt('apache_enable_ldap'), 'apache_enable_ldap'); $chb_ldap->setInfo($this->lng->txt('apache_ldap_hint_ldap_must_be_configured')); $form->addItem($chb_ldap); $txt = new ilTextInputGUI($this->lng->txt('apache_auth_indicator_name'), 'apache_auth_indicator_name'); $txt->setRequired(true); $form->addItem($txt); $txt = new ilTextInputGUI($this->lng->txt('apache_auth_indicator_value'), 'apache_auth_indicator_value'); $txt->setRequired(true); $form->addItem($txt); $chb = new ilCheckboxInputGUI($this->lng->txt('apache_auth_enable_override_login'), 'apache_auth_enable_override_login_page'); $form->addItem($chb); $txt = new ilTextInputGUI($this->lng->txt('apache_auth_target_override_login'), 'apache_auth_target_override_login_page'); $txt->setRequired(true); $chb->addSubItem($txt); $chb = new ilCheckboxInputGUI($this->lng->txt('apache_auth_authenticate_on_login_page'), 'apache_auth_authenticate_on_login_page'); $form->addItem($chb); $sec = new ilFormSectionHeaderGUI(); $sec->setTitle($this->lng->txt('apache_auth_username_config')); $form->addItem($sec); $rag = new ilRadioGroupInputGUI($this->lng->txt('apache_auth_username_config_type'), 'apache_auth_username_config_type'); $form->addItem($rag); $rao = new ilRadioOption($this->lng->txt('apache_auth_username_direct_mapping'), 1); $rag->addOption($rao); $txt = new ilTextInputGUI($this->lng->txt('apache_auth_username_direct_mapping_fieldname'), 'apache_auth_username_direct_mapping_fieldname'); //$txt->setRequired(true); $rao->addSubItem($txt); $rao = new ilRadioOption($this->lng->txt('apache_auth_username_extended_mapping'), 2); $rao->setDisabled(true); $rag->addOption($rao); $rao = new ilRadioOption($this->lng->txt('apache_auth_username_by_function'), 3); $rag->addOption($rao); /* $txt = new ilTextInputGUI($this->lng->txt('apache_auth_username_by_function_functionname'), 'apache_auth_username_by_function_functionname'); $rao->addSubItem($txt);*/ $sec = new ilFormSectionHeaderGUI(); $sec->setTitle($this->lng->txt('apache_auth_security')); $form->addItem($sec); $txt = new ilTextAreaInputGUI($this->lng->txt('apache_auth_domains'), 'apache_auth_domains'); $txt->setInfo($this->lng->txt('apache_auth_domains_description')); $form->addItem($txt); $form->addCommandButton('saveApacheSettings', $this->lng->txt('save')); $form->addCommandButton('cancel', $this->lng->txt('cancel')); return $form; }
/** * Render item */ function render() { global $lng, $ilCtrl; // parse settings $has_int = $has_ext = $has_radio = false; switch ($this->getAllowedLinkTypes()) { case self::EXT: $has_ext = true; break; case self::INT: $has_int = true; break; case self::BOTH: $has_int = true; $has_ext = true; $has_radio = true; break; } // external if ($has_ext) { $title = $has_radio ? $lng->txt("url") : ""; // external $ti = new ilTextInputGUI($title, $this->getPostVar()); $ti->setMaxLength(200); $ti->setSize(50); } // internal if ($has_int) { $ilCtrl->setParameterByClass("ilformpropertydispatchgui", "postvar", $this->getPostVar()); $link = array(get_class($this->getParent()), "ilformpropertydispatchgui", get_class($this), "ilinternallinkgui"); $link = $ilCtrl->getLinkTargetByClass($link, "", false, true, false); $ilCtrl->setParameterByClass("ilformpropertydispatchgui", "postvar", ""); $no_disp_class = strpos($this->getValue(), "|") ? "" : " ilNoDisplay"; $itpl = new ilTemplate('tpl.prop_link.html', true, true, 'Services/Form'); $itpl->setVariable("VAL_ID", $this->getPostVar()); $itpl->setVariable("URL_EDIT", $link); $itpl->setVariable("TXT_EDIT", $lng->txt("form_get_link")); $itpl->setVariable("CSS_REMOVE", $no_disp_class); $itpl->setVariable("TXT_REMOVE", $lng->txt("remove")); $ne = new ilNonEditableValueGUI($lng->txt("object"), $this->getPostVar() . "_val", true); // hidden field for selected value $hidden_type = new ilHiddenInputGUI($this->getPostVar() . "_ajax_type"); $hidden_id = new ilHiddenInputGUI($this->getPostVar() . "_ajax_id"); $hidden_target = new ilHiddenInputGUI($this->getPostVar() . "_ajax_target"); } // mode if ($has_radio) { $ext = new ilRadioOption($lng->txt("form_link_external"), "ext"); $ext->addSubItem($ti); $int = new ilRadioOption($lng->txt("form_link_internal"), "int"); $int->addSubItem($ne); $mode = new ilRadioGroupInputGUI("", $this->getPostVar() . "_mode"); $mode->addOption($ext); $mode->addOption($int); } else { $mode = new ilHiddenInputGUI($this->getPostVar() . "_mode"); if ($has_int) { $mode->setValue("int"); } else { $mode->setValue("ext"); } } // value $value = $this->getValue(); if ($value) { if ($has_int && strpos($value, "|")) { $mode->setValue("int"); $value_trans = self::getTranslatedValue($value); $value = explode("|", $value); $hidden_type->setValue($value[0]); $hidden_id->setValue($value[1]); $hidden_target->setValue($value[2]); $itpl->setVariable("VAL_OBJECT_TYPE", $value_trans["type"]); $itpl->setVariable("VAL_OBJECT_NAME", $value_trans["name"]); } else { if ($has_ext) { $mode->setValue("ext"); $ti->setValue($value); } } } // #10185 - default for external urls if ($has_ext && !$ti->getValue()) { $ti->setValue("http://"); } $ne->setValue($itpl->get()); // to html if ($has_radio) { $html = $mode->render(); } else { $html = $mode->getToolbarHTML(); if ($has_ext) { $html .= $ti->getToolbarHTML(); } else { $html .= $ne->render() . '<div class="help-block">' . $ne->getInfo() . '</div>'; } } // js for internal link if ($has_int) { include_once "./Services/Link/classes/class.ilInternalLinkGUI.php"; $html .= $hidden_type->getToolbarHTML() . $hidden_id->getToolbarHTML() . $hidden_target->getToolbarHTML(); } return $html; }
/** * Init profile form * * @param bool $a_insert * @return ilPropertyFormGUI */ protected function initForm($a_insert = false) { global $ilCtrl, $ilToolbar; $is_template = $this->getPageConfig()->getEnablePCType("PlaceHolder"); if (!$is_template) { $ilToolbar->addButton($this->lng->txt("cont_edit_personal_data"), $ilCtrl->getLinkTargetByClass("ilpersonaldesktopgui", "jumptoprofile"), "profile"); $lng_suffix = ""; } else { $lng_suffix = "_template"; } 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_profile")); } else { $form->setTitle($this->lng->txt("cont_update_profile")); } $mode = new ilRadioGroupInputGUI($this->lng->txt("cont_profile_mode"), "mode"); $form->addItem($mode); $mode_inherit = new ilRadioOption($this->lng->txt("cont_profile_mode_inherit"), "inherit"); $mode_inherit->setInfo($this->lng->txt("cont_profile_mode" . $lng_suffix . "_inherit_info")); $mode->addOption($mode_inherit); $mode_manual = new ilRadioOption($this->lng->txt("cont_profile_mode_manual"), "manual"); $mode_manual->setInfo($this->lng->txt("cont_profile_mode_manual_info")); $mode->addOption($mode_manual); $prefs = array(); if ($a_insert) { $mode->setValue("inherit"); } else { $mode_value = $this->content_obj->getMode(); $mode->setValue($mode_value); $prefs = array(); if ($mode_value == "manual") { foreach ($this->content_obj->getFields() as $name) { $prefs["public_" . $name] = "y"; } } } // always has to be set $im_arr = array("icq", "yahoo", "msn", "aim", "skype", "jabber", "voip"); foreach ($im_arr as $im) { if (!isset($prefs["public_im_" . $im])) { $prefs["public_im_" . $im] = "n"; } } include_once "Services/User/classes/class.ilPersonalProfileGUI.php"; $profile = new ilPersonalProfileGUI(); $profile->showPublicProfileFields($form, $prefs, $mode_manual, $is_template); if ($a_insert) { $form->addCommandButton("create_profile", $this->lng->txt("save")); $form->addCommandButton("cancelCreate", $this->lng->txt("cancel")); } else { $form->addCommandButton("update", $this->lng->txt("save")); $form->addCommandButton("cancelUpdate", $this->lng->txt("cancel")); } return $form; }
/** * Init form table for new role assignments * * @param string mode edit | create * @param object object of ilLDAPRoleAsssignmentRule * @access protected * */ protected function initFormRoleAssignments($a_mode) { include_once 'Services/Form/classes/class.ilPropertyFormGUI.php'; include_once 'Services/LDAP/classes/class.ilLDAPRoleAssignmentRule.php'; $this->form = new ilPropertyFormGUI(); $this->form->setFormAction($this->ctrl->getFormAction($this)); switch ($a_mode) { case 'edit': $this->form->setTitle($this->lng->txt('ldap_edit_role_ass_rule')); $this->form->addCommandButton('updateRoleAssignment', $this->lng->txt('save')); $this->form->addCommandButton('roleAssignments', $this->lng->txt('cancel')); break; case 'create': $this->form->setTitle($this->lng->txt('ldap_add_role_ass_rule')); $this->form->addCommandButton('addRoleAssignment', $this->lng->txt('ldap_btn_add_role_ass')); $this->form->addCommandButton('roleAssignments', $this->lng->txt('cancel')); break; } // Role Selection $role = new ilRadioGroupInputGUI($this->lng->txt('ldap_ilias_role'), 'role_name'); $role->setRequired(true); $global = new ilRadioOption($this->lng->txt('ldap_global_role'), 0); $role->addOption($global); $role_select = new ilSelectInputGUI('', 'role_id'); $role_select->setOptions($this->prepareGlobalRoleSelection()); $global->addSubItem($role_select); $local = new ilRadioOption($this->lng->txt('ldap_local_role'), 1); $role->addOption($local); include_once './Services/Form/classes/class.ilRoleAutoCompleteInputGUI.php'; $role_search = new ilRoleAutoCompleteInputGUI('', 'role_search', $this, 'addRoleAutoCompleteObject'); $role_search->setSize(40); $local->addSubItem($role_search); $role->setInfo($this->lng->txt('ldap_role_name_info')); $this->form->addItem($role); // Update options $update = new ilNonEditableValueGUI($this->lng->txt('ldap_update_roles'), 'update_roles'); $update->setValue($this->lng->txt('ldap_check_role_assignment')); $add = new ilCheckboxInputGUI('', 'add_missing'); $add->setOptionTitle($this->lng->txt('ldap_add_missing')); $update->addSubItem($add); $remove = new ilCheckboxInputGUI('', 'remove_deprecated'); $remove->setOptionTitle($this->lng->txt('ldap_remove_deprecated')); $update->addSubItem($remove); $this->form->addItem($update); // Assignment Type $group = new ilRadioGroupInputGUI($this->lng->txt('ldap_assignment_type'), 'type'); #$group->setValue($current_rule->getType()); $group->setRequired(true); // Option by group $radio_group = new ilRadioOption($this->lng->txt('ldap_role_by_group'), ilLDAPRoleAssignmentRule::TYPE_GROUP); $dn = new ilTextInputGUI($this->lng->txt('ldap_group_dn'), 'dn'); #$dn->setValue($current_rule->getDN()); $dn->setSize(32); $dn->setMaxLength(512); $dn->setInfo($this->lng->txt('ldap_role_grp_dn_info')); $radio_group->addSubItem($dn); $at = new ilTextInputGUI($this->lng->txt('ldap_role_grp_at'), 'at'); #$at->setValue($current_rule->getMemberAttribute()); $at->setSize(16); $at->setMaxLength(128); $radio_group->addSubItem($at); $isdn = new ilCheckboxInputGUI($this->lng->txt('ldap_role_grp_isdn'), 'isdn'); #$isdn->setChecked($current_rule->isMemberAttributeDN()); $isdn->setInfo($this->lng->txt('ldap_group_member_info')); $radio_group->addSubItem($isdn); $radio_group->setInfo($this->lng->txt('ldap_role_grp_info')); $group->addOption($radio_group); // Option by Attribute $radio_attribute = new ilRadioOption($this->lng->txt('ldap_role_by_attribute'), ilLDAPRoleAssignmentRule::TYPE_ATTRIBUTE); $name = new ilTextInputGUI($this->lng->txt('ldap_role_at_name'), 'name'); #$name->setValue($current_rule->getAttributeName()); $name->setSize(32); $name->setMaxLength(128); #$name->setInfo($this->lng->txt('ldap_role_at_name_info')); $radio_attribute->addSubItem($name); // Radio Attribute $val = new ilTextInputGUI($this->lng->txt('ldap_role_at_value'), 'value'); #$val->setValue($current_rule->getAttributeValue()); $val->setSize(32); $val->setMaxLength(128); #$val->setInfo($this->lng->txt('ldap_role_at_value_info')); $radio_attribute->addSubItem($val); $radio_attribute->setInfo($this->lng->txt('ldap_role_at_info')); $group->addOption($radio_attribute); // Option by Plugin $pl_active = (bool) $this->hasActiveRoleAssignmentPlugins(); $pl = new ilRadioOption($this->lng->txt('ldap_plugin'), 3); $pl->setInfo($this->lng->txt('ldap_plugin_info')); $pl->setDisabled(!$pl_active); $id = new ilNumberInputGUI($this->lng->txt('ldap_plugin_id'), 'plugin_id'); $id->setDisabled(!$pl_active); $id->setSize(3); $id->setMaxLength(3); $id->setMaxValue(999); $id->setMinValue(1); $pl->addSubItem($id); $group->addOption($pl); $this->form->addItem($group); }
/** * 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); }
/** * Shows the certificate editor for ILIAS tests */ public function certificateEditor() { global $ilAccess; $form_fields = array(); if (strcmp($this->ctrl->getCmd(), "certificateSave") == 0) { $form_fields = $this->getFormFieldsFromPOST(); } else { $form_fields = $this->getFormFieldsFromFO(); } include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setPreventDoubleSubmission(false); $form->setFormAction($this->ctrl->getFormAction($this)); $form->setTitle($this->lng->txt("certificate_edit")); $form->setMultipart(TRUE); $form->setTableWidth("100%"); $form->setId("certificate"); $active = new ilCheckboxInputGUI($this->lng->txt("active"), "active"); $active->setChecked($form_fields["active"]); $form->addItem($active); $import = new ilFileInputGUI($this->lng->txt("import"), "certificate_import"); $import->setRequired(FALSE); $import->setSuffixes(array("zip")); // handle the certificate import if (strlen($_FILES["certificate_import"]["tmp_name"])) { if ($import->checkInput()) { $result = $this->object->importCertificate($_FILES["certificate_import"]["tmp_name"], $_FILES["certificate_import"]["name"]); if ($result == FALSE) { $import->setAlert($this->lng->txt("certificate_error_import")); } else { $this->ctrl->redirect($this, "certificateEditor"); } } } $form->addItem($import); $pageformat = new ilRadioGroupInputGUI($this->lng->txt("certificate_page_format"), "pageformat"); $pageformats = $this->object->getPageFormats(); $pageformat->setValue($form_fields["pageformat"]); foreach ($pageformats as $format) { $option = new ilRadioOption($format["name"], $format["value"]); if (strcmp($format["value"], "custom") == 0) { $pageheight = new ilTextInputGUI($this->lng->txt("certificate_pageheight"), "pageheight"); $pageheight->setValue($form_fields["pageheight"]); $pageheight->setSize(6); $pageheight->setValidationRegexp("/[0123456789\\.](cm|mm|in|pt|pc|px|em)/is"); $pageheight->setInfo($this->lng->txt("certificate_unit_description")); $pageheight->setRequired(true); $option->addSubitem($pageheight); $pagewidth = new ilTextInputGUI($this->lng->txt("certificate_pagewidth"), "pagewidth"); $pagewidth->setValue($form_fields["pagewidth"]); $pagewidth->setSize(6); $pagewidth->setValidationRegexp("/[0123456789\\.](cm|mm|in|pt|pc|px|em)/is"); $pagewidth->setInfo($this->lng->txt("certificate_unit_description")); $pagewidth->setRequired(true); $option->addSubitem($pagewidth); } $pageformat->addOption($option); } $pageformat->setRequired(true); if (strcmp($this->ctrl->getCmd(), "certificateSave") == 0) { $pageformat->checkInput(); } $form->addItem($pageformat); $bgimage = new ilImageFileInputGUI($this->lng->txt("certificate_background_image"), "background"); $bgimage->setRequired(FALSE); $bgimage->setUseCache(false); if (count($_POST)) { // handle the background upload if (strlen($_FILES["background"]["tmp_name"])) { if ($bgimage->checkInput()) { $result = $this->object->uploadBackgroundImage($_FILES["background"]["tmp_name"]); if ($result == FALSE) { $bgimage->setAlert($this->lng->txt("certificate_error_upload_bgimage")); } } } } if (!$this->object->hasBackgroundImage()) { include_once "./Services/Certificate/classes/class.ilObjCertificateSettingsAccess.php"; if (ilObjCertificateSettingsAccess::hasBackgroundImage()) { $bgimage->setImage(ilObjCertificateSettingsAccess::getBackgroundImageThumbPathWeb()); } } else { $bgimage->setImage($this->object->getBackgroundImageThumbPathWeb()); } $form->addItem($bgimage); $padding_top = new ilTextInputGUI($this->lng->txt("certificate_padding_top"), "padding_top"); $padding_top->setRequired(TRUE); $padding_top->setValue($form_fields["padding_top"]); $padding_top->setSize(6); $padding_top->setValidationRegexp("/[0123456789\\.](cm|mm|in|pt|pc|px|em)/is"); $padding_top->setInfo($this->lng->txt("certificate_unit_description")); if (strcmp($this->ctrl->getCmd(), "certificateSave") == 0) { $padding_top->checkInput(); } $form->addItem($padding_top); $rect = new ilCSSRectInputGUI($this->lng->txt("certificate_margin_body"), "margin_body"); $rect->setRequired(TRUE); $rect->setUseUnits(TRUE); $rect->setTop($form_fields["margin_body_top"]); $rect->setBottom($form_fields["margin_body_bottom"]); $rect->setLeft($form_fields["margin_body_left"]); $rect->setRight($form_fields["margin_body_right"]); $rect->setInfo($this->lng->txt("certificate_unit_description")); if (strcmp($this->ctrl->getCmd(), "certificateSave") == 0) { $rect->checkInput(); } $form->addItem($rect); $certificate = new ilTextAreaInputGUI($this->lng->txt("certificate_text"), "certificate_text"); $certificate->removePlugin('ilimgupload'); $certificate->setValue($form_fields["certificate_text"]); $certificate->setRequired(TRUE); $certificate->setRows(20); $certificate->setCols(80); // fraunhpatch start $common_desc_tpl = new ilTemplate("tpl.common_desc.html", true, true, "Services/Certificate"); foreach (ilCertificate::getCustomCertificateFields() as $f) { $common_desc_tpl->setCurrentBlock("cert_field"); $common_desc_tpl->setVariable("PH", $f["ph"]); $common_desc_tpl->setVariable("PH_TXT", $f["name"]); $common_desc_tpl->parseCurrentBlock(); } $common_desc = $common_desc_tpl->get(); // fraunhpatch start $certificate->setInfo($this->object->getAdapter()->getCertificateVariablesDescription() . $common_desc); $certificate->setUseRte(TRUE, '3.4.7'); $tags = array("br", "em", "font", "li", "ol", "p", "span", "strong", "u", "ul"); $certificate->setRteTags($tags); if (strcmp($this->ctrl->getCmd(), "certificateSave") == 0) { $certificate->checkInput(); } $form->addItem($certificate); $this->object->getAdapter()->addAdditionalFormElements($form, $form_fields); if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) { if ($this->object->isComplete() || $this->object->hasBackgroundImage()) { $form->addCommandButton("certificatePreview", $this->lng->txt("certificate_preview")); $form->addCommandButton("certificateExportFO", $this->lng->txt("certificate_export")); $form->addCommandButton("certificateDelete", $this->lng->txt("delete")); } $form->addCommandButton("certificateSave", $this->lng->txt("save")); } $this->tpl->setVariable("ADM_CONTENT", $form->getHTML()); if (strcmp($this->ctrl->getCmd(), "certificateSave") == 0) { if ($_POST["background_delete"]) { $this->object->deleteBackgroundImage(); } if ($form->checkInput()) { try { $xslfo = $this->object->processXHTML2FO($form_fields); $this->object->getAdapter()->saveFormFields($form_fields); $this->object->saveCertificate($xslfo); $this->object->writeActive($form_fields["active"]); ilUtil::sendSuccess($this->lng->txt("saved_successfully"), TRUE); $this->ctrl->redirect($this, "certificateEditor"); } catch (Exception $e) { ilUtil::sendFailure($e->getMessage()); } } } }
/** * 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')); }
/** * Init basic settings form. */ public function initBasicSettingsForm() { /** * @var $lng ilLanguage * @var $ilSetting ilSetting */ global $lng, $ilSetting; include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form = new ilPropertyFormGUI(); $lng->loadLanguageModule("pd"); // installation short title $ti = new ilTextInputGUI($this->lng->txt("short_inst_name"), "short_inst_name"); $ti->setMaxLength(200); $ti->setSize(40); $ti->setValue($ilSetting->get("short_inst_name")); $ti->setInfo($this->lng->txt("short_inst_name_info")); $this->form->addItem($ti); // public section $cb = new ilCheckboxInputGUI($this->lng->txt("pub_section"), "pub_section"); $cb->setInfo($lng->txt("pub_section_info")); if ($ilSetting->get("pub_section")) { $cb->setChecked(true); } $this->form->addItem($cb); // Enable Global Profiles $cb_prop = new ilCheckboxInputGUI($lng->txt('pd_enable_user_publish'), 'enable_global_profiles'); $cb_prop->setInfo($lng->txt('pd_enable_user_publish_info')); $cb_prop->setChecked($ilSetting->get('enable_global_profiles')); $cb->addSubItem($cb_prop); // search engine include_once 'Services/PrivacySecurity/classes/class.ilRobotSettings.php'; $robot_settings = ilRobotSettings::_getInstance(); $cb2 = new ilCheckboxInputGUI($this->lng->txt("search_engine"), "open_google"); $cb2->setInfo($this->lng->txt("enable_search_engine")); $this->form->addItem($cb2); if (!$robot_settings->checkRewrite()) { $cb2->setAlert($lng->txt("allow_override_alert")); $cb2->setChecked(false); $cb2->setDisabled(true); } else { if ($ilSetting->get("open_google")) { $cb2->setChecked(true); } } // locale $ti = new ilTextInputGUI($this->lng->txt("adm_locale"), "locale"); $ti->setMaxLength(80); $ti->setSize(40); $ti->setInfo($this->lng->txt("adm_locale_info")); $ti->setValue($ilSetting->get("locale")); $this->form->addItem($ti); // starting point include_once "Services/User/classes/class.ilUserUtil.php"; $si = new ilRadioGroupInputGUI($this->lng->txt("adm_user_starting_point"), "usr_start"); $si->setRequired(true); $si->setInfo($this->lng->txt("adm_user_starting_point_info")); $valid = array_keys(ilUserUtil::getPossibleStartingPoints()); foreach (ilUserUtil::getPossibleStartingPoints(true) as $value => $caption) { $opt = new ilRadioOption($caption, $value); $si->addOption($opt); if (!in_array($value, $valid)) { $opt->setInfo($this->lng->txt("adm_user_starting_point_invalid_info")); } } $si->setValue(ilUserUtil::getStartingPoint()); $this->form->addItem($si); // starting point: repository object $repobj = new ilRadioOption($lng->txt("adm_user_starting_point_object"), ilUserUtil::START_REPOSITORY_OBJ); $repobj_id = new ilTextInputGUI($lng->txt("adm_user_starting_point_ref_id"), "usr_start_ref_id"); $repobj_id->setRequired(true); $repobj_id->setSize(5); if ($si->getValue() == ilUserUtil::START_REPOSITORY_OBJ) { $start_ref_id = ilUserUtil::getStartingObject(); $repobj_id->setValue($start_ref_id); if ($start_ref_id) { $start_obj_id = ilObject::_lookupObjId($start_ref_id); if ($start_obj_id) { $repobj_id->setInfo($lng->txt("obj_" . ilObject::_lookupType($start_obj_id)) . ": " . ilObject::_lookupTitle($start_obj_id)); } } } $repobj->addSubItem($repobj_id); $si->addOption($repobj); // starting point: personal $startp = new ilCheckboxInputGUI($lng->txt("adm_user_starting_point_personal"), "usr_start_pers"); $startp->setInfo($lng->txt("adm_user_starting_point_personal_info")); $startp->setChecked(ilUserUtil::hasPersonalStartingPoint()); $si->addSubItem($startp); // save and cancel commands $this->form->addCommandButton("saveBasicSettings", $lng->txt("save")); $this->form->setTitle($lng->txt("basic_settings")); $this->form->setFormAction($this->ctrl->getFormAction($this)); }
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; }
/** * Init the mapping form */ protected function cInitMappingForm($current_node, $current_attribute) { include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseAttributes.php'; $attributes_obj = ilECSCourseAttributes::getInstance($this->getServer()->getServerId(), $this->getMid()); include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; $form = new ilPropertyFormGUI(); $form->setTableWidth("100%"); $this->ctrl->setParameter($this, 'ecs_ca', $current_attribute); $form->setFormAction($this->ctrl->getFormAction($this)); $this->ctrl->setParameter($this, 'ecs_ca', ''); $form->setTitle($this->lng->txt('ecs_cmap_mapping_form_title') . ' ' . ilObject::_lookupTitle(ilObject::_lookupObjId($current_node))); // Iterate through all current attributes $attributes = $attributes_obj->getAttributeSequence($current_attribute); foreach ($attributes as $att_name) { include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseMappingRule.php'; $rule = ilECSCourseMappingRule::getInstanceByAttribute($this->getServer()->getServerId(), $this->getMid(), $current_node, $att_name); $section = new ilFormSectionHeaderGUI(); $section->setTitle($this->lng->txt('ecs_cmap_att_' . $att_name)); // Filter $form->addItem($section); $isfilter = new ilRadioGroupInputGUI($this->lng->txt('ecs_cmap_form_filter'), $att_name . '_is_filter'); $isfilter->setValue($rule->isFilterEnabled() ? 1 : 0); $all_values = new ilRadioOption($this->lng->txt('ecs_cmap_form_all_values'), 0); $isfilter->addOption($all_values); $use_filter = new ilRadioOption($this->lng->txt('ecs_cmap_form_filter_by_values'), 1); $filter = new ilTextInputGUI('', $att_name . '_filter'); $filter->setInfo($this->lng->txt('ecs_cmap_form_filter_info')); $filter->setSize(50); $filter->setMaxLength(512); $filter->setRequired(true); $filter->setValue($rule->getFilter()); $use_filter->addSubItem($filter); $isfilter->addOption($use_filter); $form->addItem($isfilter); // Create subdirs $subdirs = new ilCheckboxInputGUI($this->lng->txt('ecs_cmap_form_create_subdirs'), $att_name . '_subdirs'); $subdirs->setChecked($rule->isSubdirCreationEnabled()); $subdirs->setValue(1); // Subdir types (disabled in spec) /* $subdir_type = new ilRadioGroupInputGUI($this->lng->txt('ecs_cmap_form_subdir_type'), $att_name.'_subdir_type'); $subdir_type->setValue($rule->getSubDirectoryType()); $value = new ilRadioOption($this->lng->txt('ecs_cmap_form_subdir_value'), ilECSCourseMappingRule::SUBDIR_VALUE); $subdir_type->addOption($value); $name = new ilRadioOption($this->lng->txt('ecs_cmap_form_subdir_name'), ilECSCourseMappingRule::SUBDIR_ATTRIBUTE_NAME); $subdir_type->addOption($name); $subdirs->addSubItem($subdir_type); */ $form->addItem($subdirs); // Directory relations /* $upper_attributes = ilECSCourseAttributes::getInstance( $this->getServer()->getServerId(), $this->getMid())->getUpperAttributes($att_name); if($upper_attributes) { $dir_relation = new ilRadioGroupInputGUI($this->lng->txt('ecs_cmap_form_dir_relation'),$att_name.'_dir_relation'); $current_dir = new ilRadioOption($this->lng->txt('ecs_cmap_form_current_dir'),''); $dir_relation->addOption($current_dir); } foreach($upper_attributes as $subdir_name) { $subdir = new ilRadioOption($this->lng->txt('ecs_cmap_att_'.$subdir_name),$subdir_name); $dir_relation->addOption($subdir); } if($upper_attributes) { $dir_relation->setValue((string) $rule->getDirectory()); $form->addItem($dir_relation); } */ } // add list of attributes $hidden_atts = new ilHiddenInputGUI('attributes'); $hidden_atts->setValue(implode(',', $attributes)); $form->addItem($hidden_atts); if ($current_attribute) { $form->addCommandButton('cSaveOverview', $this->lng->txt('save')); } if ($attributes_obj->getNextAttributeName($current_attribute)) { $form->addCommandButton('cAddAttribute', $this->lng->txt('ecs_cmap_add_attribute_btn')); } if ($attributes_obj->getPreviousAttributeName($current_attribute)) { $form->addCommandButton('cDeleteAttribute', $this->lng->txt('ecs_cmap_delete_attribute_btn')); } if (ilECSCourseMappingRule::hasRules($this->getServer()->getServerId(), $this->getMid(), $current_node)) { $form->addCommandButton('cDeleteRulesOfNode', $this->lng->txt('ecs_cmap_delete_rule')); } #$form->addCommandButton('cInitOverview', $this->lng->txt('cancel')); $form->setShowTopButtons(false); return $form; }
/** * 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 initQuestionForm($a_read_only = false) { global $lng, $ilCtrl; include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($ilCtrl->getFormAction($this, "saveQuestion")); $form->setTitle($lng->txt("obj_poll")); $question = new ilTextAreaInputGUI($lng->txt("poll_question"), "question"); $question->setRequired(true); $question->setCols(40); $question->setRows(2); $question->setValue($this->object->getQuestion()); $question->setDisabled($a_read_only); $form->addItem($question); $dimensions = " (" . ilObjPoll::getImageSize() . "px)"; $img = new ilImageFileInputGUI($lng->txt("poll_image") . $dimensions, "image"); $img->setDisabled($a_read_only); $form->addItem($img); // show existing file $file = $this->object->getImageFullPath(true); if ($file) { $img->setImage($file); } $anonymous = new ilRadioGroupInputGUI($lng->txt("poll_mode"), "mode"); $anonymous->setRequired(true); $option = new ilRadioOption($lng->txt("poll_mode_anonymous"), 0); $option->setInfo($lng->txt("poll_mode_anonymous_info")); $anonymous->addOption($option); $option = new ilRadioOption($lng->txt("poll_mode_personal"), 1); $option->setInfo($lng->txt("poll_mode_personal_info")); $anonymous->addOption($option); $anonymous->setValue($this->object->getNonAnonymous()); $anonymous->setDisabled($a_read_only); $form->addItem($anonymous); $nanswers = new ilNumberInputGUI($lng->txt("poll_max_number_of_answers"), "nanswers"); $nanswers->setRequired(true); $nanswers->setMinValue(1); $nanswers->setSize(3); $nanswers->setValue($this->object->getMaxNumberOfAnswers()); $nanswers->setDisabled($a_read_only); $form->addItem($nanswers); $answers = new ilTextInputGUI($lng->txt("poll_answers"), "answers"); $answers->setRequired(true); $answers->setMulti(true, true); $answers->setDisabled($a_read_only); $form->addItem($answers); $multi_answers = array(); foreach ($this->object->getAnswers() as $idx => $item) { if (!$idx) { $answers->setValue($item["answer"]); } $multi_answers[] = $item["answer"]; } $answers->setMultiValues($multi_answers); if (!$a_read_only) { $form->addCommandButton("saveQuestion", $lng->txt("save")); } return $form; }
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()); }
private function buildForm() { require_once 'Services/Form/classes/class.ilPropertyFormGUI.php'; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this)); $form->addCommandButton(self::CMD_SAVE_FORM, $this->lng->txt("save")); $form->setTableWidth("100%"); $form->setId("test_properties"); if (!$this->settingsTemplate || $this->formShowGeneralSection($this->settingsTemplate->getSettings())) { // general properties $header = new ilFormSectionHeaderGUI(); $header->setTitle($this->lng->txt("tst_general_properties")); $form->addItem($header); } // title & description (meta data) include_once 'Services/MetaData/classes/class.ilMD.php'; $md_obj = new ilMD($this->testOBJ->getId(), 0, "tst"); $md_section = $md_obj->getGeneral(); $title = new ilTextInputGUI($this->lng->txt("title"), "title"); $title->setRequired(true); $title->setValue($md_section->getTitle()); $form->addItem($title); $ids = $md_section->getDescriptionIds(); if ($ids) { $desc_obj = $md_section->getDescription(array_pop($ids)); $desc = new ilTextAreaInputGUI($this->lng->txt("description"), "description"); $desc->setCols(50); $desc->setRows(4); $desc->setValue($desc_obj->getDescription()); $form->addItem($desc); } // anonymity $anonymity = new ilRadioGroupInputGUI($this->lng->txt('tst_anonymity'), 'anonymity'); if ($this->testOBJ->participantDataExist()) { $anonymity->setDisabled(true); } $rb = new ilRadioOption($this->lng->txt('tst_anonymity_no_anonymization'), 0); $anonymity->addOption($rb); $rb = new ilRadioOption($this->lng->txt('tst_anonymity_anonymous_test'), 1); $anonymity->addOption($rb); $anonymity->setValue((int) $this->testOBJ->getAnonymity()); $form->addItem($anonymity); // test mode (question set type) $questSetType = new ilRadioGroupInputGUI($this->lng->txt("tst_question_set_type"), 'question_set_type'); $questSetTypeFixed = new ilRadioOption($this->lng->txt("tst_question_set_type_fixed"), ilObjTest::QUESTION_SET_TYPE_FIXED, $this->lng->txt("tst_question_set_type_fixed_desc")); $questSetType->addOption($questSetTypeFixed); $questSetTypeRandom = new ilRadioOption($this->lng->txt("tst_question_set_type_random"), ilObjTest::QUESTION_SET_TYPE_RANDOM, $this->lng->txt("tst_question_set_type_random_desc")); $questSetType->addOption($questSetTypeRandom); $questSetTypeContinues = new ilRadioOption($this->lng->txt("tst_question_set_type_dynamic"), ilObjTest::QUESTION_SET_TYPE_DYNAMIC, $this->lng->txt("tst_question_set_type_dynamic_desc")); $questSetType->addOption($questSetTypeContinues); $questSetType->setValue($this->testOBJ->getQuestionSetType()); if ($this->testOBJ->participantDataExist()) { $questSetType->setDisabled(true); } $form->addItem($questSetType); // pool usage $pool_usage = new ilCheckboxInputGUI($this->lng->txt("test_question_pool_usage"), "use_pool"); $pool_usage->setValue(1); $pool_usage->setChecked($this->testOBJ->getPoolUsage()); $form->addItem($pool_usage); // enable_archiving $enable_archiving = new ilCheckboxInputGUI($this->lng->txt('test_enable_archiving'), 'enable_archiving'); $enable_archiving->setValue(1); $enable_archiving->setChecked($this->testOBJ->getEnableArchiving()); $form->addItem($enable_archiving); // activation/availability (no template support yet) include_once "Services/Object/classes/class.ilObjectActivation.php"; $this->lng->loadLanguageModule('rep'); $section = new ilFormSectionHeaderGUI(); $section->setTitle($this->lng->txt('rep_activation_availability')); $form->addItem($section); // additional info only with multiple references $act_obj_info = $act_ref_info = ""; if (sizeof(ilObject::_getAllReferences($this->testOBJ->getId())) > 1) { $act_obj_info = ' ' . $this->lng->txt('rep_activation_online_object_info'); $act_ref_info = $this->lng->txt('rep_activation_access_ref_info'); } $online = new ilCheckboxInputGUI($this->lng->txt('rep_activation_online'), 'online'); $online->setChecked($this->testOBJ->isOnline()); $online->setInfo($this->lng->txt('tst_activation_online_info') . $act_obj_info); $form->addItem($online); $act_type = new ilRadioGroupInputGUI($this->lng->txt('rep_activation_access'), 'activation_type'); $act_type->setInfo($act_ref_info); $act_type->setValue($this->testOBJ->isActivationLimited() ? ilObjectActivation::TIMINGS_ACTIVATION : ilObjectActivation::TIMINGS_DEACTIVATED); $opt = new ilRadioOption($this->lng->txt('rep_visibility_limitless'), ilObjectActivation::TIMINGS_DEACTIVATED); $opt->setInfo($this->lng->txt('tst_availability_limitless_info')); $act_type->addOption($opt); $opt = new ilRadioOption($this->lng->txt('rep_visibility_until'), ilObjectActivation::TIMINGS_ACTIVATION); $opt->setInfo($this->lng->txt('tst_availability_until_info')); $this->tpl->addJavaScript('./Services/Form/js/date_duration.js'); include_once "Services/Form/classes/class.ilDateDurationInputGUI.php"; $dur = new ilDateDurationInputGUI("", "access_period"); $dur->setShowTime(true); $date = $this->testOBJ->getActivationStartingTime(); $dur->setStart(new ilDateTime($date ? $date : time(), IL_CAL_UNIX)); $dur->setStartText($this->lng->txt('rep_activation_limited_start')); $date = $this->testOBJ->getActivationEndingTime(); $dur->setEnd(new ilDateTime($date ? $date : time(), IL_CAL_UNIX)); $dur->setEndText($this->lng->txt('rep_activation_limited_end')); $opt->addSubItem($dur); $visible = new ilCheckboxInputGUI($this->lng->txt('rep_activation_limited_visibility'), 'activation_visibility'); $visible->setInfo($this->lng->txt('tst_activation_limited_visibility_info')); $visible->setChecked($this->testOBJ->getActivationVisibility()); $opt->addSubItem($visible); $act_type->addOption($opt); $form->addItem($act_type); if (!$this->settingsTemplate || $this->formShowBeginningEndingInformation($this->settingsTemplate->getSettings())) { // general properties $header = new ilFormSectionHeaderGUI(); $header->setTitle($this->lng->txt("tst_beginning_ending_information")); $form->addItem($header); } // introduction $intro = new ilTextAreaInputGUI($this->lng->txt("tst_introduction"), "introduction"); $intro->setValue($this->testOBJ->prepareTextareaOutput($this->testOBJ->getIntroduction())); $intro->setRows(10); $intro->setCols(80); $intro->setUseRte(TRUE); $intro->addPlugin("latex"); $intro->addButton("latex"); $intro->setRTESupport($this->testOBJ->getId(), "tst", "assessment"); $intro->setRteTagSet('full'); $intro->setInfo($this->lng->txt('intro_desc')); // showinfo $showinfo = new ilCheckboxInputGUI('', "showinfo"); $showinfo->setValue(1); $showinfo->setChecked($this->testOBJ->getShowInfo()); $showinfo->setOptionTitle($this->lng->txt("showinfo")); $showinfo->setInfo($this->lng->txt("showinfo_desc")); $intro->addSubItem($showinfo); $form->addItem($intro); // final statement $finalstatement = new ilTextAreaInputGUI($this->lng->txt("final_statement"), "finalstatement"); $finalstatement->setValue($this->testOBJ->prepareTextareaOutput($this->testOBJ->getFinalStatement())); $finalstatement->setRows(10); $finalstatement->setCols(80); $finalstatement->setUseRte(TRUE); $finalstatement->addPlugin("latex"); $finalstatement->addButton("latex"); $finalstatement->setRTESupport($this->testOBJ->getId(), "tst", "assessment"); $finalstatement->setRteTagSet('full'); // show final statement $showfinal = new ilCheckboxInputGUI('', "showfinalstatement"); $showfinal->setValue(1); $showfinal->setChecked($this->testOBJ->getShowFinalStatement()); $showfinal->setOptionTitle($this->lng->txt("final_statement_show")); $showfinal->setInfo($this->lng->txt("final_statement_show_desc")); $finalstatement->addSubItem($showfinal); $form->addItem($finalstatement); // examview $enable_examview = new ilCheckboxInputGUI($this->lng->txt("enable_examview"), 'enable_examview'); $enable_examview->setValue(1); $enable_examview->setChecked($this->testOBJ->getEnableExamview()); $enable_examview->setInfo($this->lng->txt("enable_examview_desc")); $show_examview_html = new ilCheckboxInputGUI('', 'show_examview_html'); $show_examview_html->setValue(1); $show_examview_html->setChecked($this->testOBJ->getShowExamviewHtml()); $show_examview_html->setOptionTitle($this->lng->txt("show_examview_html")); $show_examview_html->setInfo($this->lng->txt("show_examview_html_desc")); $enable_examview->addSubItem($show_examview_html); $show_examview_pdf = new ilCheckboxInputGUI('', 'show_examview_pdf'); $show_examview_pdf->setValue(1); $show_examview_pdf->setChecked($this->testOBJ->getShowExamviewPdf()); $show_examview_pdf->setOptionTitle($this->lng->txt("show_examview_pdf")); $show_examview_pdf->setInfo($this->lng->txt("show_examview_pdf_desc")); $enable_examview->addSubItem($show_examview_pdf); $form->addItem($enable_examview); if (!$this->settingsTemplate || $this->formShowSessionSection($this->settingsTemplate->getSettings())) { // session properties $sessionheader = new ilFormSectionHeaderGUI(); $sessionheader->setTitle($this->lng->txt("tst_session_settings")); $form->addItem($sessionheader); } // max. number of passes $nr_of_tries = new ilTextInputGUI($this->lng->txt("tst_nr_of_tries"), "nr_of_tries"); $nr_of_tries->setSize(3); $nr_of_tries->setValue($this->testOBJ->getNrOfTries()); $nr_of_tries->setRequired(true); $nr_of_tries->setSuffix($this->lng->txt("0_unlimited")); $total = $this->testOBJ->evalTotalPersons(); if ($total) { $nr_of_tries->setDisabled(true); } $form->addItem($nr_of_tries); // enable max. processing time $processing = new ilCheckboxInputGUI($this->lng->txt("tst_processing_time"), "chb_processing_time"); $processing->setValue(1); //$processing->setOptionTitle($this->lng->txt("enabled")); if ($this->settingsTemplate && $this->getTemplateSettingValue('chb_processing_time')) { $processing->setChecked(true); } else { $processing->setChecked($this->testOBJ->getEnableProcessingTime()); } // max. processing time $processingtime = new ilDurationInputGUI('', 'processing_time'); $ptime = $this->testOBJ->getProcessingTimeAsArray(); $processingtime->setHours($ptime['hh']); $processingtime->setMinutes($ptime['mm']); $processingtime->setSeconds($ptime['ss']); $processingtime->setShowMonths(false); $processingtime->setShowDays(false); $processingtime->setShowHours(true); $processingtime->setShowMinutes(true); $processingtime->setShowSeconds(true); $processingtime->setInfo($this->lng->txt("tst_processing_time_desc")); $processing->addSubItem($processingtime); // reset max. processing time $resetprocessing = new ilCheckboxInputGUI('', "chb_reset_processing_time"); $resetprocessing->setValue(1); $resetprocessing->setOptionTitle($this->lng->txt("tst_reset_processing_time")); $resetprocessing->setChecked($this->testOBJ->getResetProcessingTime()); $resetprocessing->setInfo($this->lng->txt("tst_reset_processing_time_desc")); $processing->addSubItem($resetprocessing); $form->addItem($processing); // enable starting time $enablestartingtime = new ilCheckboxInputGUI($this->lng->txt("tst_starting_time"), "chb_starting_time"); $enablestartingtime->setValue(1); //$enablestartingtime->setOptionTitle($this->lng->txt("enabled")); if ($this->settingsTemplate && $this->getTemplateSettingValue('chb_starting_time')) { $enablestartingtime->setChecked(true); } else { $enablestartingtime->setChecked(strlen($this->testOBJ->getStartingTime())); } // starting time $startingtime = new ilDateTimeInputGUI('', 'starting_time'); $startingtime->setShowDate(true); $startingtime->setShowTime(true); if (strlen($this->testOBJ->getStartingTime())) { $startingtime->setDate(new ilDateTime($this->testOBJ->getStartingTime(), IL_CAL_TIMESTAMP)); } else { $startingtime->setDate(new ilDateTime(time(), IL_CAL_UNIX)); } $enablestartingtime->addSubItem($startingtime); $form->addItem($enablestartingtime); if ($this->testOBJ->participantDataExist()) { $enablestartingtime->setDisabled(true); $startingtime->setDisabled(true); } // enable ending time $enableendingtime = new ilCheckboxInputGUI($this->lng->txt("tst_ending_time"), "chb_ending_time"); $enableendingtime->setValue(1); //$enableendingtime->setOptionTitle($this->lng->txt("enabled")); if ($this->settingsTemplate && $this->getTemplateSettingValue('chb_ending_time')) { $enableendingtime->setChecked(true); } else { $enableendingtime->setChecked(strlen($this->testOBJ->getEndingTime())); } // ending time $endingtime = new ilDateTimeInputGUI('', 'ending_time'); $endingtime->setShowDate(true); $endingtime->setShowTime(true); if (strlen($this->testOBJ->getEndingTime())) { $endingtime->setDate(new ilDateTime($this->testOBJ->getEndingTime(), IL_CAL_TIMESTAMP)); } else { $endingtime->setDate(new ilDateTime(time(), IL_CAL_UNIX)); } $enableendingtime->addSubItem($endingtime); $form->addItem($enableendingtime); // test password $password = new ilTextInputGUI($this->lng->txt("tst_password"), "password"); $password->setSize(20); $password->setValue($this->testOBJ->getPassword()); $password->setInfo($this->lng->txt("tst_password_details")); $form->addItem($password); if (!$this->settingsTemplate || $this->formShowPresentationSection($this->settingsTemplate->getSettings())) { // sequence properties $seqheader = new ilFormSectionHeaderGUI(); $seqheader->setTitle($this->lng->txt("tst_presentation_properties")); $form->addItem($seqheader); } // use previous answers $prevanswers = new ilCheckboxInputGUI($this->lng->txt("tst_use_previous_answers"), "chb_use_previous_answers"); $prevanswers->setValue(1); $prevanswers->setChecked($this->testOBJ->getUsePreviousAnswers()); $prevanswers->setInfo($this->lng->txt("tst_use_previous_answers_description")); $form->addItem($prevanswers); // force js $forcejs = new ilCheckboxInputGUI($this->lng->txt("forcejs_short"), "forcejs"); $forcejs->setValue(1); $forcejs->setChecked($this->testOBJ->getForceJS()); $forcejs->setOptionTitle($this->lng->txt("forcejs")); $forcejs->setInfo($this->lng->txt("forcejs_desc")); $form->addItem($forcejs); // question title output $title_output = new ilRadioGroupInputGUI($this->lng->txt("tst_title_output"), "title_output"); $title_output->addOption(new ilRadioOption($this->lng->txt("tst_title_output_full"), 0, '')); $title_output->addOption(new ilRadioOption($this->lng->txt("tst_title_output_hide_points"), 1, '')); $title_output->addOption(new ilRadioOption($this->lng->txt("tst_title_output_no_title"), 2, '')); $title_output->setValue($this->testOBJ->getTitleOutput()); $title_output->setInfo($this->lng->txt("tst_title_output_description")); $form->addItem($title_output); // selector for unicode characters global $ilSetting; if ($ilSetting->get('char_selector_availability') > 0) { require_once 'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php'; $char_selector = new ilCharSelectorGUI(ilCharSelectorConfig::CONTEXT_TEST); $char_selector->getConfig()->setAvailability($this->testOBJ->getCharSelectorAvailability()); $char_selector->getConfig()->setDefinition($this->testOBJ->getCharSelectorDefinition()); $char_selector->addFormProperties($form); $char_selector->setFormValues($form); } // Autosave $autosave_output = new ilCheckboxInputGUI($this->lng->txt('autosave'), 'autosave'); $autosave_output->setValue(1); $autosave_output->setChecked($this->testOBJ->getAutosave()); $autosave_output->setInfo($this->lng->txt('autosave_info')); $autosave_interval = new ilTextInputGUI($this->lng->txt('autosave_ival'), 'autosave_ival'); $autosave_interval->setSize(10); $autosave_interval->setValue($this->testOBJ->getAutosaveIval() / 1000); $autosave_interval->setInfo($this->lng->txt('autosave_ival_info')); $autosave_output->addSubItem($autosave_interval); $form->addItem($autosave_output); if (!$this->settingsTemplate || $this->formShowSequenceSection($this->settingsTemplate->getSettings())) { // sequence properties $seqheader = new ilFormSectionHeaderGUI(); $seqheader->setTitle($this->lng->txt("tst_sequence_properties")); $form->addItem($seqheader); } // postpone questions $postpone = new ilCheckboxInputGUI($this->lng->txt("tst_postpone"), "chb_postpone"); $postpone->setValue(1); $postpone->setChecked($this->testOBJ->getSequenceSettings()); $postpone->setInfo($this->lng->txt("tst_postpone_description")); $form->addItem($postpone); // shuffle questions $shuffle = new ilCheckboxInputGUI($this->lng->txt("tst_shuffle_questions"), "chb_shuffle_questions"); $shuffle->setValue(1); $shuffle->setChecked($this->testOBJ->getShuffleQuestions()); $shuffle->setInfo($this->lng->txt("tst_shuffle_questions_description")); $form->addItem($shuffle); // show list of questions $list_of_questions = new ilCheckboxInputGUI($this->lng->txt("tst_show_summary"), "list_of_questions"); //$list_of_questions->setOptionTitle($this->lng->txt("tst_show_summary")); $list_of_questions->setValue(1); $list_of_questions->setChecked($this->testOBJ->getListOfQuestions()); $list_of_questions->setInfo($this->lng->txt("tst_show_summary_description")); $list_of_questions_options = new ilCheckboxGroupInputGUI('', "list_of_questions_options"); $list_of_questions_options->addOption(new ilCheckboxOption($this->lng->txt("tst_list_of_questions_start"), 'chb_list_of_questions_start', '')); $list_of_questions_options->addOption(new ilCheckboxOption($this->lng->txt("tst_list_of_questions_end"), 'chb_list_of_questions_end', '')); $list_of_questions_options->addOption(new ilCheckboxOption($this->lng->txt("tst_list_of_questions_with_description"), 'chb_list_of_questions_with_description', '')); $values = array(); if ($this->testOBJ->getListOfQuestionsStart()) { array_push($values, 'chb_list_of_questions_start'); } if ($this->testOBJ->getListOfQuestionsEnd()) { array_push($values, 'chb_list_of_questions_end'); } if ($this->testOBJ->getListOfQuestionsDescription()) { array_push($values, 'chb_list_of_questions_with_description'); } $list_of_questions_options->setValue($values); $list_of_questions->addSubItem($list_of_questions_options); $form->addItem($list_of_questions); // show question marking $marking = new ilCheckboxInputGUI($this->lng->txt("question_marking"), "chb_show_marker"); $marking->setValue(1); $marking->setChecked($this->testOBJ->getShowMarker()); $marking->setInfo($this->lng->txt("question_marking_description")); $form->addItem($marking); // show suspend test $cancel = new ilCheckboxInputGUI($this->lng->txt("tst_show_cancel"), "chb_show_cancel"); $cancel->setValue(1); $cancel->setChecked($this->testOBJ->getShowCancel()); $cancel->setInfo($this->lng->txt("tst_show_cancel_description")); $form->addItem($cancel); if (!$this->settingsTemplate || $this->formShowNotificationSection($this->settingsTemplate->getSettings())) { // notifications $notifications = new ilFormSectionHeaderGUI(); $notifications->setTitle($this->lng->txt("tst_mail_notification")); $form->addItem($notifications); } // mail notification $mailnotification = new ilRadioGroupInputGUI($this->lng->txt("tst_finish_notification"), "mailnotification"); $mailnotification->addOption(new ilRadioOption($this->lng->txt("tst_finish_notification_no"), 0, '')); $mailnotification->addOption(new ilRadioOption($this->lng->txt("tst_finish_notification_simple"), 1, '')); $mailnotification->addOption(new ilRadioOption($this->lng->txt("tst_finish_notification_advanced"), 2, '')); $mailnotification->setValue($this->testOBJ->getMailNotification()); $form->addItem($mailnotification); $mailnottype = new ilCheckboxInputGUI('', "mailnottype"); $mailnottype->setValue(1); $mailnottype->setOptionTitle($this->lng->txt("mailnottype")); $mailnottype->setChecked($this->testOBJ->getMailNotificationType()); $form->addItem($mailnottype); /* This options always active (?) */ $highscore_head = new ilFormSectionHeaderGUI(); $highscore_head->setTitle($this->lng->txt("tst_highscore_options")); $form->addItem($highscore_head); $highscore = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_enabled"), "highscore_enabled"); $highscore->setValue(1); $highscore->setChecked($this->testOBJ->getHighscoreEnabled()); $highscore->setInfo($this->lng->txt("tst_highscore_description")); $form->addItem($highscore); $highscore_anon = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_anon"), "highscore_anon"); $highscore_anon->setValue(1); $highscore_anon->setChecked($this->testOBJ->getHighscoreAnon()); $highscore_anon->setInfo($this->lng->txt("tst_highscore_anon_description")); $highscore->addSubItem($highscore_anon); $highscore_achieved_ts = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_achieved_ts"), "highscore_achieved_ts"); $highscore_achieved_ts->setValue(1); $highscore_achieved_ts->setChecked($this->testOBJ->getHighscoreAchievedTS()); $highscore_achieved_ts->setInfo($this->lng->txt("tst_highscore_achieved_ts_description")); $highscore->addSubItem($highscore_achieved_ts); $highscore_score = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_score"), "highscore_score"); $highscore_score->setValue(1); $highscore_score->setChecked($this->testOBJ->getHighscoreScore()); $highscore_score->setInfo($this->lng->txt("tst_highscore_score_description")); $highscore->addSubItem($highscore_score); $highscore_percentage = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_percentage"), "highscore_percentage"); $highscore_percentage->setValue(1); $highscore_percentage->setChecked($this->testOBJ->getHighscorePercentage()); $highscore_percentage->setInfo($this->lng->txt("tst_highscore_percentage_description")); $highscore->addSubItem($highscore_percentage); $highscore_hints = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_hints"), "highscore_hints"); $highscore_hints->setValue(1); $highscore_hints->setChecked($this->testOBJ->getHighscoreHints()); $highscore_hints->setInfo($this->lng->txt("tst_highscore_hints_description")); $highscore->addSubItem($highscore_hints); $highscore_wtime = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_wtime"), "highscore_wtime"); $highscore_wtime->setValue(1); $highscore_wtime->setChecked($this->testOBJ->getHighscoreWTime()); $highscore_wtime->setInfo($this->lng->txt("tst_highscore_wtime_description")); $highscore->addSubItem($highscore_wtime); $highscore_own_table = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_own_table"), "highscore_own_table"); $highscore_own_table->setValue(1); $highscore_own_table->setChecked($this->testOBJ->getHighscoreOwnTable()); $highscore_own_table->setInfo($this->lng->txt("tst_highscore_own_table_description")); $highscore->addSubItem($highscore_own_table); $highscore_top_table = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_top_table"), "highscore_top_table"); $highscore_top_table->setValue(1); $highscore_top_table->setChecked($this->testOBJ->getHighscoreTopTable()); $highscore_top_table->setInfo($this->lng->txt("tst_highscore_top_table_description")); $highscore->addSubItem($highscore_top_table); $highscore_top_num = new ilTextInputGUI($this->lng->txt("tst_highscore_top_num"), "highscore_top_num"); $highscore_top_num->setSize(4); $highscore_top_num->setSuffix($this->lng->txt("tst_highscore_top_num_unit")); $highscore_top_num->setValue($this->testOBJ->getHighscoreTopNum()); $highscore_top_num->setInfo($this->lng->txt("tst_highscore_top_num_description")); $highscore->addSubItem($highscore_top_num); if (!$this->settingsTemplate || $this->formShowTestExecutionSection($this->settingsTemplate->getSettings())) { $testExecution = new ilFormSectionHeaderGUI(); $testExecution->setTitle($this->lng->txt("tst_test_execution")); $form->addItem($testExecution); } // kiosk mode $kiosk = new ilCheckboxInputGUI($this->lng->txt("kiosk"), "kiosk"); $kiosk->setValue(1); $kiosk->setChecked($this->testOBJ->getKioskMode()); $kiosk->setInfo($this->lng->txt("kiosk_description")); // kiosk mode options $kiosktitle = new ilCheckboxGroupInputGUI($this->lng->txt("kiosk_options"), "kiosk_options"); $kiosktitle->addOption(new ilCheckboxOption($this->lng->txt("kiosk_show_title"), 'kiosk_title', '')); $kiosktitle->addOption(new ilCheckboxOption($this->lng->txt("kiosk_show_participant"), 'kiosk_participant', '')); $kiosktitle->addOption(new ilCheckboxOption($this->lng->txt('examid_in_kiosk'), 'examid_in_kiosk')); $values = array(); if ($this->testOBJ->getShowKioskModeTitle()) { array_push($values, 'kiosk_title'); } if ($this->testOBJ->getShowKioskModeParticipant()) { array_push($values, 'kiosk_participant'); } if ($this->testOBJ->getExamidInKiosk()) { array_push($values, 'examid_in_kiosk'); } $kiosktitle->setValue($values); $kiosktitle->setInfo($this->lng->txt("kiosk_options_desc")); $kiosk->addSubItem($kiosktitle); $form->addItem($kiosk); $redirection_mode = $this->testOBJ->getRedirectionMode(); $rm_enabled = new ilCheckboxInputGUI($this->lng->txt('redirect_after_finishing_tst'), 'redirection_enabled'); $rm_enabled->setChecked($redirection_mode == '0' ? false : true); $radio_rm = new ilRadioGroupInputGUI($this->lng->txt('redirect_after_finishing_tst'), 'redirection_mode'); $always = new ilRadioOption($this->lng->txt('tst_results_access_always'), REDIRECT_ALWAYS); $radio_rm->addOption($always); $kiosk = new ilRadioOption($this->lng->txt('redirect_in_kiosk_mode'), REDIRECT_KIOSK); $radio_rm->addOption($kiosk); $radio_rm->setValue(in_array($redirection_mode, array(REDIRECT_ALWAYS, REDIRECT_KIOSK)) ? $redirection_mode : REDIRECT_ALWAYS); $rm_enabled->addSubItem($radio_rm); $redirection_url = new ilTextInputGUI($this->lng->txt('redirection_url'), 'redirection_url'); $redirection_url->setValue((string) $this->testOBJ->getRedirectionUrl()); $redirection_url->setRequired(true); $rm_enabled->addSubItem($redirection_url); $form->addItem($rm_enabled); // Sign submission $sign_submission = $this->testOBJ->getSignSubmission(); $sign_submission_enabled = new ilCheckboxInputGUI($this->lng->txt('sign_submission'), 'sign_submission'); $sign_submission_enabled->setChecked($sign_submission); $sign_submission_enabled->setInfo($this->lng->txt('sign_submission_info')); $form->addItem($sign_submission_enabled); if (!$this->settingsTemplate || $this->formShowParticipantSection($this->settingsTemplate->getSettings())) { // participants properties $restrictions = new ilFormSectionHeaderGUI(); $restrictions->setTitle($this->lng->txt("tst_max_allowed_users")); $form->addItem($restrictions); } $fixedparticipants = new ilCheckboxInputGUI($this->lng->txt('participants_invitation'), "fixedparticipants"); $fixedparticipants->setValue(1); $fixedparticipants->setChecked($this->testOBJ->getFixedParticipants()); $fixedparticipants->setOptionTitle($this->lng->txt("tst_allow_fixed_participants")); $fixedparticipants->setInfo($this->lng->txt("participants_invitation_description")); $invited_users = $this->testOBJ->getInvitedUsers(); if ($total && count($invited_users) == 0) { $fixedparticipants->setDisabled(true); } $form->addItem($fixedparticipants); // simultaneous users $simul = new ilTextInputGUI($this->lng->txt("tst_allowed_users"), "allowedUsers"); $simul->setSize(3); $simul->setValue($this->testOBJ->getAllowedUsers() ? $this->testOBJ->getAllowedUsers() : ''); $form->addItem($simul); // idle time $idle = new ilTextInputGUI($this->lng->txt("tst_allowed_users_time_gap"), "allowedUsersTimeGap"); $idle->setSize(4); $idle->setSuffix($this->lng->txt("seconds")); $idle->setValue($this->testOBJ->getAllowedUsersTimeGap() ? $this->testOBJ->getAllowedUsersTimeGap() : ''); $form->addItem($idle); // Edit ecs export settings include_once 'Modules/Test/classes/class.ilECSTestSettings.php'; $ecs = new ilECSTestSettings($this->testOBJ); $ecs->addSettingsToForm($form, 'tst'); // remove items when using template if ($this->settingsTemplate) { foreach ($this->settingsTemplate->getSettings() as $id => $item) { if ($item["hide"]) { $form->removeItemByPostVar($id); } } } return $form; }