/** * 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); }
/** * @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); }
/** * 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; } }
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); }
/** * @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); }
/** * 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); }
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; }
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')); }
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; }
/** * 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)); }
/** * Show Privacy settings * * @access public */ public function showSecurity() { global $ilSetting, $ilUser, $rbacreview; include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $security = ilSecuritySettings::_getInstance(); $this->tabs_gui->setTabActive('show_security'); $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this)); $form->setTitle($this->lng->txt('ps_security_protection')); // Form checkbox $check = new ilCheckboxInputGUI($this->lng->txt('ps_auto_https'), 'auto_https_detect_enabled'); $check->setOptionTitle($this->lng->txt('ps_auto_https_description')); $check->setChecked($security->isAutomaticHTTPSEnabled() ? 1 : 0); $check->setValue(1); $text = new ilTextInputGUI($this->lng->txt('ps_auto_https_header_name'), 'auto_https_detect_header_name'); $text->setValue($security->getAutomaticHTTPSHeaderName()); $text->setSize(24); $text->setMaxLength(64); $check->addSubItem($text); $text = new ilTextInputGUI($this->lng->txt('ps_auto_https_header_value'), 'auto_https_detect_header_value'); $text->setValue($security->getAutomaticHTTPSHeaderValue()); $text->setSize(24); $text->setMaxLength(64); $check->addSubItem($text); $form->addItem($check); $check2 = new ilCheckboxInputGUI($this->lng->txt('activate_https'), 'https_enabled'); $check2->setChecked($security->isHTTPSEnabled() ? 1 : 0); $check2->setValue(1); $form->addItem($check2); $radio_group = new ilRadioGroupInputGUI($this->lng->txt('ps_account_security_mode'), 'account_security_mode'); $radio_group->setValue($security->getAccountSecurityMode()); $radio_opt = new ilRadioOption($this->lng->txt('ps_account_security_mode_default'), ilSecuritySettings::ACCOUNT_SECURITY_MODE_DEFAULT); $radio_group->addOption($radio_opt); $radio_opt = new ilRadioOption($this->lng->txt('ps_account_security_mode_customized'), ilSecuritySettings::ACCOUNT_SECURITY_MODE_CUSTOMIZED); $check = new ilCheckboxInputGUI($this->lng->txt('ps_password_chars_and_numbers_enabled'), 'password_chars_and_numbers_enabled'); $check->setChecked($security->isPasswordCharsAndNumbersEnabled() ? 1 : 0); //$check->setOptionTitle($this->lng->txt('ps_password_chars_and_numbers_enabled')); $check->setInfo($this->lng->txt('ps_password_chars_and_numbers_enabled_info')); $radio_opt->addSubItem($check); $check = new ilCheckboxInputGUI($this->lng->txt('ps_password_special_chars_enabled'), 'password_special_chars_enabled'); $check->setChecked($security->isPasswordSpecialCharsEnabled() ? 1 : 0); //$check->setOptionTitle($this->lng->txt('ps_password_special_chars_enabled')); $check->setInfo($this->lng->txt('ps_password_special_chars_enabled_info')); $radio_opt->addSubItem($check); $text = new ilTextInputGUI($this->lng->txt('ps_password_min_length'), 'password_min_length'); $text->setInfo($this->lng->txt('ps_password_min_length_info')); $text->setValue($security->getPasswordMinLength()); $text->setSize(1); $text->setMaxLength(2); $radio_opt->addSubItem($text); $text = new ilTextInputGUI($this->lng->txt('ps_password_max_length'), 'password_max_length'); $text->setInfo($this->lng->txt('ps_password_max_length_info')); $text->setValue($security->getPasswordMaxLength()); $text->setSize(2); $text->setMaxLength(3); $radio_opt->addSubItem($text); $text = new ilTextInputGUI($this->lng->txt('ps_password_max_age'), 'password_max_age'); $text->setInfo($this->lng->txt('ps_password_max_age_info')); $text->setValue($security->getPasswordMaxAge()); $text->setSize(2); $text->setMaxLength(3); $radio_opt->addSubItem($text); $text = new ilTextInputGUI($this->lng->txt('ps_login_max_attempts'), 'login_max_attempts'); $text->setInfo($this->lng->txt('ps_login_max_attempts_info')); $text->setValue($security->getLoginMaxAttempts()); $text->setSize(1); $text->setMaxLength(2); $radio_opt->addSubItem($text); $radio_group->addOption($radio_opt); $form->addItem($radio_group); $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')); $check->setChecked($security->isPasswordChangeOnFirstLoginEnabled() ? 1 : 0); $form->addItem($check); // file suffix replacement $ti = new ilTextInputGUI($this->lng->txt("file_suffix_repl"), "suffix_repl_additional"); $ti->setMaxLength(200); $ti->setSize(40); $ti->setInfo($this->lng->txt("file_suffix_repl_info") . " " . SUFFIX_REPL_DEFAULT); $ti->setValue($ilSetting->get("suffix_repl_additional")); $form->addItem($ti); // prevent login from multiple pcs at the same time $objCb = new ilCheckboxInputGUI($this->lng->txt('ps_prevent_simultaneous_logins'), 'ps_prevent_simultaneous_logins'); $objCb->setChecked((int) $security->isPreventionOfSimultaneousLoginsEnabled()); $objCb->setValue(1); $objCb->setOptionTitle($this->lng->txt('ps_prevent_simultaneous_logins_info')); $form->addItem($objCb); // protected admin $admin = new ilCheckboxInputGUI($GLOBALS['lng']->txt('adm_adm_role_protect'), 'admin_role'); $admin->setDisabled(!$rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID)); $admin->setInfo($GLOBALS['lng']->txt('adm_adm_role_protect_info')); $admin->setChecked((int) $security->isAdminRoleProtected()); $admin->setValue(1); $form->addItem($admin); $form->addCommandButton('save_security', $this->lng->txt('save')); $this->tpl->setContent($form->getHTML()); }
/** * initEditCustomForm * * @param string $a_mode values: create | edit */ public function initForm($a_mode = "create") { global $ilCtrl, $lng; include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form = new ilPropertyFormGUI(); if ($a_mode == "edit") { $this->form->setTitle($lng->txt('dcl_edit_field')); $hidden_prop = new ilHiddenInputGUI("field_id"); $this->form->addItem($hidden_prop); $this->form->setFormAction($ilCtrl->getFormAction($this), "update"); $this->form->addCommandButton('update', $lng->txt('dcl_update_field')); } else { $this->form->setTitle($lng->txt('dcl_new_field')); $hidden_prop = new ilHiddenInputGUI("table_id"); $hidden_prop->setValue($this->field_obj->getTableId()); $this->form->addItem($hidden_prop); $this->form->setFormAction($ilCtrl->getFormAction($this), "save"); $this->form->addCommandButton('save', $lng->txt('dcl_create_field')); } $this->form->addCommandButton('cancel', $lng->txt('cancel')); $text_prop = new ilTextInputGUI($lng->txt("title"), "title"); $text_prop->setRequired(true); $text_prop->setInfo(sprintf($lng->txt('fieldtitle_allow_chars'), ilDataCollectionField::_getTitleValidChars(false))); $text_prop->setValidationRegexp(ilDataCollectionField::_getTitleValidChars(true)); $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) { $options = array(); // 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() . self::REFERENCE_SEPARATOR . $field->getTitle(); } } } $table_selection = new ilSelectInputGUI('', 'prop_' . $property['id']); $table_selection->setOptions($options); //$table_selection->setValue($this->table_id); $opt->addSubItem($table_selection); } elseif ($datatype['id'] == ilDataCollectionDatatype::INPUTFORMAT_REFERENCELIST and $property['id'] == ilDataCollectionField::PROPERTYID_N_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_REFERENCELIST) { $options[$field->getId()] = $table->getTitle() . self::REFERENCE_SEPARATOR . $field->getTitle(); } } } $table_selection = new ilSelectInputGUI('', 'prop_' . $property['id']); $table_selection->setOptions($options); $opt->addSubItem($table_selection); } elseif ($property['id'] == ilDataCollectionField::PROPERTYID_FORMULA_EXPRESSION) { $table = ilDataCollectionCache::getTableCache((int) $_GET['table_id']); $fields = array(); foreach ($table->getFieldsForFormula() as $f) { $placeholder = $f->isStandardField() ? $f->getId() : $f->getTitle(); $fields[] = '<a class="dclPropExpressionField" data-placeholder="' . $placeholder . '">' . $f->getTitle() . '</a>'; } $subitem = new ilTextAreaInputGUI($lng->txt('dcl_prop_expression'), 'prop_' . $property['id']); $operators = implode(', ', array_keys(ilDclExpressionParser::getOperators())); $functions = implode(', ', ilDclExpressionParser::getFunctions()); $subitem->setInfo(sprintf($lng->txt('dcl_prop_expression_info'), $operators, $functions, implode('<br>', $fields))); $opt->addSubItem($subitem); } elseif ($property['datatype_id'] == $datatype['id']) { //All other Types: List properties saved in propertie definition table if ($property['inputformat'] == ilDataCollectionDatatype::INPUTFORMAT_BOOLEAN) { $subitem = new ilCheckboxInputGUI($lng->txt('dcl_' . $property['title']), 'prop_' . $property['id']); $opt->addSubItem($subitem); } elseif ($property['inputformat'] == ilDataCollectionDatatype::INPUTFORMAT_NUMBER) { $subitem = new ilNumberInputGUI($lng->txt('dcl_' . $property['title']), 'prop_' . $property['id']); // TODO: Nicer way to add additional info to fields (need changes in language-logic) /*if($lng->txt('dcl_'.$property['title'].'_info') != '-dcl_'.$property['title'].'_info-') { $subitem->setInfo($lng->txt('dcl_'.$property['title'].'_info')); }*/ $subitem->setSize(5); if ($property['title'] == 'length') { $subitem->setMaxValue(4000); $subitem->setInfo($lng->txt('dcl_' . $property['title'] . '_info')); } $opt->addSubItem($subitem); } elseif ($property['inputformat'] == ilDataCollectionDatatype::INPUTFORMAT_NON_EDITABLE_VALUE) { $subitem = new ilNonEditableValueGUI($lng->txt('dcl_' . $property['title'])); $subitem->setValue(implode(', ', ilDataCollectionDatatype::$mob_suffixes)); $opt->addSubItem($subitem); } else { $subitem = new ilTextInputGUI($lng->txt('dcl_' . $property['title']), 'prop_' . $property['id']); // TODO: Nicer way to add additional info to fields (need changes in language-logic) /*if($lng->txt('dcl_'.$property['title'].'_info') != '-dcl_'.$property['title'].'_info-') { $subitem->setInfo($lng->txt('dcl_'.$property['title'].'_info')); }*/ if ($property['title'] == 'regex') { $subitem->setInfo($lng->txt('dcl_' . $property['title'] . '_info')); } $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); }
/** * Init general settings form. * */ public function initGeneralSettingsForm() { global $lng, $ilUser, $styleDefinition, $ilSetting; include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form = new ilPropertyFormGUI(); // language if ($this->userSettingVisible("language")) { $languages = $this->lng->getInstalledLanguages(); $options = array(); foreach ($languages as $lang_key) { $options[$lang_key] = ilLanguage::_lookupEntry($lang_key, "meta", "meta_l_" . $lang_key); } $si = new ilSelectInputGUI($this->lng->txt("language"), "language"); $si->setOptions($options); $si->setValue($ilUser->getLanguage()); $si->setDisabled($ilSetting->get("usr_settings_disable_language")); $this->form->addItem($si); } // skin/style include_once "./Services/Style/classes/class.ilObjStyleSettings.php"; if ($this->userSettingVisible("skin_style")) { $templates = $styleDefinition->getAllTemplates(); if (is_array($templates)) { $si = new ilSelectInputGUI($this->lng->txt("skin_style"), "skin_style"); $options = array(); foreach ($templates as $template) { // get styles information of template $styleDef = new ilStyleDefinition($template["id"]); $styleDef->startParsing(); $styles = $styleDef->getStyles(); foreach ($styles as $style) { if (!ilObjStyleSettings::_lookupActivatedStyle($template["id"], $style["id"])) { continue; } $options[$template["id"] . ":" . $style["id"]] = $styleDef->getTemplateName() . " / " . $style["name"]; } } $si->setOptions($options); $si->setValue($ilUser->skin . ":" . $ilUser->prefs["style"]); $si->setDisabled($ilSetting->get("usr_settings_disable_skin_style")); $this->form->addItem($si); } } // screen reader optimization if ($this->userSettingVisible("screen_reader_optimization")) { $cb = new ilCheckboxInputGUI($this->lng->txt("user_screen_reader_optimization"), "screen_reader_optimization"); $cb->setChecked($ilUser->prefs["screen_reader_optimization"]); $cb->setDisabled($ilSetting->get("usr_settings_disable_screen_reader_optimization")); $cb->setInfo($this->lng->txt("user_screen_reader_optimization_info")); $this->form->addItem($cb); } // hits per page if ($this->userSettingVisible("hits_per_page")) { $si = new ilSelectInputGUI($this->lng->txt("hits_per_page"), "hits_per_page"); $hits_options = array(10, 15, 20, 30, 40, 50, 100, 9999); $options = array(); foreach ($hits_options as $hits_option) { $hstr = $hits_option == 9999 ? $this->lng->txt("no_limit") : $hits_option; $options[$hits_option] = $hstr; } $si->setOptions($options); $si->setValue($ilUser->prefs["hits_per_page"]); $si->setDisabled($ilSetting->get("usr_settings_disable_hits_per_page")); $this->form->addItem($si); } // Users Online if ($this->userSettingVisible("show_users_online")) { $si = new ilSelectInputGUI($this->lng->txt("show_users_online"), "show_users_online"); $options = array("y" => $this->lng->txt("users_online_show_y"), "associated" => $this->lng->txt("users_online_show_associated"), "n" => $this->lng->txt("users_online_show_n")); $si->setOptions($options); $si->setValue($ilUser->prefs["show_users_online"]); $si->setDisabled($ilSetting->get("usr_settings_disable_show_users_online")); $this->form->addItem($si); } // Store last visited $lv = new ilSelectInputGUI($this->lng->txt("user_store_last_visited"), "store_last_visited"); $options = array(0 => $this->lng->txt("user_lv_keep_entries"), 1 => $this->lng->txt("user_lv_keep_only_for_session"), 2 => $this->lng->txt("user_lv_do_not_store")); $lv->setOptions($options); $lv->setValue((int) $ilUser->prefs["store_last_visited"]); $this->form->addItem($lv); // hide_own_online_status if ($this->userSettingVisible("hide_own_online_status")) { $cb = new ilCheckboxInputGUI($this->lng->txt("hide_own_online_status"), "hide_own_online_status"); $cb->setChecked($ilUser->prefs["hide_own_online_status"] == "y"); $cb->setDisabled($ilSetting->get("usr_settings_disable_hide_own_online_status")); $this->form->addItem($cb); } include_once 'Services/Authentication/classes/class.ilSessionReminder.php'; if (ilSessionReminder::isGloballyActivated()) { $cb = new ilCheckboxInputGUI($this->lng->txt('session_reminder'), 'session_reminder_enabled'); $cb->setInfo($this->lng->txt('session_reminder_info')); $cb->setValue(1); $cb->setChecked((int) $ilUser->getPref('session_reminder_enabled')); $expires = ilSession::getSessionExpireValue(); $lead_time_gui = new ilNumberInputGUI($this->lng->txt('session_reminder_lead_time'), 'session_reminder_lead_time'); $lead_time_gui->setInfo(sprintf($this->lng->txt('session_reminder_lead_time_info'), ilFormat::_secondsToString($expires, true))); $min_value = ilSessionReminder::MIN_LEAD_TIME; $max_value = max($min_value, (int) $expires / 60 - 1); $current_user_value = $ilUser->getPref('session_reminder_lead_time'); if ($current_user_value < $min_value || $current_user_value > $max_value) { $current_user_value = ilSessionReminder::SUGGESTED_LEAD_TIME; } $value = min(max($min_value, $current_user_value), $max_value); $lead_time_gui->setValue($value); $lead_time_gui->setSize(3); $lead_time_gui->setMinValue($min_value); $lead_time_gui->setMaxValue($max_value); $cb->addSubItem($lead_time_gui); $this->form->addItem($cb); } // calendar settings (copied here to be reachable when calendar is inactive) // they cannot be hidden/deactivated include_once 'Services/Calendar/classes/class.ilCalendarUserSettings.php'; include_once 'Services/Calendar/classes/class.ilCalendarUtil.php'; $lng->loadLanguageModule("dateplaner"); $user_settings = ilCalendarUserSettings::_getInstanceByUserId($ilUser->getId()); $select = new ilSelectInputGUI($lng->txt('cal_user_timezone'), 'timezone'); $select->setOptions(ilCalendarUtil::_getShortTimeZoneList()); $select->setInfo($lng->txt('cal_timezone_info')); $select->setValue($user_settings->getTimeZone()); $this->form->addItem($select); $year = date("Y"); $select = new ilSelectInputGUI($lng->txt('cal_user_date_format'), 'date_format'); $select->setOptions(array(ilCalendarSettings::DATE_FORMAT_DMY => '31.10.' . $year, ilCalendarSettings::DATE_FORMAT_YMD => $year . "-10-31", ilCalendarSettings::DATE_FORMAT_MDY => "10/31/" . $year)); $select->setInfo($lng->txt('cal_date_format_info')); $select->setValue($user_settings->getDateFormat()); $this->form->addItem($select); $select = new ilSelectInputGUI($lng->txt('cal_user_time_format'), 'time_format'); $select->setOptions(array(ilCalendarSettings::TIME_FORMAT_24 => '13:00', ilCalendarSettings::TIME_FORMAT_12 => '1:00pm')); $select->setInfo($lng->txt('cal_time_format_info')); $select->setValue($user_settings->getTimeFormat()); $this->form->addItem($select); // starting point include_once "Services/User/classes/class.ilUserUtil.php"; if (ilUserUtil::hasPersonalStartingPoint()) { $this->lng->loadLanguageModule("administration"); $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")); foreach (ilUserUtil::getPossibleStartingPoints() as $value => $caption) { $si->addOption(new ilRadioOption($caption, $value)); } $si->setValue(ilUserUtil::getPersonalStartingPoint()); $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::getPersonalStartingObject(); $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); } // 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_USER); $char_selector->getConfig()->setAvailability($ilUser->getPref('char_selector_availability')); $char_selector->getConfig()->setDefinition($ilUser->getPref('char_selector_definition')); $char_selector->addFormProperties($this->form); $char_selector->setFormValues($this->form); } $this->form->addCommandButton("saveGeneralSettings", $lng->txt("save")); $this->form->setTitle($lng->txt("general_settings")); $this->form->setFormAction($this->ctrl->getFormAction($this)); }
/** * Init alias form */ function initAliasForm() { global $lng, $ilCtrl; include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form_gui = new ilPropertyFormGUI(); // standard view resource $std_alias_item =& new ilMediaAliasItem($this->dom, $this->getHierId(), "Standard", $this->content_obj->getPcId()); $std_item = $this->content_obj->getMediaObject()->getMediaItem("Standard"); // title, location and format $title = new ilNonEditableValueGUI($lng->txt("title"), "title"); $this->form_gui->addItem($title); $loc = new ilNonEditableValueGUI($this->lng->txt("cont_" . strtolower($std_item->getLocationType())), "st_location"); $this->form_gui->addItem($loc); $format = new ilNonEditableValueGUI($this->lng->txt("cont_format"), "st_format"); $this->form_gui->addItem($format); // standard size $radio_size = new ilRadioGroupInputGUI($lng->txt("size"), "st_derive_size"); $op1 = new ilRadioOption($lng->txt("cont_default") . " (" . $std_item->getWidth() . " x " . $std_item->getHeight() . ")", "y"); $op2 = new ilRadioOption($lng->txt("cont_custom"), "n"); $radio_size->addOption($op1); // width height include_once "./Services/MediaObjects/classes/class.ilWidthHeightInputGUI.php"; $width_height = new ilWidthHeightInputGUI($lng->txt("cont_width") . " / " . $lng->txt("cont_height"), "st_width_height"); $width_height->setConstrainProportions(true); $op2->addSubItem($width_height); $radio_size->addOption($op2); $this->form_gui->addItem($radio_size); // standard caption $rad_caption = new ilRadioGroupInputGUI($lng->txt("cont_caption"), "st_derive_caption"); $op1 = new ilRadioOption($lng->txt("cont_default"), "y"); $def_cap = new ilNonEditableValueGUI("", "def_caption"); $op1->addSubItem($def_cap); $op2 = new ilRadioOption($lng->txt("cont_custom"), "n"); $rad_caption->addOption($op1); $caption = new ilTextAreaInputGUI("", "st_caption"); $caption->setCols(30); $caption->setRows(2); $op2->addSubItem($caption); /*$caption = new ilTextInputGUI("", "st_caption"); $caption->setSize(40); $caption->setMaxLength(200); $op2->addSubItem($caption);*/ $rad_caption->addOption($op2); $this->form_gui->addItem($rad_caption); // standard text representation if (substr($std_item->getFormat(), 0, 5) == "image") { $rad_tr = new ilRadioGroupInputGUI($lng->txt("text_repr"), "st_derive_text_representation"); $op1 = new ilRadioOption($lng->txt("cont_default"), "y"); $def_tr = new ilNonEditableValueGUI("", "def_text_representation"); $op1->addSubItem($def_tr); $op2 = new ilRadioOption($lng->txt("cont_custom"), "n"); $tr = new ilTextAreaInputGUI("", "st_text_representation"); $tr->setCols(30); $tr->setRows(2); $rad_tr->addOption($op1); $op2->addSubItem($tr); $rad_tr->addOption($op2); $this->form_gui->addItem($rad_tr); $rad_tr->setInfo($lng->txt("text_repr_info")); } // standard parameters if (!in_array($std_item->getFormat(), ilObjMediaObject::_getSimpleMimeTypes())) { if (ilObjMediaObject::_useAutoStartParameterOnly($std_item->getLocation(), $std_item->getFormat())) { $par = $std_item->getParameters(); $def_str = $par["autostart"] == "true" ? " (" . $lng->txt("yes") . ")" : " (" . $lng->txt("no") . ")"; $rad_auto = new ilRadioGroupInputGUI($lng->txt("cont_autostart"), "st_derive_parameters"); $op1 = new ilRadioOption($lng->txt("cont_default") . $def_str, "y"); $rad_auto->addOption($op1); $op2 = new ilRadioOption($lng->txt("cont_custom"), "n"); $auto = new ilCheckboxInputGUI($lng->txt("enabled"), "st_autostart"); $op2->addSubItem($auto); $rad_auto->addOption($op2); $this->form_gui->addItem($rad_auto); } else { $rad_parameters = new ilRadioGroupInputGUI($lng->txt("cont_parameter"), "st_derive_parameters"); $op1 = new ilRadioOption($lng->txt("cont_default"), "y"); $def_par = new ilNonEditableValueGUI("", "def_parameters"); $op1->addSubItem($def_par); $rad_parameters->addOption($op1); $op2 = new ilRadioOption($lng->txt("cont_custom"), "n"); $par = new ilTextAreaInputGUI("", "st_parameters"); $par->setRows(5); $par->setCols(50); $op2->addSubItem($par); $rad_parameters->addOption($op2); $this->form_gui->addItem($rad_parameters); } } // fullscreen view if ($this->content_obj->getMediaObject()->hasFullScreenItem()) { $full_alias_item =& new ilMediaAliasItem($this->dom, $this->getHierId(), "Fullscreen", $this->content_obj->getPcId()); $full_item = $this->content_obj->getMediaObject()->getMediaItem("Fullscreen"); $fs_sec = new ilFormSectionHeaderGUI(); $fs_sec->setTitle($lng->txt("cont_fullscreen")); $this->form_gui->addItem($fs_sec); // resource $radio_prop = new ilRadioGroupInputGUI($lng->txt("cont_resource"), "fullscreen"); $op1 = new ilRadioOption($lng->txt("cont_none"), "n"); $radio_prop->addOption($op1); $op2 = new ilRadioOption($this->lng->txt("cont_" . strtolower($full_item->getLocationType())) . ": " . $full_item->getLocation(), "y"); $radio_prop->addOption($op2); $this->form_gui->addItem($radio_prop); // format $format = new ilNonEditableValueGUI($this->lng->txt("cont_format"), "full_format"); $this->form_gui->addItem($format); // full size $radio_size = new ilRadioGroupInputGUI($lng->txt("size"), "full_derive_size"); $op1 = new ilRadioOption($lng->txt("cont_default") . " (" . $full_item->getWidth() . " x " . $full_item->getHeight() . ")", "y"); $op2 = new ilRadioOption($lng->txt("cont_custom"), "n"); $radio_size->addOption($op1); // width height include_once "./Services/MediaObjects/classes/class.ilWidthHeightInputGUI.php"; $width_height = new ilWidthHeightInputGUI($lng->txt("cont_width") . " / " . $lng->txt("cont_height"), "full_width_height"); $width_height->setConstrainProportions(true); $op2->addSubItem($width_height); $radio_size->addOption($op2); $this->form_gui->addItem($radio_size); // fullscreen caption $rad_caption = new ilRadioGroupInputGUI($lng->txt("cont_caption"), "full_derive_caption"); $op1 = new ilRadioOption($lng->txt("cont_default"), "y"); $def_cap = new ilNonEditableValueGUI("", "full_def_caption"); $op1->addSubItem($def_cap); $op2 = new ilRadioOption($lng->txt("cont_custom"), "n"); $rad_caption->addOption($op1); $caption = new ilTextAreaInputGUI("", "full_caption"); $caption->setCols(30); $caption->setRows(2); $op2->addSubItem($caption); /*$caption = new ilTextInputGUI("", "full_caption"); $caption->setSize(40); $caption->setMaxLength(200); $op2->addSubItem($caption);*/ $rad_caption->addOption($op2); $this->form_gui->addItem($rad_caption); // fullscreen text representation if (substr($full_item->getFormat(), 0, 5) == "image") { $rad_tr = new ilRadioGroupInputGUI($lng->txt("text_repr"), "full_derive_text_representation"); $op1 = new ilRadioOption($lng->txt("cont_default"), "y"); $def_tr = new ilNonEditableValueGUI("", "full_def_text_representation"); $op1->addSubItem($def_tr); $op2 = new ilRadioOption($lng->txt("cont_custom"), "n"); $tr = new ilTextAreaInputGUI("", "full_text_representation"); $tr->setCols(30); $tr->setRows(2); $rad_tr->addOption($op1); $op2->addSubItem($tr); $rad_tr->addOption($op2); $this->form_gui->addItem($rad_tr); $rad_tr->setInfo($lng->txt("text_repr_info")); } // fullscreen parameters if (!in_array($full_item->getFormat(), ilObjMediaObject::_getSimpleMimeTypes())) { if (ilObjMediaObject::_useAutoStartParameterOnly($full_item->getLocation(), $full_item->getFormat())) { $par = $full_item->getParameters(); $def_str = $par["autostart"] == "true" ? " (" . $lng->txt("yes") . ")" : " (" . $lng->txt("no") . ")"; $rad_auto = new ilRadioGroupInputGUI($lng->txt("cont_autostart"), "full_derive_parameters"); $op1 = new ilRadioOption($lng->txt("cont_default") . $def_str, "y"); $rad_auto->addOption($op1); $op2 = new ilRadioOption($lng->txt("cont_custom"), "n"); $auto = new ilCheckboxInputGUI($lng->txt("enabled"), "full_autostart"); $op2->addSubItem($auto); $rad_auto->addOption($op2); $this->form_gui->addItem($rad_auto); } else { $rad_parameters = new ilRadioGroupInputGUI($lng->txt("cont_parameter"), "full_derive_parameters"); $op1 = new ilRadioOption($lng->txt("cont_default"), "y"); $def_par = new ilNonEditableValueGUI("", "full_def_parameters"); $op1->addSubItem($def_par); $rad_parameters->addOption($op1); $op2 = new ilRadioOption($lng->txt("cont_custom"), "n"); $par = new ilTextAreaInputGUI("", "full_parameters"); $par->setRows(5); $par->setCols(50); $op2->addSubItem($par); $rad_parameters->addOption($op2); $this->form_gui->addItem($rad_parameters); } } } $this->form_gui->setTitle($lng->txt("cont_edit_mob_alias_prop")); $this->form_gui->addCommandButton("saveAliasProperties", $lng->txt("save")); $lm_set = new ilSetting("lm"); if ($lm_set->get("replace_mob_feature")) { $this->form_gui->addCommandButton("changeObjectReference", $lng->txt("cont_change_object_reference")); } $this->form_gui->setFormAction($ilCtrl->getFormAction($this)); }
protected function initEditCustomForm(ilPropertyFormGUI $a_form) { global $lng; // activation 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('poll_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('poll_availability_limitless_info')); $act_type->addOption($opt); $opt = new ilRadioOption($this->lng->txt('rep_visibility_until'), ilObjectActivation::TIMINGS_ACTIVATION); $opt->setInfo($this->lng->txt('poll_availability_until_info')); $date = $this->object->getAccessBegin(); $start = new ilDateTimeInputGUI($this->lng->txt('rep_activation_limited_start'), 'access_begin'); $start->setShowTime(true); $start->setDate(new ilDateTime($date ? $date : time(), IL_CAL_UNIX)); $opt->addSubItem($start); $date = $this->object->getAccessEnd(); $end = new ilDateTimeInputGUI($this->lng->txt('rep_activation_limited_end'), 'access_end'); $end->setShowTime(true); $end->setDate(new ilDateTime($date ? $date : time(), IL_CAL_UNIX)); $opt->addSubItem($end); /* $visible = new ilCheckboxInputGUI($this->lng->txt('rep_activation_limited_visibility'), 'access_visiblity'); $visible->setInfo($this->lng->txt('poll_activation_limited_visibility_info')); $opt->addSubItem($visible); */ $act_type->addOption($opt); $a_form->addItem($act_type); // period/results $section = new ilFormSectionHeaderGUI(); $section->setTitle($this->lng->txt('poll_voting_period_and_results')); $a_form->addItem($section); $prd = new ilRadioGroupInputGUI($this->lng->txt('poll_voting_period'), 'period'); $opt = new ilRadioOption($this->lng->txt('poll_voting_period_unlimited'), 0); $prd->addOption($opt); $opt = new ilRadioOption($this->lng->txt('poll_voting_period_limited'), 1); $prd->addOption($opt); $date = $this->object->getVotingPeriodBegin(); $start = new ilDateTimeInputGUI($this->lng->txt('poll_voting_period_start'), 'period_begin'); $start->setShowTime(true); $start->setDate(new ilDateTime($date ? $date : time(), IL_CAL_UNIX)); $opt->addSubItem($start); $date = $this->object->getVotingPeriodEnd(); $end = new ilDateTimeInputGUI($this->lng->txt('poll_voting_period_end'), 'period_end'); $end->setShowTime(true); $end->setDate(new ilDateTime($date ? $date : time(), IL_CAL_UNIX)); $opt->addSubItem($end); $a_form->addItem($prd); $results = new ilRadioGroupInputGUI($lng->txt("poll_view_results"), "results"); $results->setRequired(true); $results->addOption(new ilRadioOption($lng->txt("poll_view_results_always"), ilObjPoll::VIEW_RESULTS_ALWAYS)); $results->addOption(new ilRadioOption($lng->txt("poll_view_results_never"), ilObjPoll::VIEW_RESULTS_NEVER)); $results->addOption(new ilRadioOption($lng->txt("poll_view_results_after_vote"), ilObjPoll::VIEW_RESULTS_AFTER_VOTE)); $results->addOption(new ilRadioOption($lng->txt("poll_view_results_after_period"), ilObjPoll::VIEW_RESULTS_AFTER_PERIOD)); $a_form->addItem($results); }
/** * 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); }
/** * Insert tabs form. */ function initForm($a_mode = "edit") { global $ilCtrl, $tpl, $lng; include_once "./Services/Accordion/classes/class.ilAccordionGUI.php"; ilAccordionGUI::addCss(); // edit form include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form = new ilPropertyFormGUI(); $this->form->setFormAction($ilCtrl->getFormAction($this)); if ($a_mode != "edit") { $this->form->setTitle($lng->txt("cont_ed_insert_tabs")); } else { $this->form->setTitle($lng->txt("cont_edit_tabs")); } // tabs type /*$type_prop = new ilSelectInputGUI($lng->txt("cont_type"), "type"); $types = array(ilPCTabs::ACCORDION_VER => $lng->txt("cont_tabs_acc_ver"), ilPCTabs::ACCORDION_HOR => $lng->txt("cont_tabs_acc_hor")); $type_prop->setOptions($types); $this->form->addItem($type_prop);*/ $templ = $this->getTemplateOptions("vaccordion"); require_once "./Services/Form/classes/class.ilAdvSelectInputGUI.php"; $vchar_prop = new ilAdvSelectInputGUI($this->lng->txt("cont_characteristic"), "vaccord_templ"); $vchars = array(); foreach ($templ as $k => $te) { $t = explode(":", $k); $html = $this->style->lookupTemplatePreview($t[1]) . '<div style="clear:both" class="small">' . $te . "</div>"; $vchar_prop->addOption($k, $te, $html); if ($t[2] == "VerticalAccordion") { $vchar_prop->setValue($k); } } $templ = $this->getTemplateOptions("haccordion"); $hchar_prop = new ilAdvSelectInputGUI($this->lng->txt("cont_characteristic"), "haccord_templ"); $hchars = array(); foreach ($templ as $k => $te) { $t = explode(":", $k); $html = $this->style->lookupTemplatePreview($t[1]) . '<div style="clear:both" class="small">' . $te . "</div>"; $hchar_prop->addOption($k, $te, $html); if ($t[2] == "HorizontalAccordion") { $hchar_prop->setValue($k); } } $radg = new ilRadioGroupInputGUI($lng->txt("cont_type"), "type"); $radg->setValue(ilPCTabs::ACCORDION_VER); $op1 = new ilRadioOption($lng->txt("cont_tabs_acc_ver"), ilPCTabs::ACCORDION_VER); $op1->addSubItem($vchar_prop); $radg->addOption($op1); $op2 = new ilRadioOption($lng->txt("cont_tabs_acc_hor"), ilPCTabs::ACCORDION_HOR); $op2->addSubItem($hchar_prop); $radg->addOption($op2); $this->form->addItem($radg); // number of initial tabs if ($a_mode == "create") { $nr_prop = new ilSelectInputGUI($lng->txt("cont_number_of_tabs"), "nr"); $nrs = array(1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 9 => 9, 10 => 10); $nr_prop->setOptions($nrs); $this->form->addItem($nr_prop); } $ni = new ilNumberInputGUI($this->lng->txt("cont_tab_cont_width"), "content_width"); $ni->setMaxLength(4); $ni->setSize(4); $this->form->addItem($ni); $ni = new ilNumberInputGUI($this->lng->txt("cont_tab_cont_height"), "content_height"); $ni->setMaxLength(4); $ni->setSize(4); $this->form->addItem($ni); // behaviour $options = array("AllClosed" => $lng->txt("cont_all_closed"), "FirstOpen" => $lng->txt("cont_first_open"), "ForceAllOpen" => $lng->txt("cont_force_all_open")); $si = new ilSelectInputGUI($this->lng->txt("cont_behavior"), "behavior"); $si->setOptions($options); $this->form->addItem($si); // alignment $align_opts = array("Left" => $lng->txt("cont_left"), "Right" => $lng->txt("cont_right"), "Center" => $lng->txt("cont_center"), "LeftFloat" => $lng->txt("cont_left_float"), "RightFloat" => $lng->txt("cont_right_float")); $align = new ilSelectInputGUI($this->lng->txt("cont_align"), "align"); $align->setOptions($align_opts); $align->setValue("Center"); $align->setInfo($lng->txt("cont_tabs_hor_align_info")); $this->form->addItem($align); // save/cancel buttons if ($a_mode == "create") { $this->form->addCommandButton("create_section", $lng->txt("save")); $this->form->addCommandButton("cancelCreate", $lng->txt("cancel")); } else { $this->form->addCommandButton("update", $lng->txt("save")); $this->form->addCommandButton("cancelUpdate", $lng->txt("cancel")); } }
/** * 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; }
/** * Show account migration screen * @param string $a_message */ public function showAccountMigration($a_message = '') { /** * @var $tpl ilTemplate * @var $lng ilLanguage */ global $tpl, $lng; $lng->loadLanguageModule('auth'); self::initStartUpTemplate('tpl.login_account_migration.html'); include_once 'Services/Form/classes/class.ilPropertyFormGUI.php'; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this, 'migrateAccount')); $form->setTitle($lng->txt('auth_account_migration')); $form->addCommandButton('migrateAccount', $lng->txt('save')); $form->addCommandButton('showLogin', $lng->txt('cancel')); $rad = new ilRadioGroupInputGUI($lng->txt('auth_account_migration_name'), 'account_migration'); $rad->setValue(1); $keep = new ilRadioOption($lng->txt('auth_account_migration_keep'), 1, $lng->txt('auth_info_migrate')); $user = new ilTextInputGUI($lng->txt('login'), 'mig_username'); $user->setRequired(true); $user->setValue(ilUtil::prepareFormOutput($_POST['mig_username'])); $user->setSize(32); $user->setMaxLength(128); $keep->addSubItem($user); $pass = new ilPasswordInputGUI($lng->txt('password'), 'mig_password'); $pass->setRetype(false); $pass->setRequired(true); $pass->setValue(ilUtil::prepareFormOutput($_POST['mig_password'])); $pass->setSize(12); $pass->setMaxLength(128); $keep->addSubItem($pass); $rad->addOption($keep); $new = new ilRadioOption($lng->txt('auth_account_migration_new'), 2, $lng->txt('auth_info_add')); $rad->addOption($new); $form->addItem($rad); $tpl->setVariable('MIG_FORM', $form->getHTML()); if (strlen($a_message)) { ilUtil::sendFailure($a_message); } $tpl->show('DEFAULT'); }
/** * init auth mode determinitation form * * @access protected */ protected function initAuthModeDetermination() { if (is_object($this->form)) { return true; } // Are there any authentication methods that support automatic determination ? include_once 'Services/Authentication/classes/class.ilAuthModeDetermination.php'; $det = ilAuthModeDetermination::_getInstance(); if ($det->getCountActiveAuthModes() <= 1) { return false; } include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; $this->form = new ilPropertyFormGUI(); $this->form->setFormAction($this->ctrl->getFormAction($this)); $this->form->setTableWidth('100%'); $this->form->setTitle($this->lng->txt('auth_auth_settings')); $this->form->addCommandButton('updateAuthModeDetermination', $this->lng->txt('save')); require_once 'Services/Captcha/classes/class.ilCaptchaUtil.php'; $cap = new ilCheckboxInputGUI($this->lng->txt('adm_captcha_anonymous_short'), 'activate_captcha_anonym'); $cap->setInfo($this->lng->txt('adm_captcha_anonymous_auth')); $cap->setValue(1); if (!ilCaptchaUtil::checkFreetype()) { $cap->setAlert(ilCaptchaUtil::getPreconditionsMessage()); } $cap->setChecked(ilCaptchaUtil::isActiveForLogin()); $this->form->addItem($cap); $header = new ilFormSectionHeaderGUI(); $header->setTitle($this->lng->txt('auth_auth_mode_determination')); $this->form->addItem($header); $kind = new ilRadioGroupInputGUI($this->lng->txt('auth_kind_determination'), 'kind'); $kind->setInfo($this->lng->txt('auth_mode_determination_info')); $kind->setValue($det->getKind()); $kind->setRequired(true); $option_user = new ilRadioOption($this->lng->txt('auth_by_user'), 0); $kind->addOption($option_user); $option_determination = new ilRadioOption($this->lng->txt('auth_automatic'), 1); include_once 'Services/Authentication/classes/class.ilAuthUtils.php'; $auth_sequenced = $det->getAuthModeSequence(); $counter = 1; foreach ($auth_sequenced as $auth_mode) { switch ($auth_mode) { case AUTH_LDAP: $text = $this->lng->txt('auth_ldap'); break; case AUTH_RADIUS: $text = $this->lng->txt('auth_radius'); break; case AUTH_LOCAL: $text = $this->lng->txt('auth_local'); break; case AUTH_SOAP: $text = $this->lng->txt('auth_soap'); break; case AUTH_APACHE: $text = $this->lng->txt('auth_apache'); break; // begin-patch auth_plugin // begin-patch auth_plugin default: foreach (ilAuthUtils::getAuthPlugins() as $pl) { $option = $pl->getMultipleAuthModeOptions($auth_mode); $text = $option[$auth_mode]['txt']; } break; // end-patch auth_plugin } $pos = new ilTextInputGUI($text, 'position[' . $auth_mode . ']'); $pos->setValue($counter++); $pos->setSize(1); $pos->setMaxLength(1); $option_determination->addSubItem($pos); } $kind->addOption($option_determination); $this->form->addItem($kind); return true; }
/** * Init activation form */ function initActivationForm() { global $ilCtrl, $lng; include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form = new ilPropertyFormGUI(); $this->form->setFormAction($ilCtrl->getFormAction($this)); $this->form->setTitle($lng->txt("cont_page_activation")); // activation type radio $rad = new ilRadioGroupInputGUI($lng->txt("cont_activation"), "activation"); $rad_op1 = new ilRadioOption($lng->txt("cont_activated"), "activated"); $rad->addOption($rad_op1); $rad_op2 = new ilRadioOption($lng->txt("cont_deactivated"), "deactivated"); $rad->addOption($rad_op2); $rad_op3 = new ilRadioOption($lng->txt("cont_scheduled_activation"), "scheduled"); $dt_prop = new ilDateTimeInputGUI($lng->txt("cont_start"), "start"); $dt_prop->setShowTime(true); $rad_op3->addSubItem($dt_prop); $dt_prop2 = new ilDateTimeInputGUI($lng->txt("cont_end"), "end"); $dt_prop2->setShowTime(true); $rad_op3->addSubItem($dt_prop2); // show activation information $cb = new ilCheckboxInputGUI($this->lng->txt("cont_show_activation_info"), "show_activation_info"); $cb->setInfo($this->lng->txt("cont_show_activation_info_info")); $rad_op3->addSubItem($cb); $rad->addOption($rad_op3); $this->form->addCommandButton("saveActivation", $lng->txt("save")); $this->form->addItem($rad); }
/** * 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); }
/** * display sessions form and process form input */ function displaySessions() { require_once 'Services/Authentication/classes/class.ilSessionControl.php'; $this->checkDisplayMode("setup_sessions"); if (!$this->setup->getClient()->db_installed) { // program should never come to this place $message = "No database found! Please install database first."; ilUtil::sendInfo($message); } $setting_fields = ilSessionControl::getSettingFields(); $valid = true; $settings = array(); foreach ($setting_fields as $field) { if ($field == 'session_allow_client_maintenance') { if (isset($_POST[$field])) { $_POST[$field] = '1'; } else { $_POST[$field] = '0'; } } if (isset($_POST[$field]) && $_POST[$field] != '') { $settings[$field] = $_POST[$field]; } else { $valid = false; break; } } if ($valid) { $this->setup->setSessionSettings($settings); } $settings = $this->setup->getSessionSettings(); include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); include_once 'Services/Authentication/classes/class.ilSession.php'; // BEGIN SESSION SETTINGS // create session handling radio group $ssettings = new ilRadioGroupInputGUI($this->lng->txt('sess_mode'), 'session_handling_type'); $ssettings->setValue($settings['session_handling_type'], ilSession::SESSION_HANDLING_FIXED); // first option, fixed session duration $fixed = new ilRadioOption($this->lng->txt('sess_fixed_duration'), ilSession::SESSION_HANDLING_FIXED); // 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); // this is the max count of active sessions // that are getting started simlutanously $ti = new ilTextInputGUI($this->lng->txt('sess_max_session_count'), "session_max_count"); $ti->setInfo($this->lng->txt('sess_max_session_count_info')); $ti->setMaxLength(5); $ti->setSize(5); $ti->setValue($settings['session_max_count']); $ldsh->addSubItem($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 $ti = new ilTextInputGUI($this->lng->txt('sess_min_session_idle'), "session_min_idle"); $ti->setInfo($this->lng->txt('sess_min_session_idle_info')); $ti->setMaxLength(5); $ti->setSize(5); $ti->setValue($settings['session_min_idle']); $ldsh->addSubItem($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 $ti = new ilTextInputGUI($this->lng->txt('sess_max_session_idle'), "session_max_idle"); $ti->setInfo($this->lng->txt('sess_max_session_idle_info')); $ti->setMaxLength(5); $ti->setSize(5); $ti->setValue($settings['session_max_idle']); $ldsh->addSubItem($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 $ti = new ilTextInputGUI($this->lng->txt('sess_max_session_idle_after_first_request'), "session_max_idle_after_first_request"); $ti->setInfo($this->lng->txt('sess_max_session_idle_after_first_request_info')); $ti->setMaxLength(5); $ti->setSize(5); $ti->setValue($settings['session_max_idle_after_first_request']); $ldsh->addSubItem($ti); // add session control to radio group $ssettings->addOption($ldsh); $form->addItem($ssettings); // controls the ability t maintenance the following // settings in client administration $chkb = new ilCheckboxInputGUI($this->lng->txt('sess_allow_client_maintenance'), "session_allow_client_maintenance"); $chkb->setInfo($this->lng->txt('sess_allow_client_maintenance_info')); $chkb->setChecked($settings['session_allow_client_maintenance'] ? true : false); $form->addItem($chkb); // END SESSION SETTINGS // save and cancel commands $form->addCommandButton("sess", $this->lng->txt('save')); $form->setTitle($this->lng->txt("sess_sessions")); $form->setFormAction('setup.php?client_id=' . $this->client_id . '&cmd=sess'); $this->tpl->setVariable("TXT_SETUP_TITLE", ucfirst(trim($this->lng->txt('sess_sessions')))); $this->tpl->setVariable("TXT_INFO", ''); $this->tpl->setVariable("SETUP_CONTENT", $form->getHTML()); /*$this->setButtonPrev("db"); if($this->setup->checkClientSessionSettings($this->client,true)) { $this->setButtonNext("lang"); }*/ $this->checkPanelMode(); }
/** * 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')); }
/** * Creates the attributes form. * It contains an radio group with radio names as actions. * Every radio has own gui elements. */ private function createAttributesForm() { $this->attributesForm = new ilPropertyFormGUI(); $this->attributesForm->setTitle($this->lng->txt('rep_robj_xrs_edit_attributes')); $this->attributesForm->setDescription($this->lng->txt('rep_robj_xrs_attributes_for_rooms_desc')); // Radio group $radioGroup = new ilRadioGroupInputGUI($this->lng->txt('rep_robj_xrs_choose_action'), ATTRC::ACTION_MODE); $radioGroup->setRequired(true); // Available attributes $roomSharingRoomAttributes = new ilRoomSharingRoomAttributes($this->pool_id, new ilRoomsharingDatabase($this->pool_id)); $attributes = $roomSharingRoomAttributes->getAllAvailableAttributesWithIdAndName(); // Create $create = new ilRadioOption($this->lng->txt('rep_robj_xrs_create_attribute'), ATTRC::CREATE_MODE, $this->lng->txt('rep_robj_xrs_create_attribute_info')); $new_name = new ilTextInputGUI($this->lng->txt('rep_robj_xrs_name_of_new_attribute'), ATTRC::NEW_NAME); $new_name->setRequired(true); $new_name->setMaxLength(ATTRC::MAX_NAME_LENGTH); $new_name->setInfo($this->lng->txt('rep_robj_xrs_must_be_unique')); $create->addSubItem($new_name); $radioGroup->addOption($create); //Rename $rename = new ilRadioOption($this->lng->txt('rep_robj_xrs_rename_attribute'), ATTRC::RENAME_MODE, $this->lng->txt('rep_robj_xrs_rename_attribute_info')); $toRename = new ilSelectInputGUI($this->lng->txt('rep_robj_xrs_choose_attribute'), ATTRC::RENAME_ATTR_ID); $toRename->setOptions($attributes); $toRename->setRequired(true); $rename->addSubItem($toRename); $changedName = new ilTextInputGUI($this->lng->txt('rep_robj_xrs_new_attribute_name'), ATTRC::CHANGED_NAME); $changedName->setRequired(true); $changedName->setMaxLength(ATTRC::MAX_NAME_LENGTH); $changedName->setInfo($this->lng->txt('rep_robj_xrs_must_be_unique')); $rename->addSubItem($changedName); $radioGroup->addOption($rename); //Delete $delete = new ilRadioOption($this->lng->txt('rep_robj_xrs_delete_attribute'), ATTRC::DELETE_MODE, $this->lng->txt('rep_robj_xrs_delete_room_attribute_info')); $toDelete = new ilSelectInputGUI($this->lng->txt('rep_robj_xrs_choose_attribute'), ATTRC::DEL_ATTR_ID); $toDelete->setOptions($attributes); $toDelete->setRequired(true); $delete->addSubItem($toDelete); $radioGroup->addOption($delete); $this->attributesForm->addItem($radioGroup); $this->attributesForm->addCommandButton(ATTRC::EXECUTE_ROOM_ATTR_ACTION, $this->lng->txt("save")); $this->attributesForm->setFormAction($this->ctrl->getFormAction($this)); }
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()); }
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 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); }
/** * 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; }