public function addToForm() { global $lng; $def = $this->getADT()->getCopyOfDefinition(); $selection = $this->getADT()->getSelection(); $options = $def->getOptions(); asort($options); // ? if (!$this->isRequired()) { $options = array("" => "-") + $options; } else { if ($this->getADT()->isNull()) { $options = array("" => $lng->txt("please_select")) + $options; } } if (!(bool) $this->force_radio) { $select = new ilSelectInputGUI($this->getTitle(), $this->getElementId()); $select->setOptions($options); } else { $select = new ilRadioGroupInputGUI($this->getTitle(), $this->getElementId()); foreach ($options as $value => $caption) { $option = new ilRadioOption($caption, $value); if (is_array($this->option_infos) && array_key_exists($value, $this->option_infos)) { $option->setInfo($this->option_infos[$value]); } $select->addOption($option); } } $this->addBasicFieldProperties($select, $def); $select->setValue($selection); $this->addToParentElement($select); }
/** * add the configuration elements to a property form * @param object property form */ public function addFormProperties(ilPropertyFormGUI $a_form) { global $lng; $lng->loadLanguageModule('adve'); $availability = new ilRadioGroupInputGUI($lng->txt('char_selector'), 'char_selector_availability'); $inactive = new ilRadioOption($lng->txt('char_selector_inactive'), ilCharSelectorConfig::INACTIVE); $inactive->setInfo($lng->txt('char_selector_inactive_info_' . $this->config->getContext())); $inherit = new ilRadioOption($lng->txt('char_selector_inherit'), ilCharSelectorConfig::INHERIT); $inherit->setInfo($lng->txt('char_selector_inherit_info_' . $this->config->getContext())); $enabled = new ilRadioOption($lng->txt('char_selector_enabled'), ilCharSelectorConfig::ENABLED); $enabled->setInfo($lng->txt('char_selector_enabled_info_' . $this->config->getContext())); $disabled = new ilRadioOption($lng->txt('char_selector_disabled'), ilCharSelectorConfig::DISABLED); $disabled->setInfo($lng->txt('char_selector_disabled_info_' . $this->config->getContext())); $blocks = new ilSelectInputGUI($lng->txt('char_selector_blocks'), 'char_selector_blocks'); $blocks->setInfo($lng->txt('char_selector_blocks_info')); $blocks->setOptions($this->config->getBlockOptions()); $blocks->setMulti(true); $enabled->addSubItem($blocks); $custom_items = new ilTextAreaInputGUI($lng->txt('char_selector_custom_items'), 'char_selector_custom_items'); $tpl = new ilTemplate("tpl.char_selector_custom_info.html", true, true, "Services/UIComponent/CharSelector"); $tpl->setVariable('1', $lng->txt('char_selector_custom_items_info1')); $tpl->setVariable('2a', $lng->txt('char_selector_custom_items_info2a')); $tpl->setVariable('2b', $lng->txt('char_selector_custom_items_info2b')); $tpl->setVariable('3a', $lng->txt('char_selector_custom_items_info3a')); $tpl->setVariable('3b', $lng->txt('char_selector_custom_items_info3b')); $tpl->setVariable('4a', $lng->txt('char_selector_custom_items_info4a')); $tpl->setVariable('4b', $lng->txt('char_selector_custom_items_info4b')); $tpl->setVariable('5a', $lng->txt('char_selector_custom_items_info5a')); $tpl->setVariable('5b', $lng->txt('char_selector_custom_items_info5b')); $tpl->setVariable('6a', $lng->txt('char_selector_custom_items_info6a')); $tpl->setVariable('6b', $lng->txt('char_selector_custom_items_info6b')); $custom_items->setInfo($tpl->get()); $enabled->addSubItem($custom_items); switch ($this->config->getContext()) { case ilCharSelectorConfig::CONTEXT_ADMIN: $availability->addOption($inactive); $availability->addOption($enabled); $availability->addOption($disabled); $a_form->addItem($availability); break; case ilCharSelectorConfig::CONTEXT_USER: case ilCharSelectorConfig::CONTEXT_TEST: $availability->addOption($inherit); $availability->addOption($enabled); $availability->addOption($disabled); $a_form->addItem($availability); break; } }
/** * @param ilRadioOption $option * @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); }
public function initForm($a_as_multi_assignment = FALSE) { include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; $form = new ilPropertyFormGUI(); $form->setTitle($this->lng->txt('crs_loc_tst_assignment')); $form->setFormAction($this->ctrl->getFormAction($this->getGUI())); if ($a_as_multi_assignment) { $form->addCommandButton('saveMultiTestAssignment', $this->lng->txt('save')); } else { $form->addCommandButton('saveTest', $this->lng->txt('save')); } switch ($this->getTestType()) { case ilLOSettings::TYPE_TEST_INITIAL: $form->setTitle($this->lng->txt('crs_loc_settings_itest_tbl')); break; case ilLOSettings::TYPE_TEST_QUALIFIED: $form->setTitle($this->lng->txt('crs_loc_settings_qtest_tbl')); break; } $assignable = $this->getAssignableTests(); $cr_mode = new ilRadioGroupInputGUI($this->lng->txt('crs_loc_form_assign_it'), 'mode'); $cr_mode->setRequired(true); $cr_mode->setValue(self::TEST_NEW); $new = new ilRadioOption($this->lng->txt('crs_loc_form_tst_new'), self::TEST_NEW); switch ($this->getTestType()) { case ilLOSettings::TYPE_TEST_INITIAL: $new->setInfo($this->lng->txt("crs_loc_form_tst_new_initial_info")); break; case ilLOSettings::TYPE_TEST_QUALIFIED: $new->setInfo($this->lng->txt("crs_loc_form_tst_new_qualified_info")); break; } // title $ti = new ilTextInputGUI($this->lng->txt("title"), "title"); $ti->setMaxLength(128); $ti->setSize(40); $ti->setRequired(true); $new->addSubItem($ti); // description $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc"); $ta->setCols(40); $ta->setRows(2); $new->addSubItem($ta); // Question assignment type include_once './Modules/Test/classes/class.ilObjTest.php'; $this->lng->loadLanguageModule('assessment'); $qst = new ilRadioGroupInputGUI($this->lng->txt('tst_question_set_type'), 'qtype'); $qst->setRequired(true); $random = new ilRadioOption($this->lng->txt('tst_question_set_type_random'), ilObjTest::QUESTION_SET_TYPE_RANDOM); $qst->addOption($random); $fixed = new ilRadioOption($this->lng->txt('tst_question_set_type_fixed'), ilObjTest::QUESTION_SET_TYPE_FIXED); $qst->addOption($fixed); $new->addSubItem($qst); $cr_mode->addOption($new); // assign existing $existing = new ilRadioOption($this->lng->txt('crs_loc_form_assign'), self::TEST_ASSIGN); switch ($this->getTestType()) { case ilLOSettings::TYPE_TEST_INITIAL: $existing->setInfo($this->lng->txt("crs_loc_form_assign_initial_info")); break; case ilLOSettings::TYPE_TEST_QUALIFIED: $existing->setInfo($this->lng->txt("crs_loc_form_assign_qualified_info")); break; } if (!$assignable) { $existing->setDisabled(true); } $cr_mode->addOption($existing); $options = array(); $options[''] = $this->lng->txt('select_one'); foreach ((array) $assignable as $tst_ref_id) { $tst_obj_id = ilObject::_lookupObjId($tst_ref_id); $options[$tst_ref_id] = ilObject::_lookupTitle($tst_obj_id); } $selectable = new ilSelectInputGUI($this->lng->txt('crs_loc_form_available_tsts'), 'tst'); $selectable->setRequired(true); $selectable->setOptions($options); $existing->addSubItem($selectable); $form->addItem($cr_mode); if ($a_as_multi_assignment) { include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignments.php'; $assignments = ilLOTestAssignments::getInstance($this->getContainer()->getId()); include_once './Modules/Course/classes/class.ilCourseObjective.php'; $objective_ids = ilCourseObjective::_getObjectiveIds($this->getContainer()->getId(), FALSE); $options = array(); $options[''] = $this->lng->txt('select_one'); foreach ($objective_ids as $oid) { $already_assigned_tst = $assignments->getTestByObjective($oid, $this->getTestType()); if (!$already_assigned_tst) { $options[$oid] = ilCourseObjective::lookupObjectiveTitle($oid); } } $objective = new ilSelectInputGUI($this->lng->txt('crs_objectives'), 'objective'); $objective->setRequired(TRUE); $objective->setOptions($options); $form->addItem($objective); } return $form; }
/** * Init 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); }
/** * Init profile form * * @param bool $a_insert * @return ilPropertyFormGUI */ protected function initForm($a_insert = false) { global $ilCtrl, $ilToolbar; $is_template = $this->getPageConfig()->getEnablePCType("PlaceHolder"); if (!$is_template) { $ilToolbar->addButton($this->lng->txt("cont_edit_personal_data"), $ilCtrl->getLinkTargetByClass("ilpersonaldesktopgui", "jumptoprofile"), "profile"); $lng_suffix = ""; } else { $lng_suffix = "_template"; } include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($ilCtrl->getFormAction($this)); if ($a_insert) { $form->setTitle($this->lng->txt("cont_insert_profile")); } else { $form->setTitle($this->lng->txt("cont_update_profile")); } $mode = new ilRadioGroupInputGUI($this->lng->txt("cont_profile_mode"), "mode"); $form->addItem($mode); $mode_inherit = new ilRadioOption($this->lng->txt("cont_profile_mode_inherit"), "inherit"); $mode_inherit->setInfo($this->lng->txt("cont_profile_mode" . $lng_suffix . "_inherit_info")); $mode->addOption($mode_inherit); $mode_manual = new ilRadioOption($this->lng->txt("cont_profile_mode_manual"), "manual"); $mode_manual->setInfo($this->lng->txt("cont_profile_mode_manual_info")); $mode->addOption($mode_manual); $prefs = array(); if ($a_insert) { $mode->setValue("inherit"); } else { $mode_value = $this->content_obj->getMode(); $mode->setValue($mode_value); $prefs = array(); if ($mode_value == "manual") { foreach ($this->content_obj->getFields() as $name) { $prefs["public_" . $name] = "y"; } } } // always has to be set $im_arr = array("icq", "yahoo", "msn", "aim", "skype", "jabber", "voip"); foreach ($im_arr as $im) { if (!isset($prefs["public_im_" . $im])) { $prefs["public_im_" . $im] = "n"; } } include_once "Services/User/classes/class.ilPersonalProfileGUI.php"; $profile = new ilPersonalProfileGUI(); $profile->showPublicProfileFields($form, $prefs, $mode_manual, $is_template); if ($a_insert) { $form->addCommandButton("create_profile", $this->lng->txt("save")); $form->addCommandButton("cancelCreate", $this->lng->txt("cancel")); } else { $form->addCommandButton("update", $this->lng->txt("save")); $form->addCommandButton("cancelUpdate", $this->lng->txt("cancel")); } return $form; }
public function showDetails() { global $ilMainMenu, $ilTabs, $ilToolbar, $ilUser; $this->__initPaymentObject(); $this->__initPricesObject(); $this->__initShoppingCartObject(); $ilToolbar->addButton($this->lng->txt('payment_back_to_shop'), 'ilias.php?baseClass=ilShopController'); $this->tpl->getStandardTemplate(); $ilTabs->setTabActive('buy'); $ilMainMenu->setActive('shop'); if ($this->pobject->getStatus() == $this->pobject->STATUS_EXPIRES) { ilUtil::sendInfo($this->lng->txt('pay_expires_info')); return false; } $extension_prices = array(); if ($ilUser->getId() != ANONYMOUS_USER_ID) { include_once './Services/Payment/classes/class.ilPaymentBookings.php'; $has_extension_price = ilPaymentBookings::_hasAccesstoExtensionPrice($ilUser->getId(), $this->pobject->getPobjectId()); if ($has_extension_price) { $extension_prices = $this->price_obj->getExtensionPrices(); } } $org_prices = $this->price_obj->getPrices(); $tmp_prices = array_merge($org_prices, $extension_prices); $prices = array(); foreach ($tmp_prices as $price) { // expired prices must be filtered out if ($price['price_type'] == ilPaymentPrices::TYPE_DURATION_DATE && $price['duration_until'] < date('Y-m-d')) { //do nothing } else { $prices[] = $price; } } include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this)); $buyedObject = ""; if ($this->sc_obj->isInShoppingCart($this->pobject->getPobjectId())) { $buyedObject = $this->sc_obj->getEntry($this->pobject->getPobjectId()); if (is_array($prices) && count($prices) > 1) { ilUtil::sendInfo($this->lng->txt('pay_item_already_in_sc_choose_another')); } else { ilUtil::sendInfo($this->lng->txt('pay_item_already_in_sc')); } } $this->ctrl->setParameter($this, "ref_id", $this->pobject->getRefId()); $subtype = ''; if ($this->object) { if ($this->object->getType() == 'exc') { $subtype = ' (' . $this->lng->txt($this->pobject->getSubtype()) . ')'; } $form->setTitle($this->object->getTitle() . ' ' . $subtype); $form->setTitleIcon(ilObject::_getIcon($this->object->getId())); } else { ilUtil::sendFailure($this->lng->txt('object_not_found')); } // payment infos $info = new ilNonEditableValueGUI($this->lng->txt('info')); $info->setValue($this->lng->txt('pay_info')); $form->addItem($info); if (is_array($buyedObject)) { if (is_array($prices) && count($prices) > 1) { $button_txt = $this->lng->txt('pay_change_price'); } else { $button_txt = $this->lng->txt('pay_add_to_shopping_cart'); } } else { $button_txt = $this->lng->txt('pay_add_to_shopping_cart'); } $rg_prices = new ilRadioGroupInputGUI($this->lng->txt('prices'), 'price_id'); if (is_array($prices)) { foreach ($prices as $price) { if (is_array($buyedObject) && $buyedObject["price_id"] == $price['price_id']) { $rg_prices->setValue($price['price_id']); } else { if (count($prices) == 1) { $rg_prices->setValue($price['price_id']); } } switch ($price['price_type']) { case ilPaymentPrices::TYPE_DURATION_MONTH: $txt_price = $price['duration'] . ' ' . $this->lng->txt('paya_months') . ': '; break; case ilPaymentPrices::TYPE_DURATION_DATE: $txt_price = ilDatePresentation::formatDate(new ilDate($price['duration_from'], IL_CAL_DATE)) . ' - ' . ilDatePresentation::formatDate(new ilDate($price['duration_until'], IL_CAL_DATE)) . ': '; break; case ilPaymentPrices::TYPE_UNLIMITED_DURATION: $txt_price = $this->lng->txt('unlimited_duration') . ': '; break; } $tmp_price = $price['price']; $extension_txt = ''; if ($price['extension'] == 1) { $extension_txt = '(' . $this->lng->txt('extension_price') . ')'; } $price_row = new ilRadioOption($txt_price . ' ' . ilPaymentPrices::_formatPriceToString((double) $tmp_price) . ' ' . $extension_txt, $price['price_id']); $price_row->setInfo($price['description']); $rg_prices->addOption($price_row); } $form->addItem($rg_prices); } $form->addCommandButton('addToShoppingCart', $button_txt); return $this->tpl->setContent($form->getHTML()); }
protected function initQuestionForm($a_read_only = false) { global $lng, $ilCtrl; include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($ilCtrl->getFormAction($this, "saveQuestion")); $form->setTitle($lng->txt("obj_poll")); $question = new ilTextAreaInputGUI($lng->txt("poll_question"), "question"); $question->setRequired(true); $question->setCols(40); $question->setRows(2); $question->setValue($this->object->getQuestion()); $question->setDisabled($a_read_only); $form->addItem($question); $dimensions = " (" . ilObjPoll::getImageSize() . "px)"; $img = new ilImageFileInputGUI($lng->txt("poll_image") . $dimensions, "image"); $img->setDisabled($a_read_only); $form->addItem($img); // show existing file $file = $this->object->getImageFullPath(true); if ($file) { $img->setImage($file); } $anonymous = new ilRadioGroupInputGUI($lng->txt("poll_mode"), "mode"); $anonymous->setRequired(true); $option = new ilRadioOption($lng->txt("poll_mode_anonymous"), 0); $option->setInfo($lng->txt("poll_mode_anonymous_info")); $anonymous->addOption($option); $option = new ilRadioOption($lng->txt("poll_mode_personal"), 1); $option->setInfo($lng->txt("poll_mode_personal_info")); $anonymous->addOption($option); $anonymous->setValue($this->object->getNonAnonymous()); $anonymous->setDisabled($a_read_only); $form->addItem($anonymous); $nanswers = new ilNumberInputGUI($lng->txt("poll_max_number_of_answers"), "nanswers"); $nanswers->setRequired(true); $nanswers->setMinValue(1); $nanswers->setSize(3); $nanswers->setValue($this->object->getMaxNumberOfAnswers()); $nanswers->setDisabled($a_read_only); $form->addItem($nanswers); $answers = new ilTextInputGUI($lng->txt("poll_answers"), "answers"); $answers->setRequired(true); $answers->setMulti(true, true); $answers->setDisabled($a_read_only); $form->addItem($answers); $multi_answers = array(); foreach ($this->object->getAnswers() as $idx => $item) { if (!$idx) { $answers->setValue($item["answer"]); } $multi_answers[] = $item["answer"]; } $answers->setMultiValues($multi_answers); if (!$a_read_only) { $form->addCommandButton("saveQuestion", $lng->txt("save")); } return $form; }
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); }
/** * add type specific input fields to a form * * @param object form, property or radio option * @param array (assoc) input values * @param string configuration level ("type" or "object") * @param string parent field value * @param string parent option value * @param int maximum recursion depth */ function addFormElements($a_object, $a_values = array(), $a_level = "object", $a_parentfield = '', $a_parentvalue = '', $a_maxdepth = "3") { // recursion end if ($a_maxdepth == 0) { return; } foreach ($this->getInputFields($a_level, $a_parentfield, $a_parentvalue) as $field) { $value = $a_values['field_' . $field->field_name]; $value = $value ? $value : $field->default; switch ($field->field_type) { case self::FIELDTYPE_HEADER: $item = new ilFormSectionHeaderGUI(); $item->setTitle($field->title); break; case self::FIELDTYPE_DESCRIPTION: $item = new ilCustomInputGUI($field->title); $item->setHtml(nl2br($field->description)); break; case self::FIELDTYPE_TEXT: $item = new ilTextInputGUI($field->title, 'field_' . $field->field_name); $item->setInfo($field->description); $item->setRequired($field->required ? true : false); $item->setSize($field->size); $item->setValue($value); break; case self::FIELDTYPE_TEXTAREA: $item = new ilTextAreaInputGUI($field->title, 'field_' . $field->field_name); $item->setInfo($field->description); $item->setRequired($field->required ? true : false); $item->setUseRte($field->richtext ? true : false); $item->setRows($field->rows); $item->setCols($field->cols); $item->setValue($value); break; case self::FIELDTYPE_PASSWORD: $item = new ilPasswordInputGUI($field->title, 'field_' . $field->field_name); $item->setInfo($field->description); $item->setRequired($field->required ? true : false); $item->setValue($value); break; case self::FIELDTYPE_CHECKBOX: $item = new ilCheckboxInputGUI($field->title, 'field_' . $field->field_name); $item->setInfo($field->description); if ($value) { $item->setChecked(true); } break; case self::FIELDTYPE_RADIO: $item = new ilRadioGroupInputGUI($field->title, 'field_' . $field->field_name); $item->setInfo($field->description); $item->setValue($value); foreach ($field->options as $option) { $ropt = new ilRadioOption($option->title, $option->value); $ropt->setInfo($option->description); // add the sub items to the option $item->addOption($ropt); $this->addFormElements($ropt, $a_values, $a_level, $field->field_name, $option->value, $a_maxdepth - 1); } break; default: continue 2; } // add the item to the form or to the parent item if (is_a($a_object, 'ilPropertyFormGUI')) { $a_object->addItem($item); } else { $a_object->addSubItem($item); } // add the sub items to the item if (is_a($item, 'ilSubEnabledFormPropertyGUI')) { $this->addFormElements($item, $a_level, $a_values, $field->field_name, '', $a_maxdepth - 1); } } }
/** * display survey settings form * * Default settings tab for Survey settings * * @access public */ function settingsObject() { global $ilAccess, $rbacreview, $lng, $ilCtrl, $tpl, $ilTabs; $ilTabs->activateTab("settings"); $surveySetting = new ilSetting("survey"); $unlimited_invitation = array_key_exists("unlimited_invitation", $_GET) ? $_GET["unlimited_invitation"] : $surveySetting->get("unlimited_invitation"); $use_anonymous_id = array_key_exists("use_anonymous_id", $_GET) ? $_GET["use_anonymous_id"] : $surveySetting->get("use_anonymous_id"); include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($ilCtrl->getFormAction($this)); $form->setTitle($lng->txt("survey_defaults")); // unlimited invitation $enable = new ilCheckboxInputGUI($lng->txt("survey_unlimited_invitation"), "unlimited_invitation"); $enable->setChecked($unlimited_invitation); $enable->setInfo($lng->txt("survey_unlimited_invitation_desc")); $form->addItem($enable); // Survey Code $code = new ilCheckboxInputGUI($lng->txt("use_anonymous_id"), "use_anonymous_id"); $code->setChecked($use_anonymous_id); $code->setInfo($lng->txt("use_anonymous_id_desc")); $form->addItem($code); // Skipped $eval_skipped = new ilRadioGroupInputGUI($lng->txt("svy_eval_skipped_value"), "skcust"); $eval_skipped->setRequired(true); $form->addItem($eval_skipped); $eval_skipped->setValue($surveySetting->get("skipped_is_custom", false) ? "cust" : "lng"); $skipped_lng = new ilRadioOption($lng->txt("svy_eval_skipped_value_lng"), "lng"); $skipped_lng->setInfo(sprintf($lng->txt("svy_eval_skipped_value_lng_info"), $lng->txt("skipped"))); $eval_skipped->addOption($skipped_lng); $skipped_cust = new ilRadioOption($lng->txt("svy_eval_skipped_value_custom"), "cust"); $skipped_cust->setInfo($lng->txt("svy_eval_skipped_value_custom_info")); $eval_skipped->addOption($skipped_cust); $skipped_cust_value = new ilTextInputGUI($lng->txt("svy_eval_skipped_value_custom_value"), "cust_value"); $skipped_cust_value->setSize(15); $skipped_cust_value->setValue($surveySetting->get("skipped_custom_value", "")); $skipped_cust->addSubItem($skipped_cust_value); if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) { $form->addCommandButton("saveSettings", $lng->txt("save")); } $tpl->setVariable("ADM_CONTENT", $form->getHTML()); }
private function addResultDetailsSettingsFormSection(ilPropertyFormGUI $form) { // HEADER: result settings $header_tr = new ilFormSectionHeaderGUI(); $header_tr->setTitle($this->lng->txt('tst_results_details_options')); $form->addItem($header_tr); // show solution details $showSolutionDetails = new ilCheckboxInputGUI($this->lng->txt('tst_show_solution_details'), 'solution_details'); $showSolutionDetails->setInfo($this->lng->txt('tst_show_solution_details_desc')); $showSolutionDetails->setChecked($this->testOBJ->getShowSolutionDetails()); $form->addItem($showSolutionDetails); // best solution in test results $results_print_best_solution = new ilCheckboxInputGUI($this->lng->txt('tst_results_print_best_solution'), 'print_bs_with_res'); $results_print_best_solution->setInfo($this->lng->txt('tst_results_print_best_solution_info')); $results_print_best_solution->setChecked((bool) $this->testOBJ->isBestSolutionPrintedWithResult()); $showSolutionDetails->addSubItem($results_print_best_solution); // show solution feedback ==> solution feedback in test results $showSolutionFeedbackOption = new ilCheckboxInputGUI($this->lng->txt('tst_show_solution_feedback'), 'solution_feedback'); $showSolutionFeedbackOption->setInfo($this->lng->txt('tst_show_solution_feedback_desc')); $showSolutionFeedbackOption->setChecked($this->testOBJ->getShowSolutionFeedback()); $form->addItem($showSolutionFeedbackOption); // show suggested solution $showSuggestedSolutionOption = new ilCheckboxInputGUI($this->lng->txt('tst_show_solution_suggested'), 'solution_suggested'); $showSuggestedSolutionOption->setInfo($this->lng->txt('tst_show_solution_suggested_desc')); $showSuggestedSolutionOption->setChecked($this->testOBJ->getShowSolutionSuggested()); $form->addItem($showSuggestedSolutionOption); // show solution printview ==> list of answers $showSolutionPrintview = new ilCheckboxInputGUI($this->lng->txt('tst_show_solution_printview'), 'solution_printview'); $showSolutionPrintview->setInfo($this->lng->txt('tst_show_solution_printview_desc')); $showSolutionPrintview->setChecked($this->testOBJ->getShowSolutionPrintview()); $form->addItem($showSolutionPrintview); // show best solution in list of answers $solutionCompareInput = new ilCheckboxInputGUI($this->lng->txt('tst_show_solution_compare'), 'solution_compare'); $solutionCompareInput->setChecked($this->testOBJ->getShowSolutionListComparison()); $showSolutionPrintview->addSubItem($solutionCompareInput); // solution answers only ==> printview of results (answers only) $solutionAnswersOnly = new ilCheckboxInputGUI($this->lng->txt('tst_show_solution_answers_only'), 'solution_answers_only'); $solutionAnswersOnly->setInfo($this->lng->txt('tst_show_solution_answers_only_desc')); $solutionAnswersOnly->setChecked($this->testOBJ->getShowSolutionAnswersOnly()); $showSolutionPrintview->addSubItem($solutionAnswersOnly); // high score $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_tables = new ilRadioGroupInputGUI($this->lng->txt('tst_highscore_mode'), 'highscore_mode'); $highscore_tables->setRequired(true); $highscore_tables->setValue($this->testOBJ->getHighscoreMode()); $highscore_table_own = new ilRadioOption($this->lng->txt('tst_highscore_own_table'), ilObjTest::HIGHSCORE_SHOW_OWN_TABLE); $highscore_table_own->setInfo($this->lng->txt('tst_highscore_own_table_description')); $highscore_tables->addOption($highscore_table_own); $highscore_table_other = new ilRadioOption($this->lng->txt('tst_highscore_top_table'), ilObjTest::HIGHSCORE_SHOW_TOP_TABLE); $highscore_table_other->setInfo($this->lng->txt('tst_highscore_top_table_description')); $highscore_tables->addOption($highscore_table_other); $highscore_table_other = new ilRadioOption($this->lng->txt('tst_highscore_all_tables'), ilObjTest::HIGHSCORE_SHOW_ALL_TABLES); $highscore_table_other->setInfo($this->lng->txt('tst_highscore_all_tables_description')); $highscore_tables->addOption($highscore_table_other); $highscore->addSubItem($highscore_tables); $highscore_top_num = new ilNumberInputGUI($this->lng->txt("tst_highscore_top_num"), "highscore_top_num"); $highscore_top_num->setSize(4); $highscore_top_num->setRequired(true); $highscore_top_num->setMinValue(1); $highscore_top_num->setSuffix($this->lng->txt("tst_highscore_top_num_unit")); $highscore_top_num->setValue($this->testOBJ->getHighscoreTopNum(null)); $highscore_top_num->setInfo($this->lng->txt("tst_highscore_top_num_description")); $highscore->addSubItem($highscore_top_num); $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); // show signature placeholder $showSignaturePlaceholder = new ilCheckboxInputGUI($this->lng->txt('tst_show_solution_signature'), 'solution_signature'); $showSignaturePlaceholder->setInfo($this->lng->txt('tst_show_solution_signature_desc')); $showSignaturePlaceholder->setChecked($this->testOBJ->getShowSolutionSignature()); if ($this->testOBJ->getAnonymity()) { $showSignaturePlaceholder->setDisabled(true); } $form->addItem($showSignaturePlaceholder); // show signature placeholder $showExamId = new ilCheckboxInputGUI($this->lng->txt('examid_in_test_res'), 'examid_in_test_res'); $showExamId->setInfo($this->lng->txt('examid_in_test_res_desc')); $showExamId->setChecked($this->testOBJ->isShowExamIdInTestResultsEnabled()); $form->addItem($showExamId); // export settings $export_settings = new ilCheckboxInputGUI($this->lng->txt('tst_exp_sc_short'), 'exp_sc_short'); $export_settings->setInfo($this->lng->txt('tst_exp_sc_short_desc')); $export_settings->setChecked($this->testOBJ->getExportSettingsSingleChoiceShort()); $form->addItem($export_settings); }
/** * Shoew add role * @global type $rbacreview * @global type $objDefinition * @return ilPropertyFormGUI */ protected function initRoleForm() { global $rbacreview, $objDefinition; include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this)); $form->setTitle($this->lng->txt('role_new')); $form->addCommandButton('addrole', $this->lng->txt('role_new')); $form->addCommandButton('perm', $this->lng->txt('cancel')); $title = new ilTextInputGUI($this->lng->txt('title'), 'title'); $title->setValidationRegexp('/^(?!il_).*$/'); $title->setValidationFailureMessage($this->lng->txt('msg_role_reserved_prefix')); $title->setSize(40); $title->setMaxLength(70); $title->setRequired(true); $form->addItem($title); $desc = new ilTextAreaInputGUI($this->lng->txt('description'), 'desc'); $desc->setCols(40); $desc->setRows(3); $form->addItem($desc); $pro = new ilCheckboxInputGUI($this->lng->txt('role_protect_permissions'), 'pro'); $pro->setInfo($this->lng->txt('role_protect_permissions_desc')); $pro->setValue(1); $form->addItem($pro); $pd = new ilCheckboxInputGUI($this->lng->txt('rbac_role_add_to_desktop'), 'desktop'); $pd->setInfo($this->lng->txt('rbac_role_add_to_desktop_info')); $pd->setValue(1); $form->addItem($pd); if (!$this->isInAdministration()) { $rights = new ilRadioGroupInputGUI($this->lng->txt("rbac_role_rights_copy"), 'rights'); $option = new ilRadioOption($this->lng->txt("rbac_role_rights_copy_empty"), 0); $rights->addOption($option); $parent_role_ids = $rbacreview->getParentRoleIds($this->gui_obj->object->getRefId(), true); $ids = array(); foreach ($parent_role_ids as $id => $tmp) { $ids[] = $id; } // Sort ids $sorted_ids = ilUtil::_sortIds($ids, 'object_data', 'type DESC,title', 'obj_id'); // Sort roles by title $sorted_roles = ilUtil::sortArray(array_values($parent_role_ids), 'title', ASC); $key = 0; foreach ($sorted_ids as $id) { $par = $parent_role_ids[$id]; if ($par["obj_id"] != SYSTEM_ROLE_ID) { include_once './Services/AccessControl/classes/class.ilObjRole.php'; $option = new ilRadioOption(($par["type"] == 'role' ? $this->lng->txt('obj_role') : $this->lng->txt('obj_rolt')) . ": " . ilObjRole::_getTranslation($par["title"]), $par["obj_id"]); $option->setInfo($par["desc"]); $rights->addOption($option); } $key++; } $form->addItem($rights); } // Local policy only for containers if ($objDefinition->isContainer($this->getCurrentObject()->getType())) { $check = new ilCheckboxInputGui($this->lng->txt("rbac_role_rights_copy_change_existing"), 'existing'); $check->setInfo($this->lng->txt('rbac_change_existing_objects_desc_new_role')); $form->addItem($check); } return $form; }
function initEditForm() { $this->lng->loadLanguageModule($this->object->getType()); $this->setEditTabs(); include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this)); $form->setTitle($this->lng->txt($this->object->getType() . "_edit")); // Show didactic template type $this->initDidacticTemplate($form); // sorting include_once 'Services/Container/classes/class.ilContainerSortingSettings.php'; $settings = new ilContainerSortingSettings($this->object->getId()); $sort = new ilRadioGroupInputGUI($this->lng->txt('sorting_header'), "sorting"); $sort_title = new ilRadioOption($this->lng->txt('sorting_title_header'), ilContainer::SORT_TITLE); $sort_title->setInfo($this->lng->txt('sorting_info_title')); $sort->addOption($sort_title); $sort_manual = new ilRadioOption($this->lng->txt('sorting_manual_header'), ilContainer::SORT_MANUAL); $sort_manual->setInfo($this->lng->txt('sorting_info_manual')); $sort->addOption($sort_manual); $sort->setValue($settings->getSortMode()); $form->addItem($sort); $this->showCustomIconsEditing(1, $form, false); // Edit ecs export settings include_once 'Modules/Category/classes/class.ilECSCategorySettings.php'; $ecs = new ilECSCategorySettings($this->object); $ecs->addSettingsToForm($form, 'cat'); $form->addCommandButton("update", $this->lng->txt("save")); $form->addCommandButton("addTranslation", $this->lng->txt("add_translation")); return $form; }
public function displayCache() { require_once 'Services/Form/classes/class.ilPropertyFormGUI.php'; require_once 'Services/GlobalCache/classes/class.ilGlobalCache.php'; $this->checkDisplayMode('setup_cache'); /** * @var $ini ilIniFile */ $ini = $this->setup->getClient()->ini; $cache_form = new ilPropertyFormGUI(); $cache_form->setTitle($this->lng->txt('global_cache_configuration')); $cache_form->addCommandButton('saveCache', $this->lng->txt('save')); $cache_form->setFormAction('setup.php?cmd=gateway'); $activate_global_cache = 'activate_global_cache'; $global_cache_service_type = 'global_cache_service_type'; $activate_cache = new ilCheckboxInputGUI($this->lng->txt($activate_global_cache), $activate_global_cache); $activate_cache->setChecked($ini->readVariable('cache', $activate_global_cache)); $service_type = new ilRadioGroupInputGUI($this->lng->txt($global_cache_service_type), $global_cache_service_type); $some_inactive = false; $message = ''; foreach (ilGlobalCache::getAllTypes() as $type) { $option = new ilRadioOption($this->lng->txt($global_cache_service_type . '_' . $type->getServiceType()), $type->getServiceType()); $option->setInfo($this->lng->txt('global_cache_install_info_' . $type->getServiceType())); if (!$type->isCacheServiceInstallable()) { $option->setDisabled(true); $message .= $this->lng->txt($global_cache_service_type . '_' . $type->getServiceType()) . ': ' . $type->getInstallationFailureReason() . '; '; $some_inactive = true; } $service_type->addOption($option); } if ($some_inactive) { $service_type->setAlert($message); ilUtil::sendInfo($this->lng->txt('global_cache_supported_services')); } $service_type->setValue($ini->readVariable('cache', $global_cache_service_type)); $activate_cache->addSubItem($service_type); $cache_form->addItem($activate_cache); $this->tpl->setVariable('SETUP_CONTENT', $cache_form->getHTML()); }
private function buildSettingsForm() { /** * @var $ilAccess ilAccessHandler */ global $ilAccess; include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php"; include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this)); $form->setTableWidth("100%"); $form->setId("settings"); $header = new ilFormSectionHeaderGUI(); $header->setTitle($this->lng->txt('settings')); $form->addItem($header); // question process locking behaviour (e.g. on saving users working data) $chb = new ilCheckboxInputGUI($this->lng->txt('ass_process_lock'), 'ass_process_lock'); $chb->setChecked($this->object->getAssessmentProcessLockMode() != ilObjAssessmentFolder::ASS_PROC_LOCK_MODE_NONE); $chb->setInfo($this->lng->txt('ass_process_lock_desc')); $form->addItem($chb); $rg = new ilRadioGroupInputGUI($this->lng->txt('ass_process_lock_mode'), 'ass_process_lock_mode'); $rg->setRequired(true); $opt = new ilRadioOption($this->lng->txt('ass_process_lock_mode_file'), ilObjAssessmentFolder::ASS_PROC_LOCK_MODE_FILE); $opt->setInfo($this->lng->txt('ass_process_lock_mode_file_desc')); $rg->addOption($opt); $opt = new ilRadioOption($this->lng->txt('ass_process_lock_mode_db'), ilObjAssessmentFolder::ASS_PROC_LOCK_MODE_DB); $opt->setInfo($this->lng->txt('ass_process_lock_mode_db_desc')); $rg->addOption($opt); if ($this->object->getAssessmentProcessLockMode() != ilObjAssessmentFolder::ASS_PROC_LOCK_MODE_NONE) { $rg->setValue($this->object->getAssessmentProcessLockMode()); } $chb->addSubItem($rg); $assessmentSetting = new ilSetting('assessment'); $imap_line_color = array_key_exists('imap_line_color', $_GET) ? $_GET['imap_line_color'] : $assessmentSetting->get('imap_line_color'); if (strlen($imap_line_color) == 0) { $imap_line_color = 'FF0000'; } $linepicker = new ilColorPickerInputGUI($this->lng->txt('assessment_imap_line_color'), 'imap_line_color'); $linepicker->setValue($imap_line_color); $form->addItem($linepicker); $user_criteria = array_key_exists('user_criteria', $_GET) ? $_GET['user_criteria'] : $assessmentSetting->get('user_criteria'); $userCriteria = new ilSelectInputGUI($this->lng->txt('user_criteria'), 'user_criteria'); $userCriteria->setInfo($this->lng->txt('user_criteria_desc')); $userCriteria->setRequired(true); $fields = array('usr_id', 'login', 'email', 'matriculation', 'ext_account'); $usr_fields = array(); foreach ($fields as $field) { $usr_fields[$field] = $field; } $userCriteria->setOptions($usr_fields); $userCriteria->setValue($user_criteria); $form->addItem($userCriteria); // question settings $header = new ilFormSectionHeaderGUI(); $header->setTitle($this->lng->txt("assf_questiontypes")); $form->addItem($header); // available question types $allowed = new ilCheckboxGroupInputGUI($this->lng->txt('assf_allowed_questiontypes'), "chb_allowed_questiontypes"); $questiontypes =& ilObjQuestionPool::_getQuestionTypes(TRUE); $forbidden_types = $this->object->_getForbiddenQuestionTypes(); $allowedtypes = array(); foreach ($questiontypes as $qt) { if (!in_array($qt['question_type_id'], $forbidden_types)) { array_push($allowedtypes, $qt['question_type_id']); } } $allowed->setValue($allowedtypes); foreach ($questiontypes as $type_name => $qtype) { $allowed->addOption(new ilCheckboxOption($type_name, $qtype["question_type_id"])); } $allowed->setInfo($this->lng->txt('assf_allowed_questiontypes_desc')); $form->addItem($allowed); // manual scoring $manual = new ilCheckboxGroupInputGUI($this->lng->txt('assessment_log_manual_scoring_activate'), "chb_manual_scoring"); $manscoring = $this->object->_getManualScoring(); $manual->setValue($manscoring); foreach ($questiontypes as $type_name => $qtype) { $manual->addOption(new ilCheckboxOption($type_name, $qtype["question_type_id"])); } $manual->setInfo($this->lng->txt('assessment_log_manual_scoring_desc')); $form->addItem($manual); // scoring adjustment active $scoring_activation = new ilCheckboxInputGUI($this->lng->txt('assessment_scoring_adjust'), 'chb_scoring_adjust'); $scoring_activation->setChecked($this->object->getScoringAdjustmentEnabled()); $scoring_activation->setInfo($this->lng->txt('assessment_scoring_adjust_desc')); $form->addItem($scoring_activation); // scoring adjustment $scoring = new ilCheckboxGroupInputGUI($this->lng->txt('assessment_log_scoring_adjustment_activate'), "chb_scoring_adjustment"); $scoring_active = $this->object->getScoringAdjustableQuestions(); $scoring->setValue($scoring_active); foreach ($questiontypes as $type_name => $qtype) { $scoring->addOption(new ilCheckboxOption($type_name, $qtype["question_type_id"])); } $scoring->setInfo($this->lng->txt('assessment_log_scoring_adjustment_desc')); $form->addItem($scoring); if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) { $form->addCommandButton("saveSettings", $this->lng->txt("save")); } return $form; }
protected function initPhrasesForm() { include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this, "addSelectedPhrase")); $form->setTitle($this->lng->txt("add_phrase")); // $form->setDescription($this->lng->txt("add_phrase_introduction")); $group = new ilRadioGroupInputGUI($this->lng->txt("phrase"), "phrases"); $group->setRequired(true); $form->addItem($group); include_once "./Modules/SurveyQuestionPool/classes/class.ilSurveyPhrases.php"; foreach (ilSurveyPhrases::_getAvailablePhrases() as $phrase_id => $phrase_array) { $categories = ilSurveyPhrases::_getCategoriesForPhrase($phrase_id); $opt = new ilRadioOption($phrase_array["title"], $phrase_id); $opt->setInfo(join($categories, ",")); $group->addOption($opt); if ($phrase_array["org_title"] == "dp_standard_numbers") { $min = new ilNumberInputGUI($this->lng->txt("lower_limit"), "lower_limit"); $min->setRequired(true); $min->setSize(5); $opt->addSubItem($min); $max = new ilNumberInputGUI($this->lng->txt("upper_limit"), "upper_limit"); $max->setRequired(true); $max->setSize(5); $opt->addSubItem($max); } } $form->addCommandButton("addSelectedPhrase", $this->lng->txt("add_phrase")); $form->addCommandButton("editQuestion", $this->lng->txt("cancel")); return $form; }
/** * Append sorting settings to property form * @param ilPropertyFormGUI $form * @param type $a_sorting_settings */ protected function initSortingForm(ilPropertyFormGUI $form, array $a_sorting_settings) { include_once 'Services/Container/classes/class.ilContainerSortingSettings.php'; include_once './Services/Container/classes/class.ilContainer.php'; $settings = new ilContainerSortingSettings($this->object->getId()); $sort = new ilRadioGroupInputGUI($this->lng->txt('sorting_header'), "sorting"); if (in_array(ilContainer::SORT_INHERIT, $a_sorting_settings)) { $sort_inherit = new ilRadioOption(); $sort_inherit->setTitle($this->lng->txt('sort_inherit_prefix') . ' (' . ilContainerSortingSettings::sortModeToString(ilContainerSortingSettings::lookupSortModeFromParentContainer($this->object->getId())) . ') '); $sort_inherit->setValue(ilContainer::SORT_INHERIT); $sort_inherit->setInfo($this->lng->txt('sorting_info_inherit')); $sort->addOption($sort_inherit); } if (in_array(ilContainer::SORT_TITLE, $a_sorting_settings)) { $sort_title = new ilRadioOption($this->lng->txt('sorting_title_header'), ilContainer::SORT_TITLE); $sort_title->setInfo($this->lng->txt('sorting_info_title')); $this->initSortingDirectionForm($settings, $sort_title, 'title'); $sort->addOption($sort_title); } if (in_array(ilContainer::SORT_CREATION, $a_sorting_settings)) { $sort_activation = new ilRadioOption($this->lng->txt('sorting_creation_header'), ilContainer::SORT_CREATION); $sort_activation->setInfo($this->lng->txt('sorting_creation_info')); $this->initSortingDirectionForm($settings, $sort_activation, 'creation'); $sort->addOption($sort_activation); } if (in_array(ilContainer::SORT_ACTIVATION, $a_sorting_settings)) { $sort_activation = new ilRadioOption($this->lng->txt('crs_sort_activation'), ilContainer::SORT_ACTIVATION); $sort_activation->setInfo($this->lng->txt('crs_sort_timing_info')); $this->initSortingDirectionForm($settings, $sort_activation, 'activation'); $sort->addOption($sort_activation); } if (in_array(ilContainer::SORT_MANUAL, $a_sorting_settings)) { $sort_manual = new ilRadioOption($this->lng->txt('sorting_manual_header'), ilContainer::SORT_MANUAL); $sort_manual->setInfo($this->lng->txt('sorting_info_manual')); $this->initManualSortingOptionForm($settings, $sort_manual, "manual", $a_sorting_settings); $sort->addOption($sort_manual); } $sort->setValue($settings->getSortMode()); $form->addItem($sort); return $form; }
/** * Init form table for new role assignments * * @param string mode edit | create * @param object object of ilLDAPRoleAsssignmentRule * @access protected * */ protected function initFormRoleAssignments($a_mode) { include_once 'Services/Form/classes/class.ilPropertyFormGUI.php'; include_once 'Services/LDAP/classes/class.ilLDAPRoleAssignmentRule.php'; $this->form = new ilPropertyFormGUI(); $this->form->setFormAction($this->ctrl->getFormAction($this)); switch ($a_mode) { case 'edit': $this->form->setTitle($this->lng->txt('ldap_edit_role_ass_rule')); $this->form->addCommandButton('updateRoleAssignment', $this->lng->txt('save')); $this->form->addCommandButton('roleAssignments', $this->lng->txt('cancel')); break; case 'create': $this->form->setTitle($this->lng->txt('ldap_add_role_ass_rule')); $this->form->addCommandButton('addRoleAssignment', $this->lng->txt('ldap_btn_add_role_ass')); $this->form->addCommandButton('roleAssignments', $this->lng->txt('cancel')); break; } // Role Selection $role = new ilRadioGroupInputGUI($this->lng->txt('ldap_ilias_role'), 'role_name'); $role->setRequired(true); $global = new ilRadioOption($this->lng->txt('ldap_global_role'), 0); $role->addOption($global); $role_select = new ilSelectInputGUI('', 'role_id'); $role_select->setOptions($this->prepareGlobalRoleSelection()); $global->addSubItem($role_select); $local = new ilRadioOption($this->lng->txt('ldap_local_role'), 1); $role->addOption($local); include_once './Services/Form/classes/class.ilRoleAutoCompleteInputGUI.php'; $role_search = new ilRoleAutoCompleteInputGUI('', 'role_search', $this, 'addRoleAutoCompleteObject'); $role_search->setSize(40); $local->addSubItem($role_search); $role->setInfo($this->lng->txt('ldap_role_name_info')); $this->form->addItem($role); // Update options $update = new ilNonEditableValueGUI($this->lng->txt('ldap_update_roles'), 'update_roles'); $update->setValue($this->lng->txt('ldap_check_role_assignment')); $add = new ilCheckboxInputGUI('', 'add_missing'); $add->setOptionTitle($this->lng->txt('ldap_add_missing')); $update->addSubItem($add); $remove = new ilCheckboxInputGUI('', 'remove_deprecated'); $remove->setOptionTitle($this->lng->txt('ldap_remove_deprecated')); $update->addSubItem($remove); $this->form->addItem($update); // Assignment Type $group = new ilRadioGroupInputGUI($this->lng->txt('ldap_assignment_type'), 'type'); #$group->setValue($current_rule->getType()); $group->setRequired(true); // Option by group $radio_group = new ilRadioOption($this->lng->txt('ldap_role_by_group'), ilLDAPRoleAssignmentRule::TYPE_GROUP); $dn = new ilTextInputGUI($this->lng->txt('ldap_group_dn'), 'dn'); #$dn->setValue($current_rule->getDN()); $dn->setSize(32); $dn->setMaxLength(512); $dn->setInfo($this->lng->txt('ldap_role_grp_dn_info')); $radio_group->addSubItem($dn); $at = new ilTextInputGUI($this->lng->txt('ldap_role_grp_at'), 'at'); #$at->setValue($current_rule->getMemberAttribute()); $at->setSize(16); $at->setMaxLength(128); $radio_group->addSubItem($at); $isdn = new ilCheckboxInputGUI($this->lng->txt('ldap_role_grp_isdn'), 'isdn'); #$isdn->setChecked($current_rule->isMemberAttributeDN()); $isdn->setInfo($this->lng->txt('ldap_group_member_info')); $radio_group->addSubItem($isdn); $radio_group->setInfo($this->lng->txt('ldap_role_grp_info')); $group->addOption($radio_group); // Option by Attribute $radio_attribute = new ilRadioOption($this->lng->txt('ldap_role_by_attribute'), ilLDAPRoleAssignmentRule::TYPE_ATTRIBUTE); $name = new ilTextInputGUI($this->lng->txt('ldap_role_at_name'), 'name'); #$name->setValue($current_rule->getAttributeName()); $name->setSize(32); $name->setMaxLength(128); #$name->setInfo($this->lng->txt('ldap_role_at_name_info')); $radio_attribute->addSubItem($name); // Radio Attribute $val = new ilTextInputGUI($this->lng->txt('ldap_role_at_value'), 'value'); #$val->setValue($current_rule->getAttributeValue()); $val->setSize(32); $val->setMaxLength(128); #$val->setInfo($this->lng->txt('ldap_role_at_value_info')); $radio_attribute->addSubItem($val); $radio_attribute->setInfo($this->lng->txt('ldap_role_at_info')); $group->addOption($radio_attribute); // Option by Plugin $pl_active = (bool) $this->hasActiveRoleAssignmentPlugins(); $pl = new ilRadioOption($this->lng->txt('ldap_plugin'), 3); $pl->setInfo($this->lng->txt('ldap_plugin_info')); $pl->setDisabled(!$pl_active); $id = new ilNumberInputGUI($this->lng->txt('ldap_plugin_id'), 'plugin_id'); $id->setDisabled(!$pl_active); $id->setSize(3); $id->setMaxLength(3); $id->setMaxValue(999); $id->setMinValue(1); $pl->addSubItem($id); $group->addOption($pl); $this->form->addItem($group); }
/** * Init 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")); $def_opt = new ilRadioOption($this->lng->txt("adm_user_starting_point_inherit"), 0); $def_opt->setInfo($this->lng->txt("adm_user_starting_point_inherit_info")); $si->addOption($def_opt); foreach (ilUserUtil::getPossibleStartingPoints() as $value => $caption) { $si->addOption(new ilRadioOption($caption, $value)); } $si->setValue(ilUserUtil::hasPersonalStartPointPref() ? ilUserUtil::getPersonalStartingPoint() : 0); $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)); }
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; }
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 survey settings form * * @return ilPropertyFormGUI */ function initPropertiesForm() { $template_settings = $hide_rte_switch = null; $template = $this->object->getTemplate(); if ($template) { include_once "Services/Administration/classes/class.ilSettingsTemplate.php"; $template = new ilSettingsTemplate($template); $template_settings = $template->getSettings(); $hide_rte_switch = $template_settings["rte_switch"]["hide"]; } include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this)); $form->setTableWidth("100%"); $form->setId("survey_properties"); // general properties $header = new ilFormSectionHeaderGUI(); $header->setTitle($this->lng->txt("settings")); $form->addItem($header); // title & description (meta data) include_once 'Services/MetaData/classes/class.ilMD.php'; $md_obj = new ilMD($this->object->getId(), 0, "svy"); $md_section = $md_obj->getGeneral(); $title = new ilTextInputGUI($this->lng->txt("title"), "title"); $title->setRequired(true); $title->setValue($md_section->getTitle()); $form->addItem($title); $ids = $md_section->getDescriptionIds(); if ($ids) { $desc_obj = $md_section->getDescription(array_pop($ids)); $desc = new ilTextAreaInputGUI($this->lng->txt("description"), "description"); $desc->setCols(50); $desc->setRows(4); $desc->setValue($desc_obj->getDescription()); $form->addItem($desc); } // pool usage $pool_usage = new ilRadioGroupInputGUI($this->lng->txt("survey_question_pool_usage"), "use_pool"); $opt = new ilRadioOption($this->lng->txt("survey_question_pool_usage_active"), 1); $opt->setInfo($this->lng->txt("survey_question_pool_usage_active_info")); $pool_usage->addOption($opt); $opt = new ilRadioOption($this->lng->txt("survey_question_pool_usage_inactive"), 0); $opt->setInfo($this->lng->txt("survey_question_pool_usage_inactive_info")); $pool_usage->addOption($opt); $pool_usage->setValue($this->object->getPoolUsage()); $form->addItem($pool_usage); // 360°: appraisees if ($this->object->get360Mode()) { $self_eval = new ilCheckboxInputGUI($this->lng->txt("survey_360_self_evaluation"), "self_eval"); $self_eval->setInfo($this->lng->txt("survey_360_self_evaluation_info")); $self_eval->setChecked($this->object->get360SelfEvaluation()); $form->addItem($self_eval); $self_rate = new ilCheckboxInputGUI($this->lng->txt("survey_360_self_raters"), "self_rate"); $self_rate->setInfo($this->lng->txt("survey_360_self_raters_info")); $self_rate->setChecked($this->object->get360SelfRaters()); $form->addItem($self_rate); $self_appr = new ilCheckboxInputGUI($this->lng->txt("survey_360_self_appraisee"), "self_appr"); $self_appr->setInfo($this->lng->txt("survey_360_self_appraisee_info")); $self_appr->setChecked($this->object->get360SelfAppraisee()); $form->addItem($self_appr); } // activation include_once "Services/Object/classes/class.ilObjectActivation.php"; $this->lng->loadLanguageModule('rep'); $section = new ilFormSectionHeaderGUI(); $section->setTitle($this->lng->txt('rep_activation_availability')); $form->addItem($section); // additional info only with multiple references $act_obj_info = $act_ref_info = ""; if (sizeof(ilObject::_getAllReferences($this->object->getId())) > 1) { $act_obj_info = ' ' . $this->lng->txt('rep_activation_online_object_info'); $act_ref_info = $this->lng->txt('rep_activation_access_ref_info'); } $online = new ilCheckboxInputGUI($this->lng->txt('rep_activation_online'), 'online'); $online->setInfo($this->lng->txt('svy_activation_online_info') . $act_obj_info); $online->setChecked($this->object->isOnline()); $form->addItem($online); $act_type = new ilCheckboxInputGUI($this->lng->txt('rep_visibility_until'), 'access_type'); // $act_type->setInfo($this->lng->txt('svy_availability_until_info')); $act_type->setChecked($this->object->isActivationLimited()); $this->tpl->addJavaScript('./Services/Form/js/date_duration.js'); include_once "Services/Form/classes/class.ilDateDurationInputGUI.php"; $dur = new ilDateDurationInputGUI($this->lng->txt('rep_time_period'), "access_period"); $dur->setShowTime(true); $date = $this->object->getActivationStartDate(); $dur->setStart(new ilDateTime($date ? $date : time(), IL_CAL_UNIX)); $dur->setStartText($this->lng->txt('rep_activation_limited_start')); $date = $this->object->getActivationEndDate(); $dur->setEnd(new ilDateTime($date ? $date : time(), IL_CAL_UNIX)); $dur->setEndText($this->lng->txt('rep_activation_limited_end')); $act_type->addSubItem($dur); $visible = new ilCheckboxInputGUI($this->lng->txt('rep_activation_limited_visibility'), 'access_visiblity'); $visible->setInfo($this->lng->txt('svy_activation_limited_visibility_info')); $visible->setChecked($this->object->getActivationVisibility()); $act_type->addSubItem($visible); $form->addItem($act_type); // before start $section = new ilFormSectionHeaderGUI(); $section->setTitle($this->lng->txt('svy_settings_section_before_start')); $form->addItem($section); // introduction $intro = new ilTextAreaInputGUI($this->lng->txt("introduction"), "introduction"); $intro->setValue($this->object->prepareTextareaOutput($this->object->getIntroduction())); $intro->setRows(10); $intro->setCols(80); $intro->setUseRte(TRUE); $intro->setInfo($this->lng->txt("survey_introduction_info")); include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php"; $intro->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("survey")); $intro->addPlugin("latex"); $intro->addButton("latex"); $intro->addButton("pastelatex"); $intro->setRTESupport($this->object->getId(), "svy", "survey", null, $hide_rte_switch); $form->addItem($intro); // access $section = new ilFormSectionHeaderGUI(); $section->setTitle($this->lng->txt('svy_settings_section_access')); $form->addItem($section); // enable start date $start = $this->object->getStartDate(); $enablestartingtime = new ilCheckboxInputGUI($this->lng->txt("start_date"), "enabled_start_date"); $enablestartingtime->setValue(1); // $enablestartingtime->setOptionTitle($this->lng->txt("enabled")); $enablestartingtime->setChecked($start); // start date $startingtime = new ilDateTimeInputGUI('', 'start_date'); $startingtime->setShowTime(true); if ($start) { $startingtime->setDate(new ilDate($start, IL_CAL_TIMESTAMP)); } $enablestartingtime->addSubItem($startingtime); $form->addItem($enablestartingtime); // enable end date $end = $this->object->getEndDate(); $enableendingtime = new ilCheckboxInputGUI($this->lng->txt("end_date"), "enabled_end_date"); $enableendingtime->setValue(1); // $enableendingtime->setOptionTitle($this->lng->txt("enabled")); $enableendingtime->setChecked($end); // end date $endingtime = new ilDateTimeInputGUI('', 'end_date'); $endingtime->setShowTime(true); if ($end) { $endingtime->setDate(new ilDate($end, IL_CAL_TIMESTAMP)); } $enableendingtime->addSubItem($endingtime); $form->addItem($enableendingtime); // anonymization if (!$this->object->get360Mode()) { $codes = new ilCheckboxInputGUI($this->lng->txt("survey_access_codes"), "acc_codes"); $codes->setInfo($this->lng->txt("survey_access_codes_info")); $codes->setChecked(!$this->object->isAccessibleWithoutCode()); $form->addItem($codes); if ($this->object->_hasDatasets($this->object->getSurveyId())) { $codes->setDisabled(true); } } // question behaviour $section = new ilFormSectionHeaderGUI(); $section->setTitle($this->lng->txt('svy_settings_section_question_behaviour')); $form->addItem($section); // show question titles $show_question_titles = new ilCheckboxInputGUI($this->lng->txt("svy_show_questiontitles"), "show_question_titles"); $show_question_titles->setValue(1); $show_question_titles->setChecked($this->object->getShowQuestionTitles()); $form->addItem($show_question_titles); // finishing $info = new ilFormSectionHeaderGUI(); $info->setTitle($this->lng->txt("svy_settings_section_finishing")); $form->addItem($info); $view_own = new ilCheckboxInputGUI($this->lng->txt("svy_results_view_own"), "view_own"); $view_own->setInfo($this->lng->txt("svy_results_view_own_info")); $view_own->setChecked($this->object->hasViewOwnResults()); $form->addItem($view_own); $mail_own = new ilCheckboxInputGUI($this->lng->txt("svy_results_mail_own"), "mail_own"); $mail_own->setInfo($this->lng->txt("svy_results_mail_own_info")); $mail_own->setChecked($this->object->hasMailOwnResults()); $form->addItem($mail_own); // final statement $finalstatement = new ilTextAreaInputGUI($this->lng->txt("outro"), "outro"); $finalstatement->setValue($this->object->prepareTextareaOutput($this->object->getOutro())); $finalstatement->setRows(10); $finalstatement->setCols(80); $finalstatement->setUseRte(TRUE); $finalstatement->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("survey")); $finalstatement->addPlugin("latex"); $finalstatement->addButton("latex"); $finalstatement->addButton("pastelatex"); $finalstatement->setRTESupport($this->object->getId(), "svy", "survey", null, $hide_rte_switch); $form->addItem($finalstatement); // mail notification $mailnotification = new ilCheckboxInputGUI($this->lng->txt("mailnotification"), "mailnotification"); // $mailnotification->setOptionTitle($this->lng->txt("activate")); $mailnotification->setInfo($this->lng->txt("svy_result_mail_notification_info")); // #11762 $mailnotification->setValue(1); $mailnotification->setChecked($this->object->getMailNotification()); // addresses $mailaddresses = new ilTextInputGUI($this->lng->txt("mailaddresses"), "mailaddresses"); $mailaddresses->setValue($this->object->getMailAddresses()); $mailaddresses->setSize(80); $mailaddresses->setInfo($this->lng->txt('mailaddresses_info')); $mailaddresses->setRequired(true); // participant data $participantdata = new ilTextAreaInputGUI($this->lng->txt("mailparticipantdata"), "mailparticipantdata"); $participantdata->setValue($this->object->getMailParticipantData()); $participantdata->setRows(6); $participantdata->setCols(80); $participantdata->setUseRte(false); $participantdata->setInfo($this->lng->txt("mailparticipantdata_info")); // #12755 - because of privacy concerns we restrict user data to a minimum $placeholders = array("FIRST_NAME" => "firstname", "LAST_NAME" => "lastname", "LOGIN" => "login"); $txt = array(); foreach ($placeholders as $placeholder => $caption) { $txt[] = "[" . strtoupper($placeholder) . "]: " . $this->lng->txt($caption); } $txt = implode("<br />", $txt); $participantdatainfo = new ilNonEditableValueGUI($this->lng->txt("mailparticipantdata_placeholder"), "", true); $participantdatainfo->setValue($txt); $mailnotification->addSubItem($mailaddresses); $mailnotification->addSubItem($participantdata); $mailnotification->addSubItem($participantdatainfo); $form->addItem($mailnotification); // tutor notification - currently not available for 360° if (!$this->object->get360Mode()) { // parent course? global $tree; $has_parent = $tree->checkForParentType($this->object->getRefId(), "grp"); if (!$has_parent) { $has_parent = $tree->checkForParentType($this->object->getRefId(), "crs"); } $num_inv = sizeof($this->object->getInvitedUsers()); // notification $tut = new ilCheckboxInputGUI($this->lng->txt("survey_notification_tutor_setting"), "tut"); $tut->setChecked($this->object->getTutorNotificationStatus()); $form->addItem($tut); $tut_logins = array(); $tuts = $this->object->getTutorNotificationRecipients(); if ($tuts) { foreach ($tuts as $tut_id) { $tmp = ilObjUser::_lookupName($tut_id); if ($tmp["login"]) { $tut_logins[] = $tmp["login"]; } } } $tut_ids = new ilTextInputGUI($this->lng->txt("survey_notification_tutor_recipients"), "tut_ids"); $tut_ids->setDataSource($this->ctrl->getLinkTarget($this, "doAutoComplete", "", true)); $tut_ids->setRequired(true); $tut_ids->setMulti(true); $tut_ids->setMultiValues($tut_logins); $tut_ids->setValue(array_shift($tut_logins)); $tut->addSubItem($tut_ids); $tut_grp = new ilRadioGroupInputGUI($this->lng->txt("survey_notification_target_group"), "tut_grp"); $tut_grp->setRequired(true); $tut_grp->setValue($this->object->getTutorNotificationTarget()); $tut->addSubItem($tut_grp); $tut_grp_crs = new ilRadioOption($this->lng->txt("survey_notification_target_group_parent_course"), ilObjSurvey::NOTIFICATION_PARENT_COURSE); if (!$has_parent) { $tut_grp_crs->setInfo($this->lng->txt("survey_notification_target_group_parent_course_inactive")); } $tut_grp->addOption($tut_grp_crs); $tut_grp_inv = new ilRadioOption($this->lng->txt("survey_notification_target_group_invited"), ilObjSurvey::NOTIFICATION_INVITED_USERS); $tut_grp_inv->setInfo(sprintf($this->lng->txt("survey_notification_target_group_invited_info"), $num_inv)); $tut_grp->addOption($tut_grp_inv); } // reminders // reminder - currently not available for 360° if (!$this->object->get360Mode()) { $info = new ilFormSectionHeaderGUI(); $info->setTitle($this->lng->txt("svy_settings_section_reminders")); $form->addItem($info); $rmd = new ilCheckboxInputGUI($this->lng->txt("survey_reminder_setting"), "rmd"); $rmd->setChecked($this->object->getReminderStatus()); $form->addItem($rmd); $rmd_start = new ilDateTimeInputGUI($this->lng->txt("survey_reminder_start"), "rmd_start"); $rmd_start->setRequired(true); $start = $this->object->getReminderStart(); if ($start) { $rmd_start->setDate($start); } $rmd->addSubItem($rmd_start); $end = $this->object->getReminderEnd(); $rmd_end = new ilDateTimeInputGUI($this->lng->txt("survey_reminder_end"), "rmd_end"); $rmd_end->enableDateActivation("", "rmd_end_tgl", (bool) $end); if ($end) { $rmd_end->setDate($end); } $rmd->addSubItem($rmd_end); $rmd_freq = new ilNumberInputGUI($this->lng->txt("survey_reminder_frequency"), "rmd_freq"); $rmd_freq->setRequired(true); $rmd_freq->setSize(3); $rmd_freq->setSuffix($this->lng->txt("survey_reminder_frequency_days")); $rmd_freq->setValue($this->object->getReminderFrequency()); $rmd_freq->setMinValue(1); $rmd->addSubItem($rmd_freq); $rmd_grp = new ilRadioGroupInputGUI($this->lng->txt("survey_notification_target_group"), "rmd_grp"); $rmd_grp->setRequired(true); $rmd_grp->setValue($this->object->getReminderTarget()); $rmd->addSubItem($rmd_grp); $rmd_grp_crs = new ilRadioOption($this->lng->txt("survey_notification_target_group_parent_course"), ilObjSurvey::NOTIFICATION_PARENT_COURSE); if (!$has_parent) { $rmd_grp_crs->setInfo($this->lng->txt("survey_notification_target_group_parent_course_inactive")); } $rmd_grp->addOption($rmd_grp_crs); $rmd_grp_inv = new ilRadioOption($this->lng->txt("survey_notification_target_group_invited"), ilObjSurvey::NOTIFICATION_INVITED_USERS); $rmd_grp_inv->setInfo(sprintf($this->lng->txt("survey_notification_target_group_invited_info"), $num_inv)); $rmd_grp->addOption($rmd_grp_inv); } // results $results = new ilFormSectionHeaderGUI(); $results->setTitle($this->lng->txt("results")); $form->addItem($results); // evaluation access if (!$this->object->get360Mode()) { $evaluation_access = new ilRadioGroupInputGUI($this->lng->txt('evaluation_access'), "evaluation_access"); $option = new ilCheckboxOption($this->lng->txt("evaluation_access_off"), ilObjSurvey::EVALUATION_ACCESS_OFF, ''); $option->setInfo($this->lng->txt("svy_evaluation_access_off_info")); $evaluation_access->addOption($option); $option = new ilCheckboxOption($this->lng->txt("evaluation_access_all"), ilObjSurvey::EVALUATION_ACCESS_ALL, ''); $option->setInfo($this->lng->txt("svy_evaluation_access_all_info")); $evaluation_access->addOption($option); $option = new ilCheckboxOption($this->lng->txt("evaluation_access_participants"), ilObjSurvey::EVALUATION_ACCESS_PARTICIPANTS, ''); $option->setInfo($this->lng->txt("svy_evaluation_access_participants_info")); $evaluation_access->addOption($option); $evaluation_access->setValue($this->object->getEvaluationAccess()); $form->addItem($evaluation_access); $anonymization_options = new ilRadioGroupInputGUI($this->lng->txt("survey_results_anonymization"), "anonymization_options"); $option = new ilCheckboxOption($this->lng->txt("survey_results_personalized"), "statpers"); $option->setInfo($this->lng->txt("survey_results_personalized_info")); $anonymization_options->addOption($option); $option = new ilCheckboxOption($this->lng->txt("survey_results_anonymized"), "statanon"); $option->setInfo($this->lng->txt("survey_results_anonymized_info")); $anonymization_options->addOption($option); $anonymization_options->setValue($this->object->hasAnonymizedResults() ? "statanon" : "statpers"); $form->addItem($anonymization_options); if ($this->object->_hasDatasets($this->object->getSurveyId())) { $anonymization_options->setDisabled(true); } } else { $ts_results = new ilRadioGroupInputGUI($this->lng->txt("survey_360_results"), "ts_res"); $ts_results->setValue($this->object->get360Results()); $option = new ilRadioOption($this->lng->txt("survey_360_results_none"), ilObjSurvey::RESULTS_360_NONE); $option->setInfo($this->lng->txt("survey_360_results_none_info")); $ts_results->addOption($option); $option = new ilRadioOption($this->lng->txt("survey_360_results_own"), ilObjSurvey::RESULTS_360_OWN); $option->setInfo($this->lng->txt("survey_360_results_own_info")); $ts_results->addOption($option); $option = new ilRadioOption($this->lng->txt("survey_360_results_all"), ilObjSurvey::RESULTS_360_ALL); $option->setInfo($this->lng->txt("survey_360_results_all_info")); $ts_results->addOption($option); $form->addItem($ts_results); } // competence service activation for 360 mode include_once "./Services/Skill/classes/class.ilSkillManagementSettings.php"; $skmg_set = new ilSkillManagementSettings(); if ($this->object->get360Mode() && $skmg_set->isActivated()) { $other = new ilFormSectionHeaderGUI(); $other->setTitle($this->lng->txt("other")); $form->addItem($other); $skill_service = new ilCheckboxInputGUI($this->lng->txt("survey_activate_skill_service"), "skill_service"); $skill_service->setInfo($this->lng->txt("survey_activate_skill_service_info")); $skill_service->setChecked($this->object->get360SkillService()); $form->addItem($skill_service); } $form->addCommandButton("saveProperties", $this->lng->txt("save")); // remove items when using template if ($template_settings) { foreach ($template_settings as $id => $item) { if ($item["hide"]) { $form->removeItemByPostVar($id); } } } return $form; }
/** * Init object creation form * * @param string $a_new_type * * @return ilPropertyFormGUI */ protected function initCreateForm($a_new_type) { global $lng; include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setTarget("_top"); $form->setFormAction($this->ctrl->getFormAction($this, "save")); $form->setTitle($this->lng->txt($a_new_type . "_new")); // title $ti = new ilTextInputGUI($this->lng->txt("title"), "title"); $ti->setSize(min(40, ilObject::TITLE_LENGTH)); $ti->setMaxLength(ilObject::TITLE_LENGTH); $ti->setRequired(true); $form->addItem($ti); // description $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc"); $ta->setCols(40); $ta->setRows(2); $form->addItem($ta); $services_group = new ilRadioGroupInputGUI($lng->txt("cld_service"), "service"); $services_group->setRequired(true); foreach (ilCloudConnector::getActiveServices() as $service) { $option = new ilRadioOption($service, $service); $hook_object = ilCloudConnector::getPluginHookClass($option->getValue()); $option->setTitle($hook_object->txt($service)); $option->setInfo($hook_object->txt("create_info")); $this->plugin_service = ilCloudConnector::getServiceClass($service, 0, false); $init_gui = ilCloudConnector::getCreationGUIClass($this->plugin_service); if ($init_gui) { $init_gui->initPluginCreationFormSection($option); } $services_group->addOption($option); } //Select first radio-button by default $services_group->setValue(array_shift($services_group->getOptions())->getValue()); $form->addItem($services_group); $form = $this->initDidacticTemplate($form); $form->addCommandButton("save", $this->lng->txt($a_new_type . "_add")); $form->addCommandButton("cancel", $this->lng->txt("cancel")); 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')); }
/** * * @param * @return */ protected function initPropertiesForm() { include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; $this->lng->loadLanguageModule('file'); $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this), 'update'); $form->setTitle($this->lng->txt('file_edit')); $form->addCommandButton('update', $this->lng->txt('save')); $form->addCommandButton('cancel', $this->lng->txt('cancel')); $title = new ilTextInputGUI($this->lng->txt('title'), 'title'); $title->setValue($this->object->getTitle()); $title->setInfo($this->lng->txt("if_no_title_then_filename")); $form->addItem($title); $upload_possible = true; if ($this->id_type == self::WORKSPACE_NODE_ID) { include_once "Services/DiskQuota/classes/class.ilDiskQuotaHandler.php"; $upload_possible = ilDiskQuotaHandler::isUploadPossible(); } if ($upload_possible) { $file = new ilFileInputGUI($this->lng->txt('obj_file'), 'file'); $file->setRequired(false); // $file->enableFileNameSelection('title'); $form->addItem($file); $group = new ilRadioGroupInputGUI('', 'replace'); $group->setValue(0); $replace = new ilRadioOption($this->lng->txt('replace_file'), 1); $replace->setInfo($this->lng->txt('replace_file_info')); $group->addOption($replace); $keep = new ilRadioOption($this->lng->txt('file_new_version'), 0); $keep->setInfo($this->lng->txt('file_new_version_info')); $group->addOption($keep); $file->addSubItem($group); } else { $file = new ilNonEditableValueGUI($this->lng->txt('obj_file')); $file->setValue($this->lng->txt("personal_workspace_quota_exceeded_warning")); $form->addItem($file); } $desc = new ilTextAreaInputGUI($this->lng->txt('description'), 'description'); $desc->setRows(3); #$desc->setCols(40); $form->addItem($desc); if ($this->id_type == self::REPOSITORY_NODE_ID) { $this->lng->loadLanguageModule('rating'); $rate = new ilCheckboxInputGUI($this->lng->txt('rating_activate_rating'), 'rating'); $rate->setInfo($this->lng->txt('rating_activate_rating_info')); $form->addItem($rate); } return $form; }
/** * Process the language maintenance */ function maintainObject() { require_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this)); $form->setTitle($this->lng->txt("language_maintenance")); $form->setPreventDoubleSubmission(false); $form->addCommandButton('maintainExecute', $this->lng->txt("language_process_maintenance")); $rg = new ilRadioGroupInputGUI($this->lng->txt("language_maintain_local_changes"), "maintain"); $ro = new ilRadioOption($this->lng->txt("language_save_local_changes"), "save"); $ro->setInfo(sprintf($this->lng->txt("language_save_local_changes_info"), $this->object->key)); $rg->addOption($ro); $ro = new ilRadioOption($this->lng->txt("language_load_local_changes"), "load"); $ro->setInfo(sprintf($this->lng->txt("language_load_local_changes_info"), $this->object->key)); $rg->addOption($ro); $ro = new ilRadioOption($this->lng->txt("language_clear_local_changes"), "clear"); $ro->setInfo(sprintf($this->lng->txt("language_clear_local_changes_info"), $this->object->key)); $rg->addOption($ro); if ($this->langmode) { $ro = new ilRadioOption($this->lng->txt("language_delete_local_additions"), "delete_added"); $ro->setInfo(sprintf($this->lng->txt("language_delete_local_additions_info"), $this->object->key)); $rg->addOption($ro); $ro = new ilRadioOption($this->lng->txt("language_merge_local_changes"), "merge"); $ro->setInfo(sprintf($this->lng->txt("language_merge_local_changes_info"), $this->object->key)); $rg->addOption($ro); $ro = new ilRadioOption($this->lng->txt("language_remove_local_file"), "remove_local_file"); $ro->setInfo(sprintf($this->lng->txt("language_remove_local_file_info"), $this->object->key)); $rg->addOption($ro); } $rg->setValue($this->session["maintain"]); $form->addItem($rg); $this->tpl->setContent($form->getHTML()); }
/** * Init Settings Form */ function initSettingsForm() { global $tpl, $lng, $ilCtrl; $lng->loadLanguageModule("mcst"); include "Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form_gui = new ilPropertyFormGUI(); $this->form_gui->setTitle($lng->txt("mcst_settings")); // Title $tit = new ilTextInputGUI($lng->txt("title"), "title"); $tit->setValue($this->object->getTitle()); $tit->setRequired(true); $this->form_gui->addItem($tit); // description $des = new ilTextAreaInputGUI($lng->txt("description"), "description"); $des->setValue($this->object->getLongDescription()); $this->form_gui->addItem($des); $sh = new ilFormSectionHeaderGUI(); $sh->setTitle($lng->txt("rep_activation_availability")); $this->form_gui->addItem($sh); // Online $online = new ilCheckboxInputGUI($lng->txt("online"), "online"); $online->setChecked($this->object->getOnline()); $this->form_gui->addItem($online); // presentation $sh = new ilFormSectionHeaderGUI(); $sh->setTitle($lng->txt("obj_presentation")); $this->form_gui->addItem($sh); // Sorting $sort = new ilRadioGroupInputGUI($lng->txt("mcst_ordering"), "order"); $sort->addOption(new ilRadioOption($lng->txt("mcst_ordering_title"), ilObjMediaCast::ORDER_TITLE)); $sort->addOption(new ilRadioOption($lng->txt("mcst_ordering_creation_date_asc"), ilObjMediaCast::ORDER_CREATION_DATE_ASC)); $sort->addOption(new ilRadioOption($lng->txt("mcst_ordering_creation_date_desc"), ilObjMediaCast::ORDER_CREATION_DATE_DESC)); $sort->addOption(new ilRadioOption($lng->txt("mcst_ordering_manual"), ilObjMediaCast::ORDER_MANUAL)); $sort->setValue($this->object->getOrder()); $this->form_gui->addItem($sort); // view mode $options = array(ilObjMediaCast::VIEW_LIST => $lng->txt("mcst_list"), ilObjMediaCast::VIEW_GALLERY => $lng->txt("mcst_gallery")); $si = new ilRadioGroupInputGUI($this->lng->txt("mcst_viewmode"), "viewmode"); $si->addOption(new ilRadioOption($lng->txt("mcst_list"), ilObjMediaCast::VIEW_LIST)); $si->addOption(new ilRadioOption($lng->txt("mcst_gallery"), ilObjMediaCast::VIEW_GALLERY)); // $si->setOptions($options); $si->setValue($this->object->getViewMode()); $this->form_gui->addItem($si); // Downloadable $downloadable = new ilCheckboxInputGUI($lng->txt("mcst_downloadable"), "downloadable"); $downloadable->setChecked($this->object->getDownloadable()); $downloadable->setInfo($lng->txt("mcst_downloadable_info")); $this->form_gui->addItem($downloadable); $news_set = new ilSetting("news"); $enable_internal_rss = $news_set->get("enable_rss_for_internal"); //Default Visibility if ($enable_internal_rss) { // webfeed $sh = new ilFormSectionHeaderGUI(); $sh->setTitle($lng->txt("mcst_webfeed")); $this->form_gui->addItem($sh); $radio_group = new ilRadioGroupInputGUI($lng->txt("news_default_visibility"), "defaultaccess"); $radio_option = new ilRadioOption($lng->txt("news_visibility_users"), "0"); $radio_option->setInfo($lng->txt("news_news_item_def_visibility_users_info")); $radio_group->addOption($radio_option); $radio_option = new ilRadioOption($lng->txt("news_visibility_public"), "1"); $radio_option->setInfo($lng->txt("news_news_item_def_visibility_public_info")); $radio_group->addOption($radio_option); $radio_group->setRequired(false); $radio_group->setValue($this->object->getDefaultAccess()); #$ch->addSubItem($radio_group); $this->form_gui->addItem($radio_group); //Extra Feed include_once "./Services/Block/classes/class.ilBlockSetting.php"; $public_feed = ilBlockSetting::_lookup("news", "public_feed", 0, $this->object->getId()); $ch = new ilCheckboxInputGUI($lng->txt("news_public_feed"), "extra_feed"); $ch->setInfo($lng->txt("news_public_feed_info")); $ch->setChecked($public_feed); $this->form_gui->addItem($ch); // keep minimal x number of items $ni = new ilNumberInputGUI($this->lng->txt("news_keep_minimal_x_items"), "keep_rss_min"); $ni->setMaxValue(100); $ni->setMinValue(0); $ni->setMaxLength(3); $ni->setSize(3); $ni->setInfo($this->lng->txt("news_keep_minimal_x_items_info") . " (" . ilNewsItem::_lookupRSSPeriod() . " " . (ilNewsItem::_lookupRSSPeriod() == 1 ? $lng->txt("day") : $lng->txt("days")) . ")"); $ni->setValue((int) ilBlockSetting::_lookup("news", "keep_rss_min", 0, $this->object->getId())); $ch->addSubItem($ni); // Include Files in Pubic Items $incl_files = new ilCheckboxInputGUI($lng->txt("mcst_incl_files_in_rss"), "public_files"); $incl_files->setChecked($this->object->getPublicFiles()); $incl_files->setInfo($lng->txt("mcst_incl_files_in_rss_info")); #$ch->addSubItem($incl_files); $this->form_gui->addItem($incl_files); } // Form action and save button $this->form_gui->addCommandButton("saveSettings", $lng->txt("save")); $this->form_gui->setFormAction($ilCtrl->getFormAction($this, "saveSettings")); }
public function adoptTeamAssignmentsFormObject() { global $ilCtrl, $ilTabs, $lng, $tpl; $this->checkPermission("write"); if (!$this->ass) { $ilCtrl->redirect($this, "listAssignments"); } $ilTabs->activateTab("content"); $this->addContentSubTabs("list_assignments"); include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setTitle($lng->txt("exc_team_assignment_adopt")); $form->setFormAction($ilCtrl->getFormAction($this, "adoptTeamAssignments")); $options = ilExAssignment::getAdoptableTeamAssignments($this->ass->getExerciseId()); // we must not have existing teams in assignment if (array_key_exists($this->ass->getId(), $options)) { $ilCtrl->redirect($this, "listAssignments"); } $teams = new ilRadioGroupInputGUI($lng->txt("exc_assignment"), "ass_adpt"); $teams->setValue(-1); $teams->addOption(new ilRadioOption($lng->txt("exc_team_assignment_adopt_none"), -1)); foreach ($options as $id => $item) { $option = new ilRadioOption($item["title"], $id); $option->setInfo($lng->txt("exc_team_assignment_adopt_teams") . ": " . $item["teams"]); $teams->addOption($option); } $form->addItem($teams); $form->addCommandButton("adoptTeamAssignments", $lng->txt("save")); $form->addCommandButton("listAssignments", $lng->txt("cancel")); $tpl->setContent($form->getHTML()); }
protected function initEditCustomForm(ilPropertyFormGUI $a_form) { // Show didactic template type $this->initDidacticTemplate($a_form); // Sorting $sog = new ilRadioGroupInputGUI($this->lng->txt('sorting_header'), 'sor'); $sog->setRequired(true); // implicit: there is always a group or course in the path $sde = new ilRadioOption(); $sde->setValue(ilContainer::SORT_INHERIT); $sde->setTitle($this->lng->txt('sort_inherit_prefix') . ' (' . ilContainerSortingSettings::sortModeToString(ilContainerSortingSettings::lookupSortModeFromParentContainer($this->object->getId())) . ') '); $sde->setInfo($this->lng->txt('sorting_info_inherit')); $sog->addOption($sde); $sma = new ilRadioOption(); $sma->setValue(ilContainer::SORT_TITLE); $sma->setTitle($this->lng->txt('sorting_title_header')); $sma->setInfo($this->lng->txt('sorting_info_title')); $sog->addOption($sma); $sti = new ilRadioOption(); $sti->setValue(ilContainer::SORT_MANUAL); $sti->setTitle($this->lng->txt('sorting_manual_header')); $sti->setInfo($this->lng->txt('sorting_info_manual')); $sog->addOption($sti); $a_form->addItem($sog); }