コード例 #1
0
 public function addToForm()
 {
     global $lng;
     $def = $this->getADT()->getCopyOfDefinition();
     $options = $def->getOptions();
     asort($options);
     // ?
     $cbox = new ilCheckboxGroupInputGUI($this->getTitle(), $this->getElementId());
     $cbox->setValue($this->getADT()->getSelections());
     foreach ($options as $value => $caption) {
         $option = new ilCheckboxOption($caption, $value);
         $cbox->addOption($option);
     }
     $this->addToParentElement($cbox);
 }
コード例 #2
0
 public function addToForm()
 {
     global $lng;
     $def = $this->getADT()->getCopyOfDefinition();
     $options = $def->getOptions();
     // asort($options); // ?
     $cbox = new ilCheckboxGroupInputGUI($this->getTitle(), $this->getElementId());
     foreach ($options as $value => $caption) {
         $option = new ilCheckboxOption($caption, $value);
         if (is_array($this->option_infos) && array_key_exists($value, $this->option_infos)) {
             $option->setInfo($this->option_infos[$value]);
         }
         $cbox->addOption($option);
     }
     $this->addBasicFieldProperties($cbox, $def);
     $cbox->setValue($this->getADT()->getSelections());
     $this->addToParentElement($cbox);
 }
コード例 #3
0
 function initAddCodesForm()
 {
     global $rbacreview, $ilObjDataCache, $lng;
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $this->form_gui = new ilPropertyFormGUI();
     $this->form_gui->setFormAction($this->ctrl->getFormAction($this, 'createCodes'));
     $this->form_gui->setTitle($this->lng->txt('registration_codes_edit_header'));
     $count = new ilNumberInputGUI($this->lng->txt('registration_codes_number'), 'reg_codes_number');
     $count->setSize(4);
     $count->setMaxLength(4);
     $count->setMinValue(1);
     $count->setMaxValue(1000);
     $count->setRequired(true);
     $this->form_gui->addItem($count);
     // type
     $code_type = new ilCheckboxGroupInputGUI($this->lng->txt('registration_codes_type'), 'code_type');
     $code_type->setRequired(TRUE);
     $code_type->addOption(new ilCheckboxOption($this->lng->txt('registration_codes_type_reg'), self::CODE_TYPE_REGISTRATION, $this->lng->txt('registration_codes_type_reg_info')));
     $code_type->addOption(new ilCheckboxOption($this->lng->txt('registration_codes_type_ext'), self::CODE_TYPE_EXTENSION, $this->lng->txt('registration_codes_type_ext_info')));
     $this->form_gui->addItem($code_type);
     $sec = new ilFormSectionHeaderGUI();
     $sec->setTitle($this->lng->txt('registration_codes_roles_title'));
     $this->form_gui->addItem($sec);
     include_once './Services/AccessControl/classes/class.ilObjRole.php';
     $options = array("" => $this->lng->txt('registration_codes_no_assigned_role'));
     foreach ($rbacreview->getGlobalRoles() as $role_id) {
         if (!in_array($role_id, array(SYSTEM_ROLE_ID, ANONYMOUS_ROLE_ID))) {
             $options[$role_id] = $ilObjDataCache->lookupTitle($role_id);
         }
     }
     $roles = new ilSelectInputGUI($this->lng->txt("registration_codes_roles"), "reg_codes_role");
     $roles->setInfo($this->lng->txt("registration_codes_override_info"));
     $roles->setOptions($options);
     $this->form_gui->addItem($roles);
     $local = new ilTextInputGUI($this->lng->txt("registration_codes_roles_local"), "reg_codes_local");
     $local->setMulti(true);
     $local->setDataSource($this->ctrl->getLinkTarget($this, "getLocalRoleAutoComplete", "", true));
     $this->form_gui->addItem($local);
     $sec = new ilFormSectionHeaderGUI();
     $sec->setTitle($this->lng->txt('reg_access_limitations'));
     $this->form_gui->addItem($sec);
     $limit = new ilRadioGroupInputGUI($this->lng->txt("reg_access_limitation_mode"), "reg_limit");
     $limit->setInfo($this->lng->txt("registration_codes_override_info"));
     $this->form_gui->addItem($limit);
     $opt = new ilRadioOption($this->lng->txt("registration_codes_roles_limitation_none"), "none");
     $limit->addOption($opt);
     $opt = new ilRadioOption($this->lng->txt("reg_access_limitation_none"), "unlimited");
     $limit->addOption($opt);
     $opt = new ilRadioOption($this->lng->txt("reg_access_limitation_mode_absolute"), "absolute");
     $limit->addOption($opt);
     $dt = new ilDateTimeInputGUI($this->lng->txt("reg_access_limitation_mode_absolute_target"), "abs_date");
     $dt->setRequired(true);
     $opt->addSubItem($dt);
     $opt = new ilRadioOption($this->lng->txt("reg_access_limitation_mode_relative"), "relative");
     $limit->addOption($opt);
     $days = new ilTextInputGUI("", "rel_date[d]");
     $days->setSize(5);
     $days->setSuffix($this->lng->txt("days"));
     $mon = new ilTextInputGUI("", "rel_date[m]");
     $mon->setSize(5);
     $mon->setSuffix($this->lng->txt("months"));
     $yr = new ilTextInputGUI("", "rel_date[y]");
     $yr->setSize(5);
     $yr->setSuffix($this->lng->txt("years"));
     // custom input won't reload
     if (is_array($_POST["rel_date"])) {
         $days->setValue($_POST["rel_date"]["d"]);
         $mon->setValue($_POST["rel_date"]["m"]);
         $yr->setValue($_POST["rel_date"]["y"]);
     }
     $dur = new ilCustomInputGUI($this->lng->txt("reg_access_limitation_mode_relative_target"));
     $dur->setRequired(true);
     $dur->setHTML($days->getToolbarHTML() . " " . $mon->getToolbarHTML() . " " . $yr->getToolbarHTML());
     $opt->addSubItem($dur);
     $this->form_gui->addCommandButton('createCodes', $this->lng->txt('create'));
     $this->form_gui->addCommandButton('listCodes', $this->lng->txt('cancel'));
 }
コード例 #4
0
 /**
  * Init form
  *
  * @param string $a_cmd
  * @return ilPropertyFormGUI
  */
 public function initForm($a_cmd = "")
 {
     global $ilCtrl, $lng;
     $lng->loadLanguageModule('crs');
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setFormAction($ilCtrl->getFormAction($this->parent_obj, $a_cmd));
     $form->setTarget('_blank');
     $form->setTitle($lng->txt('sess_gen_attendance_list'));
     $title = new ilTextInputGUI($lng->txt('title'), 'title');
     $title->setValue($this->title);
     $form->addItem($title);
     $desc = new ilTextInputGUI($lng->txt('description'), 'desc');
     $desc->setValue($this->description);
     $form->addItem($desc);
     if (sizeof($this->presets)) {
         $preset = new ilCheckboxGroupInputGUI($lng->txt('user_detail'), 'preset');
         $preset_value = array();
         foreach ($this->presets as $id => $item) {
             $preset->addOption(new ilCheckboxOption($item[0], $id));
             if ($item[1]) {
                 $preset_value[] = $id;
             }
         }
         $preset->setValue($preset_value);
         $form->addItem($preset);
     }
     $blank = new ilTextInputGUI($lng->txt('event_blank_columns'), 'blank');
     $blank->setMulti(true);
     $form->addItem($blank);
     if ($this->pre_blanks) {
         $blank->setValue($this->pre_blanks);
     }
     $part = new ilFormSectionHeaderGUI();
     $part->setTitle($lng->txt('event_participant_selection'));
     $form->addItem($part);
     // Admins
     $admin = new ilCheckboxInputGUI($lng->txt('event_tbl_admins'), 'show_admins');
     $admin->setOptionTitle($lng->txt('event_inc_admins'));
     $admin->setValue(1);
     $form->addItem($admin);
     // Tutors
     $tutor = new ilCheckboxInputGUI($lng->txt('event_tbl_tutors'), 'show_tutors');
     $tutor->setOptionTitle($lng->txt('event_inc_tutors'));
     $tutor->setValue(1);
     $form->addItem($tutor);
     // Members
     $member = new ilCheckboxInputGUI($lng->txt('event_tbl_members'), 'show_members');
     $member->setOptionTitle($lng->txt('event_inc_members'));
     $member->setValue(1);
     $member->setChecked(true);
     $form->addItem($member);
     $form->addCommandButton($a_cmd, $lng->txt('sess_print_attendance_list'));
     if ($this->id && $a_cmd) {
         include_once "Services/User/classes/class.ilUserFormSettings.php";
         $settings = new ilUserFormSettings($this->id);
         $settings->exportToForm($form);
     }
     return $form;
 }
コード例 #5
0
 /**
  * Init settings template form.
  *
  * @param        int        $a_mode        Edit Mode
  */
 public function initSettingsTemplateForm($a_mode = "edit")
 {
     global $lng, $ilCtrl;
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form = new ilPropertyFormGUI();
     // title
     $ti = new ilTextInputGUI($lng->txt("title"), "title");
     $ti->setMaxLength(200);
     $ti->setRequired(true);
     // begin-patch lok
     if ($this->settings_template->getAutoGenerated()) {
         $ti->setDisabled(true);
     }
     // end-patch lok
     $this->form->addItem($ti);
     // description
     $ti = new ilTextAreaInputGUI($lng->txt("description"), "description");
     // begin-patch lok
     if ($this->settings_template->getAutoGenerated()) {
         $ti->setDisabled(true);
     }
     $this->form->addItem($ti);
     // hidable tabs
     $tabs = $this->getConfig()->getHidableTabs();
     if (is_array($tabs) && count($tabs) > 0) {
         $sec = new ilFormSectionHeaderGUI();
         $sec->setTitle($lng->txt("adm_hide_tabs"));
         $this->form->addItem($sec);
         foreach ($tabs as $t) {
             // hide tab $t?
             $cb = new ilCheckboxInputGUI($t["text"], "tab_" . $t["id"]);
             $this->form->addItem($cb);
         }
     }
     // settings
     $settings = $this->getConfig()->getSettings();
     if (is_array($settings) && count($settings) > 0) {
         $sec = new ilFormSectionHeaderGUI();
         $sec->setTitle($lng->txt("adm_predefined_settings"));
         $this->form->addItem($sec);
         foreach ($settings as $s) {
             // setting
             $cb = new ilCheckboxInputGUI($s["text"], "set_" . $s["id"]);
             $this->form->addItem($cb);
             switch ($s["type"]) {
                 case ilSettingsTemplateConfig::TEXT:
                     $ti = new ilTextInputGUI($lng->txt("adm_value"), "value_" . $s["id"]);
                     //$ti->setMaxLength();
                     //$ti->setSize();
                     $cb->addSubItem($ti);
                     break;
                 case ilSettingsTemplateConfig::BOOL:
                     $cb2 = new ilCheckboxInputGUI($lng->txt("adm_value"), "value_" . $s["id"]);
                     $cb->addSubItem($cb2);
                     break;
                 case ilSettingsTemplateConfig::SELECT:
                     $si = new ilSelectInputGUI($lng->txt("adm_value"), "value_" . $s["id"]);
                     $si->setOptions($s["options"]);
                     $cb->addSubItem($si);
                     break;
                 case ilSettingsTemplateConfig::CHECKBOX:
                     $chbs = new ilCheckboxGroupInputGUI($lng->txt("adm_value"), "value_" . $s["id"]);
                     foreach ($s['options'] as $key => $value) {
                         $chbs->addOption($c = new ilCheckboxInputGUI($value, $key));
                         $c->setValue($key);
                     }
                     $cb->addSubItem($chbs);
                     break;
             }
             if ($s['hidable']) {
                 // hide setting
                 $cb_hide = new ilCheckboxInputGUI($lng->txt("adm_hide"), "hide_" . $s["id"]);
                 $cb->addSubItem($cb_hide);
             }
         }
     }
     // save and cancel commands
     if ($a_mode == "create") {
         $this->form->addCommandButton("saveSettingsTemplate", $lng->txt("save"));
         $this->form->addCommandButton("listSettingsTemplates", $lng->txt("cancel"));
         $this->form->setTitle($lng->txt("adm_add_settings_template"));
     } else {
         $this->form->addCommandButton("updateSettingsTemplate", $lng->txt("save"));
         $this->form->addCommandButton("listSettingsTemplates", $lng->txt("cancel"));
         $this->form->setTitle($lng->txt("adm_edit_settings_template"));
     }
     $this->form->setFormAction($ilCtrl->getFormAction($this));
 }
コード例 #6
0
 /**
  * Fill ECS export settings "multiple servers"
  * 
  * to be used in ilObject->initEditForm()
  * 
  * @param ilPropertyFormGUI $a_form
  */
 public function addSettingsToForm(ilPropertyFormGUI $a_form, $a_type)
 {
     global $lng;
     if (!$this->isActive()) {
         return;
     }
     $obj_id = $this->content_obj->getId();
     // Return if no participant is enabled for export and the current object is not released
     include_once './Services/WebServices/ECS/classes/class.ilECSExport.php';
     include_once './Services/WebServices/ECS/classes/class.ilECSParticipantSettings.php';
     $exportablePart = ilECSParticipantSettings::getExportableParticipants();
     if (!$exportablePart and !ilECSExport::_isExported($obj_id)) {
         return true;
     }
     $lng->loadLanguageModule('ecs');
     // show ecs property form section
     $ecs = new ilFormSectionHeaderGUI();
     $ecs->setTitle($lng->txt('ecs_' . $a_type . '_export'));
     $a_form->addItem($ecs);
     // release or not
     $exp = new ilRadioGroupInputGUI($lng->txt('ecs_' . $a_type . '_export_obj_settings'), 'ecs_export');
     $exp->setRequired(true);
     $exp->setValue(ilECSExport::_isExported($obj_id) ? 1 : 0);
     $off = new ilRadioOption($lng->txt('ecs_' . $a_type . '_export_disabled'), 0);
     $exp->addOption($off);
     $on = new ilRadioOption($lng->txt('ecs_' . $a_type . '_export_enabled'), 1);
     $exp->addOption($on);
     $a_form->addItem($exp);
     // Show all exportable participants
     $publish_for = new ilCheckboxGroupInputGUI($lng->txt('ecs_publish_for'), 'ecs_sid');
     // @TODO: Active checkboxes for recipients
     //$publish_for->setValue((array) $members);
     // Read receivers
     $receivers = array();
     include_once './Services/WebServices/ECS/classes/class.ilECSEContentDetails.php';
     foreach (ilECSExport::getExportServerIds($obj_id) as $sid) {
         $exp = new ilECSExport($sid, $obj_id);
         $participants = null;
         $details = ilECSEContentDetails::getInstance($sid, $exp->getEContentId(), $this->getECSObjectType());
         if ($details instanceof ilECSEContentDetails) {
             $participants = $details->getReceivers();
         }
         if ($participants) {
             foreach ($participants as $mid) {
                 $receivers[] = $sid . '_' . $mid;
             }
         }
     }
     $publish_for->setValue($receivers);
     foreach ($exportablePart as $pInfo) {
         include_once './Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php';
         $partSetting = new ilECSParticipantSetting($pInfo['sid'], $pInfo['mid']);
         $com = new ilCheckboxInputGUI($partSetting->getCommunityName() . ': ' . $partSetting->getTitle(), 'sid_mid');
         $com->setValue($pInfo['sid'] . '_' . $pInfo['mid']);
         $publish_for->addOption($com);
     }
     $on->addSubItem($publish_for);
     return true;
 }
コード例 #7
0
 /**
  * Init standard search form.
  */
 public function initStandardSearchForm($a_mode)
 {
     global $lng, $ilCtrl;
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form = new ilPropertyFormGUI();
     $this->form->setOpenTag(false);
     $this->form->setCloseTag(false);
     // term combination
     $radg = new ilHiddenInputGUI('search_term_combination');
     $radg->setValue(ilSearchSettings::getInstance()->getDefaultOperator());
     $this->form->addItem($radg);
     if (ilSearchSettings::getInstance()->isLuceneItemFilterEnabled()) {
         if ($a_mode == self::SEARCH_FORM_STANDARD) {
             // search type
             $radg = new ilRadioGroupInputGUI($lng->txt("search_type"), "type");
             $radg->setValue($this->getType() == ilSearchBaseGUI::SEARCH_FAST ? ilSearchBaseGUI::SEARCH_FAST : ilSearchBaseGUI::SEARCH_DETAILS);
             $op1 = new ilRadioOption($lng->txt("search_fast_info"), ilSearchBaseGUI::SEARCH_FAST);
             $radg->addOption($op1);
             $op2 = new ilRadioOption($lng->txt("search_details_info"), ilSearchBaseGUI::SEARCH_DETAILS);
         } else {
             $op2 = new ilCheckboxInputGUI($this->lng->txt('search_filter_by_type'), 'item_filter_enabled');
             $op2->setValue(1);
             //				$op2->setChecked($this->getType() == ilSearchBaseGUI::SEARCH_DETAILS);
         }
         $cbgr = new ilCheckboxGroupInputGUI('', 'filter_type');
         $cbgr->setUseValuesAsKeys(true);
         $details = $this->getDetails();
         $det = false;
         foreach (ilSearchSettings::getInstance()->getEnabledLuceneItemFilterDefinitions() as $type => $data) {
             $cb = new ilCheckboxOption($lng->txt($data['trans']), $type);
             if ($details[$type]) {
                 $det = true;
             }
             $cbgr->addOption($cb);
         }
         if ($a_mode == self::SEARCH_FORM_LUCENE) {
             if (ilSearchSettings::getInstance()->isLuceneMimeFilterEnabled()) {
                 $mimes = $this->getMimeDetails();
                 foreach (ilSearchSettings::getInstance()->getEnabledLuceneMimeFilterDefinitions() as $type => $data) {
                     $op3 = new ilCheckboxOption($this->lng->txt($data['trans']), $type);
                     if ($mimes[$type]) {
                         $det = true;
                     }
                     $cbgr->addOption($op3);
                 }
             }
         }
         $cbgr->setValue(array_merge((array) $details, (array) $mimes));
         $op2->addSubItem($cbgr);
         if ($a_mode != self::SEARCH_FORM_STANDARD && $det) {
             $op2->setChecked(true);
         }
         if ($a_mode == ilSearchBaseGUI::SEARCH_FORM_STANDARD) {
             $radg->addOption($op2);
             $this->form->addItem($radg);
         } else {
             $this->form->addItem($op2);
         }
     }
     $this->form->setFormAction($ilCtrl->getFormAction($this, 'performSearch'));
 }
コード例 #8
0
 private function addMiscSettingsFormSection(ilPropertyFormGUI $form)
 {
     // misc settings
     $header_misc = new ilFormSectionHeaderGUI();
     $header_misc->setTitle($this->lng->txt('misc'));
     $form->addItem($header_misc);
     // result filter taxonomies
     if ($this->testQuestionSetConfigFactory->getQuestionSetConfig()->isResultTaxonomyFilterSupported()) {
         $availableTaxonomyIds = $this->getAvailableTaxonomyIds();
         if (count($availableTaxonomyIds)) {
             require_once 'Modules/Test/classes/class.ilTestTaxonomyFilterLabelTranslater.php';
             $labelTranslater = new ilTestTaxonomyFilterLabelTranslater($this->db);
             $labelTranslater->loadLabelsFromTaxonomyIds($availableTaxonomyIds);
             $results_presentation = new ilCheckboxGroupInputGUI($this->lng->txt('tst_results_tax_filters'), 'results_tax_filters');
             foreach ($availableTaxonomyIds as $taxonomyId) {
                 $results_presentation->addOption(new ilCheckboxOption($labelTranslater->getTaxonomyTreeLabel($taxonomyId), $taxonomyId, ''));
             }
             $results_presentation->setValue($this->testOBJ->getResultFilterTaxIds());
             $form->addItem($results_presentation);
         }
     }
     // 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);
     // enable_archiving
     $enable_archiving = new ilCheckboxInputGUI($this->lng->txt('test_enable_archiving'), 'enable_archiving');
     $enable_archiving->setInfo($this->lng->txt('test_enable_archiving_desc'));
     $enable_archiving->setValue(1);
     $enable_archiving->setChecked($this->testOBJ->getEnableArchiving());
     $form->addItem($enable_archiving);
 }
コード例 #9
0
 public function initFilter()
 {
     global $lng, $ilUser;
     // search term
     $search_term = new ilTextInputGUI($lng->txt('search_search_term'), 'search_string');
     $search_term->setValue($_SESSION['shop_advanced_search']['string']);
     $search_term->setPostVar('search_string');
     $this->addFilterItem($search_term);
     $search_term->readFromSession();
     $this->filter["search_string"] = $search_term->getValue();
     // search combination
     $radio_grp = new ilRadioGroupInputGUI('', 'search_combination');
     $radio_or = new ilRadioOption($lng->txt('search_any_word'), 'or');
     $radio_and = new ilRadioOption($lng->txt('search_all_words'), 'and');
     $radio_grp->addOption($radio_or);
     $radio_grp->addOption($radio_and);
     $radio_grp->setValue($_POST['search_combination']);
     $this->addFilterItem($radio_grp);
     $radio_grp->readFromSession();
     $this->filter['search_combination'] = $radio_grp->getValue();
     // search objects
     $object_types = new ilCheckboxGroupInputGUI($lng->txt('obj_type'), 'search_details');
     $cb_crs = new ilCheckboxInputGUI($lng->txt('courses'), 'search_details["crs"]');
     $cb_crs->setValue('crs');
     $cb_lms = new ilCheckboxInputGUI($lng->txt('learning_resources'), 'search_details["lms"]');
     $cb_lms->setValue('lms');
     $cb_tst = new ilCheckboxInputGUI($lng->txt('tests'), 'search_details["tst"]');
     $cb_tst->setValue('tst');
     $cb_fil = new ilCheckboxInputGUI($lng->txt('objs_file'), 'search_details["fil"]');
     $cb_fil->setValue('fil');
     $object_types->addOption($cb_crs);
     $object_types->addOption($cb_lms);
     $object_types->addOption($cb_tst);
     $object_types->addOption($cb_fil);
     $object_types->setValue($_SESSION['shop_advanced_search']['details']);
     $this->addFilterItem($object_types);
     $object_types->readFromSession();
     $this->filter['search_details'] = $object_types->getValue();
     // search topics
     ilShopTopics::_getInstance()->setIdFilter(false);
     ilShopTopics::_getInstance()->read();
     $topic_option = array();
     if (count(ilShopTopics::_getInstance()->getTopics())) {
         $topic_option[''] = $lng->txt('please_select');
         foreach (ilShopTopics::_getInstance()->getTopics() as $oTopic) {
             $topic_option[(string) $oTopic->getId()] = $oTopic->getTitle();
         }
     } else {
         $topic_option[''] = $lng->txt('no_topics_yet');
     }
     $o_topic = new ilSelectInputGUI();
     $o_topic->setTitle($lng->txt('topic'));
     $o_topic->setOptions($topic_option);
     $o_topic->setValue($_SESSION['shop_advanced_search']['topic']);
     $o_topic->setPostVar('search_topic');
     $this->addFilterItem($o_topic);
     $o_topic->readFromSession();
     $this->filter["search_topic"] = $o_topic->getValue();
     if ((bool) $this->settings->get('objects_allow_custom_sorting')) {
         // sorting form
         $allow_objects_option = array('title' => $lng->txt('title'), 'author' => $lng->txt('author'), 'price' => $lng->txt('price_a'));
         $o_allow_objects = new ilSelectInputGUI();
         $o_allow_objects->setTitle($lng->txt('sort_by'));
         $o_allow_objects->setOptions($allow_objects_option);
         $o_allow_objects->setValue($this->getSortField());
         $o_allow_objects->setPostVar('order_field');
         //objects_sorting_type
         $this->addFilterItem($o_allow_objects);
         $o_allow_objects->readFromSession();
         $this->filter["order_field"] = $o_allow_objects->getValue();
         $direction_option = array('asc' => $lng->txt('sort_asc'), 'desc' => $lng->txt('sort_desc'));
         $o_object_direction = new ilSelectInputGUI();
         $o_object_direction->setOptions($direction_option);
         $o_object_direction->setValue($this->getSortDirection());
         $o_object_direction->setPostVar('order_direction');
         //objects_sorting_direction
         $this->addFilterItem($o_object_direction);
         $o_object_direction->readFromSession();
         $this->filter["order_direction"] = $o_object_direction->getValue();
     }
     if ((bool) $this->settings->get('topics_allow_custom_sorting')) {
         // sorting form
         $allow_topics_option = array(ilShopTopics::TOPICS_SORT_BY_TITLE => $lng->txt('sort_topics_by_title'), ilShopTopics::TOPICS_SORT_BY_CREATEDATE => $lng->txt('sort_topics_by_date'));
         if (ANONYMOUS_USER_ID != $ilUser->getId()) {
             $allow_topics_option[ilShopTopics::TOPICS_SORT_MANUALLY] = $lng->txt('sort_topics_manually');
         }
         $o_allow_topics = new ilSelectInputGUI();
         $o_allow_topics->setTitle($lng->txt('sort_topics_by'));
         $o_allow_topics->setOptions($allow_topics_option);
         $o_allow_topics->setValue($this->getSortingTypeTopics());
         $o_allow_topics->setPostVar('topics_sorting_type');
         $this->addFilterItem($o_allow_topics);
         $o_allow_topics->readFromSession();
         $this->filter["topics_sorting_type"] = $o_allow_topics->getValue();
         $direction_option = array('asc' => $lng->txt('sort_asc'), 'desc' => $lng->txt('sort_desc'));
         $o_topics_direction = new ilSelectInputGUI();
         $o_topics_direction->setOptions($direction_option);
         $o_topics_direction->setValue($this->getSortingDirectionTopics());
         $o_topics_direction->setPostVar('topics_sorting_direction');
         //objects_sorting_type
         $this->addFilterItem($o_topics_direction);
         $o_topics_direction->readFromSession();
         $this->filter["topics_sorting_direction"] = $o_topics_direction->getValue();
     }
 }
コード例 #10
0
 /**
  * Init standard search form.
  */
 public function initStandardSearchForm($a_mode)
 {
     global $lng, $ilCtrl;
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form = new ilPropertyFormGUI();
     $this->form->setOpenTag(false);
     $this->form->setCloseTag(false);
     // term combination
     $radg = new ilHiddenInputGUI('search_term_combination');
     $radg->setValue(ilSearchSettings::getInstance()->getDefaultOperator());
     $this->form->addItem($radg);
     /**
     $radg = new ilRadioGroupInputGUI($lng->txt("search_term_combination"),
     	"combination");
     $radg->setValue(($this->getCombination() == ilSearchBaseGUI::SEARCH_AND) ? "and" : "or");
     $op1 = new ilRadioOption($lng->txt("search_any_word"), "or");
     $radg->addOption($op1);
     $op2 = new ilRadioOption($lng->txt("search_all_words"), "and");
     $radg->addOption($op2);
     */
     // search area
     /*
     		include_once("./Services/Form/classes/class.ilRepositorySelectorInputGUI.php");
     		$ti = new ilRepositorySelectorInputGUI($lng->txt("search_area"), "area");
     		$ti->setSelectText($lng->txt("search_select_search_area"));
     		$this->form->addItem($ti);
     		$ti->readFromSession();*/
     // alex, 15.8.2012: Added the following lines to get the value
     // from the main menu top right input search form
     /*		if (isset($_POST["root_id"]))
     		{
     			$ti->setValue($_POST["root_id"]);
     			$ti->writeToSession();
     		}*/
     if (ilSearchSettings::getInstance()->isLuceneItemFilterEnabled()) {
         if ($a_mode == self::SEARCH_FORM_STANDARD) {
             // search type
             $radg = new ilRadioGroupInputGUI($lng->txt("search_type"), "type");
             $radg->setValue($this->getType() == ilSearchBaseGUI::SEARCH_FAST ? ilSearchBaseGUI::SEARCH_FAST : ilSearchBaseGUI::SEARCH_DETAILS);
             $op1 = new ilRadioOption($lng->txt("search_fast_info"), ilSearchBaseGUI::SEARCH_FAST);
             $radg->addOption($op1);
             $op2 = new ilRadioOption($lng->txt("search_details_info"), ilSearchBaseGUI::SEARCH_DETAILS);
         } else {
             $op2 = new ilCheckboxInputGUI($this->lng->txt('search_filter_by_type'), 'item_filter_enabled');
             $op2->setValue(1);
             //				$op2->setChecked($this->getType() == ilSearchBaseGUI::SEARCH_DETAILS);
         }
         $cbgr = new ilCheckboxGroupInputGUI('', 'filter_type');
         $cbgr->setUseValuesAsKeys(true);
         $details = $this->getDetails();
         $det = false;
         foreach (ilSearchSettings::getInstance()->getEnabledLuceneItemFilterDefinitions() as $type => $data) {
             $cb = new ilCheckboxOption($lng->txt($data['trans']), $type);
             if ($details[$type]) {
                 $det = true;
             }
             $cbgr->addOption($cb);
         }
         $cbgr->setValue($details);
         $op2->addSubItem($cbgr);
         if ($a_mode != self::SEARCH_FORM_STANDARD && $det) {
             $op2->setChecked(true);
         }
         if ($a_mode == ilSearchBaseGUI::SEARCH_FORM_STANDARD) {
             $radg->addOption($op2);
             $this->form->addItem($radg);
         } else {
             $this->form->addItem($op2);
         }
     }
     $this->form->setFormAction($ilCtrl->getFormAction($this, 'performSearch'));
 }
コード例 #11
0
 /**
  * Display and fill the properties form of the test
  *
  * @access	public
  */
 function propertiesObject($checkonly = FALSE)
 {
     global $ilAccess;
     if (!$ilAccess->checkAccess("write", "", $this->ref_id)) {
         // allow only write access
         ilUtil::sendInfo($this->lng->txt("cannot_edit_test"), true);
         $this->ctrl->redirect($this, "infoScreen");
     }
     // using template?
     $template_settings = null;
     $template = $this->object->getTemplate();
     if ($template) {
         include_once "Services/Administration/classes/class.ilSettingsTemplate.php";
         $template = new ilSettingsTemplate($template, ilObjAssessmentFolderGUI::getSettingsTemplateConfig());
         $template_settings = $template->getSettings();
         $hide_rte_switch = $template_settings["rte_switch"]["hide"];
     }
     $save = strcmp($this->ctrl->getCmd(), "saveProperties") == 0 ? TRUE : FALSE;
     $total = $this->object->evalTotalPersons();
     $this->tpl->addJavascript("./Services/JavaScript/js/Basic.js");
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->setTableWidth("100%");
     $form->setId("test_properties");
     if (!$template || $template && $this->formShowGeneralSection($template_settings)) {
         // 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->object->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 ($total) {
         $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->object->getAnonymity());
     $form->addItem($anonymity);
     // random selection of questions
     $random = new ilCheckboxInputGUI($this->lng->txt("tst_random_selection"), "random_test");
     $random->setValue(1);
     if ($total) {
         $random->setDisabled(true);
     }
     $random->setChecked($this->object->isRandomTest());
     $info = $this->lng->txt("tst_random_test_description");
     if ($this->object->hasQuestionsWithoutQuestionpool()) {
         $info .= $this->lng->txt("tst_random_test_description_warning");
     }
     $random->setInfo($info);
     $form->addItem($random);
     // pool usage
     $pool_usage = new ilCheckboxInputGUI($this->lng->txt("test_question_pool_usage"), "use_pool");
     $pool_usage->setValue(1);
     $pool_usage->setChecked($this->object->getPoolUsage());
     $form->addItem($pool_usage);
     // 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->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->setChecked($this->object->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->object->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'));
     $date = $this->object->getActivationStartingTime();
     $start = new ilDateTimeInputGUI($this->lng->txt('rep_activation_limited_start'), 'act_starting_time');
     #$start->setMode(ilDateTimeInputGUI::MODE_INPUT);
     $start->setShowTime(true);
     $start->setDate(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
     $opt->addSubItem($start);
     $date = $this->object->getActivationEndingTime();
     $end = new ilDateTimeInputGUI($this->lng->txt('rep_activation_limited_end'), 'act_ending_time');
     #$end->setMode(ilDateTimeInputGUI::MODE_INPUT);
     $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'), 'activation_visibility');
     $visible->setInfo($this->lng->txt('tst_activation_limited_visibility_info'));
     $visible->setChecked($this->object->getActivationVisibility());
     $opt->addSubItem($visible);
     $act_type->addOption($opt);
     $form->addItem($act_type);
     if (!$template || $template && $this->formShowBeginningEndingInformation($template_settings)) {
         // 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->object->prepareTextareaOutput($this->object->getIntroduction()));
     $intro->setRows(10);
     $intro->setCols(80);
     $intro->setUseRte(TRUE);
     $intro->addPlugin("latex");
     $intro->addButton("latex");
     $intro->setRTESupport($this->object->getId(), "tst", 'assessment', null, false, '3.4.7');
     $intro->setRteTagSet('full');
     $intro->setInfo($this->lng->txt('intro_desc'));
     // showinfo
     $showinfo = new ilCheckboxInputGUI('', "showinfo");
     $showinfo->setValue(1);
     $showinfo->setChecked($this->object->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->object->prepareTextareaOutput($this->object->getFinalStatement()));
     $finalstatement->setRows(10);
     $finalstatement->setCols(80);
     $finalstatement->setUseRte(TRUE);
     $finalstatement->addPlugin("latex");
     $finalstatement->addButton("latex");
     $finalstatement->setRTESupport($this->object->getId(), "tst", "assessment", null, false, '3.4.7');
     $finalstatement->setRteTagSet('full');
     // show final statement
     $showfinal = new ilCheckboxInputGUI('', "showfinalstatement");
     $showfinal->setValue(1);
     $showfinal->setChecked($this->object->getShowFinalStatement());
     $showfinal->setOptionTitle($this->lng->txt("final_statement_show"));
     $showfinal->setInfo($this->lng->txt("final_statement_show_desc"));
     $finalstatement->addSubItem($showfinal);
     $form->addItem($finalstatement);
     if (!$template || $template && $this->formShowSessionSection($template_settings)) {
         // 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->object->getNrOfTries());
     $nr_of_tries->setRequired(true);
     $nr_of_tries->setSuffix($this->lng->txt("0_unlimited"));
     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 ($template_settings && $template_settings['chb_processing_time'] && $template_settings['chb_processing_time']['value']) {
         $processing->setChecked(true);
     } else {
         $processing->setChecked($this->object->getEnableProcessingTime());
     }
     // max. processing time
     $processingtime = new ilDurationInputGUI('', 'processing_time');
     $ptime = $this->object->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->object->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 ($template_settings && $template_settings['chb_starting_time'] && $template_settings['chb_starting_time']['value']) {
         $enablestartingtime->setChecked(true);
     } else {
         $enablestartingtime->setChecked(strlen($this->object->getStartingTime()));
     }
     // starting time
     $startingtime = new ilDateTimeInputGUI('', 'starting_time');
     $startingtime->setShowDate(true);
     $startingtime->setShowTime(true);
     if (strlen($this->object->getStartingTime())) {
         $startingtime->setDate(new ilDateTime($this->object->getStartingTime(), IL_CAL_TIMESTAMP));
     } else {
         $startingtime->setDate(new ilDateTime(time(), IL_CAL_UNIX));
     }
     $enablestartingtime->addSubItem($startingtime);
     if ($total) {
         $enablestartingtime->setDisabled(true);
     }
     if ($total) {
         $startingtime->setDisabled(true);
     }
     $form->addItem($enablestartingtime);
     // 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 ($template_settings && $template_settings['chb_ending_time'] && $template_settings['chb_ending_time']['value']) {
         $enableendingtime->setChecked(true);
     } else {
         $enableendingtime->setChecked(strlen($this->object->getEndingTime()));
     }
     // ending time
     $endingtime = new ilDateTimeInputGUI('', 'ending_time');
     $endingtime->setShowDate(true);
     $endingtime->setShowTime(true);
     if (strlen($this->object->getEndingTime())) {
         $endingtime->setDate(new ilDateTime($this->object->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->object->getPassword());
     $password->setInfo($this->lng->txt("tst_password_details"));
     $form->addItem($password);
     if (!$template || $template && $this->formShowPresentationSection($template_settings)) {
         // 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->object->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->object->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->object->getTitleOutput());
     $title_output->setInfo($this->lng->txt("tst_title_output_description"));
     $form->addItem($title_output);
     // Autosave
     $autosave_output = new ilCheckboxInputGUI($this->lng->txt('autosave'), 'autosave');
     $autosave_output->setValue(1);
     $autosave_output->setChecked($this->object->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->object->getAutosaveIval());
     $autosave_interval->setInfo($this->lng->txt('autosave_ival_info'));
     $autosave_output->addSubItem($autosave_interval);
     $form->addItem($autosave_output);
     if (!$template || $template && $this->formShowSequenceSection($template_settings)) {
         // 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->object->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->object->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->object->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->object->getListOfQuestionsStart()) {
         array_push($values, 'chb_list_of_questions_start');
     }
     if ($this->object->getListOfQuestionsEnd()) {
         array_push($values, 'chb_list_of_questions_end');
     }
     if ($this->object->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->object->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->object->getShowCancel());
     $cancel->setInfo($this->lng->txt("tst_show_cancel_description"));
     $form->addItem($cancel);
     if (!$template || $template && $this->formShowNotificationSection($template_settings)) {
         // 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->object->getMailNotification());
     $form->addItem($mailnotification);
     $mailnottype = new ilCheckboxInputGUI('', "mailnottype");
     $mailnottype->setValue(1);
     $mailnottype->setOptionTitle($this->lng->txt("mailnottype"));
     $mailnottype->setChecked($this->object->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->object->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->object->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->object->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->object->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->object->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->object->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->object->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->object->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->object->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->object->getHighscoreTopNum());
     $highscore_top_table->setInfo($this->lng->txt("tst_highscore_top_num_description"));
     $highscore->addSubItem($highscore_top_num);
     if (!$template || $template && $this->formShowKioskSection($template_settings)) {
         // kiosk mode properties
         $kioskheader = new ilFormSectionHeaderGUI();
         $kioskheader->setTitle($this->lng->txt("kiosk"));
         $form->addItem($kioskheader);
     }
     // kiosk mode
     $kiosk = new ilCheckboxInputGUI($this->lng->txt("kiosk"), "kiosk");
     $kiosk->setValue(1);
     $kiosk->setChecked($this->object->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', ''));
     $values = array();
     if ($this->object->getShowKioskModeTitle()) {
         array_push($values, 'kiosk_title');
     }
     if ($this->object->getShowKioskModeParticipant()) {
         array_push($values, 'kiosk_participant');
     }
     $kiosktitle->setValue($values);
     $kiosktitle->setInfo($this->lng->txt("kiosk_options_desc"));
     $kiosk->addSubItem($kiosktitle);
     $form->addItem($kiosk);
     if (!$template || $template && $this->formShowParticipantSection($template_settings)) {
         // 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->object->getFixedParticipants());
     $fixedparticipants->setOptionTitle($this->lng->txt("tst_allow_fixed_participants"));
     $fixedparticipants->setInfo($this->lng->txt("participants_invitation_description"));
     $invited_users = $this->object->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->object->getAllowedUsers() ? $this->object->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->object->getAllowedUsersTimeGap() ? $this->object->getAllowedUsersTimeGap() : '');
     $form->addItem($idle);
     // Edit ecs export settings
     include_once 'Modules/Test/classes/class.ilECSTestSettings.php';
     $ecs = new ilECSTestSettings($this->object);
     $ecs->addSettingsToForm($form, 'tst');
     if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) {
         $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);
             }
         }
     }
     $errors = false;
     if ($save) {
         $errors = !$form->checkInput();
         $form->setValuesByPost();
         if ($online->getChecked() && !$this->object->isComplete()) {
             $online->setAlert($this->lng->txt("cannot_switch_to_online_no_questions_andor_no_mark_steps"));
             ilUtil::sendFailure($this->lng->txt('form_input_not_valid'));
             $errors = true;
         }
         if ($errors) {
             $checkonly = false;
         }
     }
     if (!$checkonly) {
         // using template?
         $message = "";
         if ($template) {
             global $tpl;
             $link = $this->ctrl->getLinkTarget($this, "confirmResetTemplate");
             $link = "<a href=\"" . $link . "\">" . $this->lng->txt("test_using_template_link") . "</a>";
             $message = "<div style=\"margin-top:10px\">" . $tpl->getMessageHTML(sprintf($this->lng->txt("test_using_template"), $template->getTitle(), $link), "info") . "</div>";
         }
         $this->tpl->setVariable("ADM_CONTENT", $form->getHTML() . $message);
     }
     return $errors;
 }
コード例 #12
0
 /**
  * Show Privacy settings
  *
  * @access public
  */
 public function showPrivacy()
 {
     $privacy = ilPrivacySettings::_getInstance();
     $this->tabs_gui->setTabActive('show_privacy');
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->setTitle($this->lng->txt('ps_privacy_protection'));
     include_once 'Services/Membership/classes/class.ilMemberAgreement.php';
     if (ilMemberAgreement::_hasAgreements()) {
         ilUtil::sendInfo($this->lng->txt('ps_warning_modify'));
     }
     $value = array();
     if ($privacy->enabledCourseExport()) {
         $value[] = "export_course";
     }
     if ($privacy->enabledGroupExport()) {
         $value[] = "export_group";
     }
     if ($privacy->courseConfirmationRequired()) {
         $value[] = "export_confirm_course";
     }
     if ($privacy->groupConfirmationRequired()) {
         $value[] = "export_confirm_group";
     }
     if ($privacy->enabledGroupAccessTimes()) {
         $value[] = "grp_access_times";
     }
     if ($privacy->enabledCourseAccessTimes()) {
         $value[] = "crs_access_times";
     }
     $group = new ilCheckboxGroupInputGUI($this->lng->txt('ps_profile_export'), 'profile_protection');
     $group->setValue($value);
     $check = new ilCheckboxOption();
     $check->setTitle($this->lng->txt('ps_export_course'));
     $check->setValue('export_course');
     $group->addOption($check);
     $check = new ilCheckboxOption();
     $check->setTitle($this->lng->txt('ps_export_groups'));
     $check->setValue('export_group');
     $group->addOption($check);
     $check = new ilCheckboxOption();
     $check->setTitle($this->lng->txt('ps_export_confirm'));
     $check->setValue('export_confirm_course');
     $group->addOption($check);
     $check = new ilCheckboxOption();
     $check->setTitle($this->lng->txt('ps_export_confirm_group'));
     $check->setValue('export_confirm_group');
     $group->addOption($check);
     $check = new ilCheckboxOption();
     $check->setTitle($this->lng->txt('ps_show_grp_access'));
     $check->setValue('grp_access_times');
     $group->addOption($check);
     $check = new ilCheckboxOption();
     $check->setTitle($this->lng->txt('ps_show_crs_access'));
     $check->setValue('crs_access_times');
     $group->addOption($check);
     $form->addItem($group);
     include_once "Services/Administration/classes/class.ilAdministrationSettingsFormHandler.php";
     ilAdministrationSettingsFormHandler::addFieldsToForm(ilAdministrationSettingsFormHandler::FORM_PRIVACY, $form, $this);
     $form->addCommandButton('save_privacy', $this->lng->txt('save'));
     $this->tpl->setContent($form->getHTML());
 }
コード例 #13
0
 /**
  * Display and fill the scoring settings form of the test
  *
  * @access	public
  */
 function scoringObject($checkonly = FALSE)
 {
     global $ilAccess;
     if (!$ilAccess->checkAccess("write", "", $this->ref_id)) {
         // allow only write access
         ilUtil::sendInfo($this->lng->txt("cannot_edit_test"), true);
         $this->ctrl->redirect($this, "infoScreen");
     }
     // using template?
     $template_settings = null;
     $template = $this->object->getTemplate();
     if ($template) {
         include_once "Services/Administration/classes/class.ilSettingsTemplate.php";
         include_once "Modules/Test/classes/class.ilObjAssessmentFolderGUI.php";
         $template = new ilSettingsTemplate($template, ilObjAssessmentFolderGUI::getSettingsTemplateConfig());
         $template_settings = $template->getSettings();
     }
     $save = strcmp($this->ctrl->getCmd(), "saveScoring") == 0 ? TRUE : FALSE;
     $total = $this->object->evalTotalPersons();
     $this->tpl->addJavascript("./Services/JavaScript/js/Basic.js");
     // Determine settings availability
     $setting_available = true;
     // In general, the scoring settings are available.
     if ($total != 0) {
         $setting_available = false;
         // Unless there are results from users.
     }
     if ($this->object->getScoreReporting() == 4) {
         $setting_available = true;
         // But if the results are not public since they will never be
     }
     if ($this->object->getScoreReporting() == 3 && $this->object->getReportingDate() > time()) {
         $setting_available = true;
         // or the presentation date is not reached, then we can still edit them.
     }
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->setTableWidth("100%");
     $form->setId("test_properties_scoring");
     // scoring properties
     $header = new ilFormSectionHeaderGUI();
     $header->setTitle($this->lng->txt("test_scoring"));
     $form->addItem($header);
     // scoring system
     $count_system = new ilRadioGroupInputGUI($this->lng->txt("tst_text_count_system"), "count_system");
     $count_system->addOption(new ilRadioOption($this->lng->txt("tst_count_partial_solutions"), 0, ''));
     $count_system->addOption(new ilRadioOption($this->lng->txt("tst_count_correct_solutions"), 1, ''));
     $count_system->setValue($this->object->getCountSystem());
     $count_system->setInfo($this->lng->txt("tst_count_system_description"));
     $count_system->setDisabled(!$setting_available);
     $form->addItem($count_system);
     // mc questions
     $mc_scoring = new ilRadioGroupInputGUI($this->lng->txt("tst_score_mcmr_questions"), "mc_scoring");
     $mc_scoring->addOption(new ilRadioOption($this->lng->txt("tst_score_mcmr_zero_points_when_unanswered"), 0, ''));
     $mc_scoring->addOption(new ilRadioOption($this->lng->txt("tst_score_mcmr_use_scoring_system"), 1, ''));
     $mc_scoring->setValue($this->object->getMCScoring());
     $mc_scoring->setInfo($this->lng->txt("tst_score_mcmr_questions_description"));
     $mc_scoring->setDisabled(!$setting_available);
     $form->addItem($mc_scoring);
     // score cutting
     $score_cutting = new ilRadioGroupInputGUI($this->lng->txt("tst_score_cutting"), "score_cutting");
     $score_cutting->addOption(new ilRadioOption($this->lng->txt("tst_score_cut_question"), 0, ''));
     $score_cutting->addOption(new ilRadioOption($this->lng->txt("tst_score_cut_test"), 1, ''));
     $score_cutting->setValue($this->object->getScoreCutting());
     $score_cutting->setInfo($this->lng->txt("tst_score_cutting_description"));
     $score_cutting->setDisabled(!$setting_available);
     $form->addItem($score_cutting);
     // pass scoring
     $pass_scoring = new ilRadioGroupInputGUI($this->lng->txt("tst_pass_scoring"), "pass_scoring");
     $pass_scoring->addOption(new ilRadioOption($this->lng->txt("tst_pass_last_pass"), 0, ''));
     $pass_scoring->addOption(new ilRadioOption($this->lng->txt("tst_pass_best_pass"), 1, ''));
     $pass_scoring->setValue($this->object->getPassScoring());
     $pass_scoring->setInfo($this->lng->txt("tst_pass_scoring_description"));
     $pass_scoring->setDisabled(!$setting_available);
     $form->addItem($pass_scoring);
     // test presentation
     $header_tp = new ilFormSectionHeaderGUI();
     $header_tp->setTitle($this->lng->txt("test_presentation"));
     $form->addItem($header_tp);
     // enable obligations
     $checkBoxEnableObligations = new ilCheckboxInputGUI($this->lng->txt("tst_setting_enable_obligations_label"), "obligations_enabled");
     $checkBoxEnableObligations->setChecked($this->object->areObligationsEnabled());
     $checkBoxEnableObligations->setInfo($this->lng->txt("tst_setting_enable_obligations_info"));
     if ($total) {
         $checkBoxEnableObligations->setDisabled(true);
     }
     $form->addItem($checkBoxEnableObligations);
     // offer hints
     $checkBoxOfferHints = new ilCheckboxInputGUI($this->lng->txt("tst_setting_offer_hints_label"), "offer_hints");
     $checkBoxOfferHints->setChecked($this->object->isOfferingQuestionHintsEnabled());
     $checkBoxOfferHints->setInfo($this->lng->txt("tst_setting_offer_hints_info"));
     if ($total) {
         $checkBoxOfferHints->setDisabled(true);
     }
     $form->addItem($checkBoxOfferHints);
     // instant feedback
     $instant_feedback = new ilCheckboxGroupInputGUI($this->lng->txt("tst_instant_feedback"), "instant_feedback");
     $instant_feedback->addOption(new ilCheckboxOption($this->lng->txt("tst_instant_feedback_answer_specific"), 'instant_feedback_specific', ''));
     $instant_feedback->addOption(new ilCheckboxOption($this->lng->txt("tst_instant_feedback_answer_generic"), 'instant_feedback_generic', ''));
     $instant_feedback->addOption(new ilCheckboxOption($this->lng->txt("tst_instant_feedback_results"), 'instant_feedback_points', ''));
     $instant_feedback->addOption(new ilCheckboxOption($this->lng->txt("tst_instant_feedback_solution"), 'instant_feedback_solution', ''));
     $values = array();
     if ($this->object->getSpecificAnswerFeedback()) {
         array_push($values, 'instant_feedback_specific');
     }
     if ($this->object->getGenericAnswerFeedback()) {
         array_push($values, 'instant_feedback_generic');
     }
     if ($this->object->getAnswerFeedbackPoints()) {
         array_push($values, 'instant_feedback_points');
     }
     if ($this->object->getInstantFeedbackSolution()) {
         array_push($values, 'instant_feedback_solution');
     }
     $instant_feedback->setValue($values);
     $instant_feedback->setInfo($this->lng->txt("tst_instant_feedback_description"));
     $form->addItem($instant_feedback);
     // scoring properties
     $header_tr = new ilFormSectionHeaderGUI();
     $header_tr->setTitle($this->lng->txt("test_results"));
     $form->addItem($header_tr);
     // access to test results
     $results_access = new ilRadioGroupInputGUI($this->lng->txt("tst_results_access"), "results_access");
     $results_access->addOption(new ilRadioOption($this->lng->txt("tst_results_access_always"), 2, ''));
     $results_access->addOption(new ilRadioOption($this->lng->txt("tst_results_access_finished"), 1, ''));
     $results_access_date_limitation = new ilRadioOption($this->lng->txt("tst_results_access_date"), 3, '');
     $results_access->addOption($results_access_date_limitation);
     $results_access->addOption(new ilRadioOption($this->lng->txt("tst_results_access_never"), 4, ''));
     $results_access->setValue($this->object->getScoreReporting());
     $results_access->setInfo($this->lng->txt("tst_results_access_description"));
     // access date
     $reporting_date = new ilDateTimeInputGUI('', 'reporting_date');
     $reporting_date->setShowDate(true);
     $reporting_date->setShowTime(true);
     if (strlen($this->object->getReportingDate())) {
         $reporting_date->setDate(new ilDateTime($this->object->getReportingDate(), IL_CAL_TIMESTAMP));
     } else {
         $reporting_date->setDate(new ilDateTime(time(), IL_CAL_UNIX));
     }
     $results_access_date_limitation->addSubItem($reporting_date);
     $form->addItem($results_access);
     $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->setValue(1);
     $results_print_best_solution->setChecked((bool) $this->object->isBestSolutionPrintedWithResult());
     $form->addItem($results_print_best_solution);
     // results presentation
     $results_presentation = new ilCheckboxGroupInputGUI($this->lng->txt("tst_results_presentation"), "results_presentation");
     $results_presentation->addOption(new ilCheckboxOption($this->lng->txt("tst_show_pass_details"), 'pass_details', ''));
     $results_presentation->addOption(new ilCheckboxOption($this->lng->txt("tst_show_solution_details"), 'solution_details', ''));
     $results_presentation->addOption(new ilCheckboxOption($this->lng->txt("tst_show_solution_printview"), 'solution_printview', ''));
     $results_presentation->addOption(new ilCheckboxOption($this->lng->txt("tst_show_solution_compare"), 'solution_compare', ''));
     $results_presentation->addOption(new ilCheckboxOption($this->lng->txt("tst_show_solution_feedback"), 'solution_feedback', ''));
     $results_presentation->addOption(new ilCheckboxOption($this->lng->txt("tst_show_solution_answers_only"), 'solution_answers_only', ''));
     $signatureOption = new ilCheckboxOption($this->lng->txt("tst_show_solution_signature"), 'solution_signature', '');
     $results_presentation->addOption($signatureOption);
     $results_presentation->addOption(new ilCheckboxOption($this->lng->txt("tst_show_solution_suggested"), 'solution_suggested', ''));
     $values = array();
     if ($this->object->getShowPassDetails()) {
         array_push($values, 'pass_details');
     }
     if ($this->object->getShowSolutionDetails()) {
         array_push($values, 'solution_details');
     }
     if ($this->object->getShowSolutionPrintview()) {
         array_push($values, 'solution_printview');
     }
     if ($this->object->getShowSolutionFeedback()) {
         array_push($values, 'solution_feedback');
     }
     if ($this->object->getShowSolutionAnswersOnly()) {
         array_push($values, 'solution_answers_only');
     }
     if ($this->object->getShowSolutionSignature()) {
         array_push($values, 'solution_signature');
     }
     if ($this->object->getShowSolutionSuggested()) {
         array_push($values, 'solution_suggested');
     }
     if ($this->object->getShowSolutionListComparison()) {
         array_push($values, 'solution_compare');
     }
     $results_presentation->setValue($values);
     $results_presentation->setInfo($this->lng->txt("tst_results_presentation_description"));
     if ($this->object->getAnonymity()) {
         $signatureOption->setDisabled(true);
     }
     $form->addItem($results_presentation);
     // misc properties
     $header_misc = new ilFormSectionHeaderGUI();
     $header_misc->setTitle($this->lng->txt("misc"));
     $form->addItem($header_misc);
     // deletion of test results
     $passDeletion = new ilRadioGroupInputGUI($this->lng->txt("tst_pass_deletion"), "pass_deletion_allowed");
     $passDeletion->addOption(new ilRadioOption($this->lng->txt("tst_pass_deletion_not_allowed"), 0, ''));
     $passDeletion->addOption(new ilRadioOption($this->lng->txt("tst_pass_deletion_allowed"), 1, ''));
     $passDeletion->setValue($this->object->isPassDeletionAllowed());
     $form->addItem($passDeletion);
     // export settings
     $export_settings = new ilCheckboxGroupInputGUI($this->lng->txt("tst_export_settings"), "export_settings");
     $export_settings->addOption(new ilCheckboxOption($this->lng->txt("tst_exp_sc_short"), 'exp_sc_short', ''));
     $values = array();
     if ($this->object->getExportSettingsSingleChoiceShort()) {
         array_push($values, 'exp_sc_short');
     }
     $export_settings->setValue($values);
     $form->addItem($export_settings);
     if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]) && $total == 0) {
         $form->addCommandButton("saveScoring", $this->lng->txt("save"));
     }
     if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]) && $total != 0) {
         $form->addCommandButton("confirmScoring", $this->lng->txt("save"));
     }
     // remove items when using template
     if ($template_settings) {
         foreach ($template_settings as $id => $item) {
             if ($item["hide"]) {
                 $form->removeItemByPostVar($id);
             }
         }
     }
     $errors = false;
     if ($save) {
         $errors = !$form->checkInput();
         $form->setValuesByPost();
         if ($errors) {
             $checkonly = false;
         }
     }
     if (!$checkonly) {
         $this->tpl->setVariable("ADM_CONTENT", $form->getHTML());
     }
     return $errors;
 }
 public function initIliasSettingsForm()
 {
     /**
      * @var $ilCtrl ilCtrl
      */
     global $lng, $ilCtrl;
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $this->form = new ilPropertyFormGUI();
     $this->form->setFormAction($ilCtrl->getFormAction($this, 'saveIliasSettings'));
     $this->form->setTitle($this->getPluginObject()->txt('general_settings'));
     $this->form->addCommandButton('saveIliasSettings', $lng->txt('save'));
     $this->form->addCommandButton('cancelIliasSettings', $lng->txt('cancel'));
     $cb_group = new ilCheckboxGroupInputGUI($this->pluginObj->txt('object_creation_settings'), 'obj_creation_settings');
     include_once "Services/Administration/classes/class.ilSettingsTemplate.php";
     $templates = ilSettingsTemplate::getAllSettingsTemplates("xavc");
     if ($templates) {
         foreach ($templates as $item) {
             $cb_simple = new ilCheckboxOption($this->pluginObj->txt($item["title"]), $item["id"]);
             $cb_group->addOption($cb_simple);
         }
     }
     $cb_group->setInfo($this->pluginObj->txt('template_info'));
     $this->form->addItem($cb_group);
     $obj_title_suffix = new ilCheckboxInputGUI($this->pluginObj->txt('obj_title_suffix'), 'obj_title_suffix');
     $obj_title_suffix->setInfo($this->pluginObj->txt('obj_title_suffix_info'));
     $this->form->addItem($obj_title_suffix);
     $crs_grp_trigger = new ilCheckboxInputGUI($this->pluginObj->txt('allow_crs_grp_trigger'), 'allow_crs_grp_trigger');
     $crs_grp_trigger->setInfo($this->pluginObj->txt('allow_crs_grp_trigger_info'));
     $this->form->addItem($crs_grp_trigger);
     $show_free_slots = new ilCheckboxInputGUI($this->pluginObj->txt('show_free_slots'), 'show_free_slots');
     $show_free_slots->setInfo($this->pluginObj->txt('show_free_slots_info'));
     $this->form->addItem($show_free_slots);
     $enable_perm_room = new ilCheckboxInputGUI($this->pluginObj->txt('enable_perm_room'), 'enable_perm_room');
     $enable_perm_room->setInfo($this->pluginObj->txt('enable_perm_room_info'));
     $default_perm_room = new ilCheckboxInputGUI($this->pluginObj->txt('default_perm_room'), 'default_perm_room');
     $default_perm_room->setInfo($this->pluginObj->txt('default_perm_room_info'));
     $enable_perm_room->addSubItem($default_perm_room);
     $this->form->addItem($enable_perm_room);
     $add_to_desktop = new ilCheckboxInputGUI($this->pluginObj->txt('add_to_desktop'), 'add_to_desktop');
     $add_to_desktop->setInfo($this->pluginObj->txt('add_to_desktop_info'));
     $this->form->addItem($add_to_desktop);
     $content_file_types = new ilTextInputGUI($this->pluginObj->txt('content_file_types'), 'content_file_types');
     $content_file_types->setRequired(true);
     $content_file_types->setInfo($this->pluginObj->txt('content_file_types_info'));
     $this->form->addItem($content_file_types);
     $user_folders = new ilCheckboxInputGUI($this->pluginObj->txt('use_user_folders'), 'use_user_folders');
     $user_folders->setInfo($this->pluginObj->txt('use_user_folders_info'));
     if (ilAdobeConnectServer::getSetting('user_assignment_mode') == ilAdobeConnectServer::ASSIGN_USER_DFN_EMAIL) {
         $user_folders->setDisabled(true);
     }
     $this->form->addItem($user_folders);
     $xavc_options = array("host" => $this->pluginObj->txt("presenter"), "mini-host" => $this->pluginObj->txt("moderator"), "view" => $this->pluginObj->txt("participant"), "denied" => $this->pluginObj->txt('denied'));
     $mapping_crs = new ilNonEditableValueGUI($this->pluginObj->txt('default_crs_mapping'), 'default_crs_mapping');
     //		$crs_owner = new ilSelectInputGUI($lng->txt('owner'), 'crs_owner');
     //		$crs_owner->setOptions($xavc_options);
     //		$mapping_crs->addSubItem($crs_owner);
     $crs_admin = new ilSelectInputGUI($lng->txt('il_crs_admin'), 'crs_admin');
     $crs_admin->setOptions($xavc_options);
     $mapping_crs->addSubItem($crs_admin);
     $crs_tutor = new ilSelectInputGUI($lng->txt('il_crs_tutor'), 'crs_tutor');
     $crs_tutor->setOptions($xavc_options);
     $mapping_crs->addSubItem($crs_tutor);
     $crs_member = new ilSelectInputGUI($lng->txt('il_crs_member'), 'crs_member');
     $crs_member->setOptions($xavc_options);
     $mapping_crs->addSubItem($crs_member);
     $this->form->addItem($mapping_crs);
     $mapping_grp = new ilNonEditableValueGUI($this->pluginObj->txt('default_grp_mapping'), 'default_grp_mapping');
     //		$grp_owner = new ilSelectInputGUI($lng->txt('owner'), 'grp_owner');
     //		$grp_owner->setOptions($xavc_options);
     //		$mapping_grp->addSubItem($grp_owner);
     $grp_admin = new ilSelectInputGUI($lng->txt('il_grp_admin'), 'grp_admin');
     $grp_admin->setOptions($xavc_options);
     $mapping_grp->addSubItem($grp_admin);
     $grp_member = new ilSelectInputGUI($lng->txt('il_grp_member'), 'grp_member');
     $grp_member->setOptions($xavc_options);
     $mapping_grp->addSubItem($grp_member);
     $this->form->addItem($mapping_grp);
     $ac_permissions = ilXAVCPermissions::getPermissionsArray();
     //@todo nahmad: in Template auslagern!
     $tbl = "<table width='100%' >\n\t\t<tr>\n\t\t<td> </td> \n\t\t<td>" . $this->pluginObj->txt('presenter') . "</td>\n\t\t<td>" . $this->pluginObj->txt('moderator') . "</td>\n\t\t<td>" . $this->pluginObj->txt('participant') . "</td>\n\t\t<td>" . $this->pluginObj->txt('denied') . "</td>\n\t\t\n\t\t</tr>";
     foreach ($ac_permissions as $ac_permission => $ac_roles) {
         $tbl .= "<tr> <td>" . $this->pluginObj->txt($ac_permission) . "</td>";
         foreach ($ac_roles as $ac_role => $ac_access) {
             $tbl .= "<td>";
             $tbl .= ilUtil::formCheckbox((bool) $ac_access, 'permissions[' . $ac_permission . '][' . $ac_role . ']', $ac_role, false);
             $tbl .= "</td>";
         }
         $tbl .= "</tr>";
     }
     $tbl .= "</table>";
     $matrix = new ilCustomInputGUI($this->pluginObj->txt('ac_permissions'), '');
     $matrix->setHtml($tbl);
     $this->form->addItem($matrix);
 }
コード例 #15
0
 /**
  * Init form
  *
  * @param string $a_cmd
  * @return ilPropertyFormGUI
  */
 public function initForm($a_cmd = "")
 {
     global $ilCtrl, $lng;
     $lng->loadLanguageModule('crs');
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setFormAction($ilCtrl->getFormAction($this->parent_obj, $a_cmd));
     $form->setTarget('_blank');
     $form->setTitle($lng->txt('sess_gen_attendance_list'));
     $title = new ilTextInputGUI($lng->txt('title'), 'title');
     $title->setValue($this->title);
     $form->addItem($title);
     $desc = new ilTextInputGUI($lng->txt('description'), 'desc');
     $desc->setValue($this->description);
     $form->addItem($desc);
     if (sizeof($this->presets)) {
         $preset = new ilCheckboxGroupInputGUI($lng->txt('user_detail'), 'preset');
         $preset_value = array();
         foreach ($this->presets as $id => $item) {
             $preset->addOption(new ilCheckboxOption($item[0], $id));
             if ($item[1]) {
                 $preset_value[] = $id;
             }
         }
         $preset->setValue($preset_value);
         $form->addItem($preset);
     }
     $blank = new ilTextInputGUI($lng->txt('event_blank_columns'), 'blank');
     $blank->setMulti(true);
     $form->addItem($blank);
     if ($this->pre_blanks) {
         $blank->setValue($this->pre_blanks);
     }
     $part = new ilFormSectionHeaderGUI();
     $part->setTitle($lng->txt('event_participant_selection'));
     $form->addItem($part);
     // participants by roles
     foreach ($this->role_data as $role_id => $role_data) {
         $chk = new ilCheckboxInputGUI($role_data[0], 'role_' . $role_id);
         $chk->setValue(1);
         $chk->setChecked(1);
         $form->addItem($chk);
     }
     // not in sessions
     if ($this->waiting_list) {
         $chk = new ilCheckboxInputGUI($lng->txt('group_new_registrations'), 'subscr');
         $chk->setValue(1);
         $form->addItem($chk);
         $chk = new ilCheckboxInputGUI($lng->txt('crs_waiting_list'), 'wlist');
         $chk->setValue(1);
         $form->addItem($chk);
     }
     if ($this->user_filters) {
         foreach ($this->user_filters as $sub_id => $sub_item) {
             $sub = new ilCheckboxInputGUI($sub_item[0], 'members_' . $sub_id);
             if ($sub_item[1]) {
                 $sub->setChecked(true);
             }
             $form->addItem($sub);
         }
     }
     $form->addCommandButton($a_cmd, $lng->txt('sess_print_attendance_list'));
     if ($this->id && $a_cmd) {
         include_once "Services/User/classes/class.ilUserFormSettings.php";
         $settings = new ilUserFormSettings($this->id);
         $settings->deleteValue('desc');
         // #11340
         $settings->exportToForm($form);
     }
     return $form;
 }
コード例 #16
0
 /**
  * Init settings form
  */
 protected function initFormSettings()
 {
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->getCtrl()->getFormAction($this));
     $form->setTitle($this->getLang()->txt('ecs_part_settings') . ' ' . $this->getParticipant()->getTitle());
     $token = new ilCheckboxInputGUI($this->getLang()->txt('ecs_token_mechanism'), 'token');
     $token->setInfo($this->getLang()->txt('ecs_token_mechanism_info'));
     $token->setValue(1);
     $token->setChecked($this->getParticipant()->isTokenEnabled());
     $form->addItem($token);
     $dtoken = new ilCheckboxInputGUI($this->getLang()->txt('ecs_deprecated_token'), 'dtoken');
     $dtoken->setInfo($this->getLang()->txt('ecs_deprecated_token_info'));
     $dtoken->setValue(1);
     $dtoken->setChecked($this->getParticipant()->isDeprecatedTokenEnabled());
     $form->addItem($dtoken);
     // Export
     $export = new ilCheckboxInputGUI($this->getLang()->txt('ecs_tbl_export'), 'export');
     $export->setValue(1);
     $export->setChecked($this->getParticipant()->isExportEnabled());
     $form->addItem($export);
     // Export types
     $obj_types = new ilCheckboxGroupInputGUI($this->getLang()->txt('ecs_export_types'), 'export_types');
     $obj_types->setValue($this->getParticipant()->getExportTypes());
     include_once './Services/WebServices/ECS/classes/class.ilECSUtils.php';
     foreach (ilECSUtils::getPossibleReleaseTypes(TRUE) as $type => $trans) {
         $obj_types->addOption(new ilCheckboxOption($trans, $type));
     }
     $export->addSubItem($obj_types);
     // Import
     $import = new ilCheckboxInputGUI($this->getLang()->txt('ecs_tbl_import'), 'import');
     $import->setValue(1);
     $import->setChecked($this->getParticipant()->isImportEnabled());
     $form->addItem($import);
     // Export types
     $imp_types = new ilCheckboxGroupInputGUI($this->getLang()->txt('ecs_import_types'), 'import_types');
     $imp_types->setValue($this->getParticipant()->getImportTypes());
     include_once './Services/WebServices/ECS/classes/class.ilECSUtils.php';
     foreach (ilECSUtils::getPossibleRemoteTypes(TRUE) as $type => $trans) {
         $imp_types->addOption(new ilCheckboxOption($trans, $type));
     }
     $import->addSubItem($imp_types);
     $form->addCommandButton('saveSettings', $this->getLang()->txt('save'));
     $form->addCommandButton('abort', $this->getLang()->txt('cancel'));
     return $form;
 }
コード例 #17
0
 /**
  * @param ilPropertyFormGUI $form
  */
 private function addTestSequenceProperties(ilPropertyFormGUI $form)
 {
     // sequence properties
     $seqheader = new ilFormSectionHeaderGUI();
     $seqheader->setTitle($this->lng->txt("tst_sequence_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);
     // 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);
     // 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);
     // 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);
 }
コード例 #18
0
 private function initReplyEditForm()
 {
     /**
      * @var $ilUser ilObjUser
      * @var $rbacsystem ilRbacSystem
      * @var $ilSetting ilSetting
      */
     global $ilUser, $rbacsystem, $ilSetting;
     // init objects
     $oForumObjects = $this->getForumObjects();
     /**
      * @var $frm ilForum
      */
     $frm = $oForumObjects['frm'];
     /**
      * @var $oFDForum ilFileDataForum
      */
     $oFDForum = $oForumObjects['file_obj'];
     require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $this->replyEditForm = new ilPropertyFormGUI();
     $this->replyEditForm->setTableWidth('100%');
     // titel
     if ($_GET['action'] == 'showreply' || $_GET['action'] == 'ready_showreply') {
         $this->ctrl->setParameter($this, 'action', 'ready_showreply');
     } else {
         $this->ctrl->setParameter($this, 'action', 'ready_showedit');
     }
     // form action
     $this->ctrl->setParameter($this, 'pos_pk', $this->objCurrentPost->getId());
     $this->ctrl->setParameter($this, 'thr_pk', $this->objCurrentPost->getThreadId());
     $this->ctrl->setParameter($this, 'offset', (int) $_GET['offset']);
     $this->ctrl->setParameter($this, 'orderby', $_GET['orderby']);
     $this->replyEditForm->setFormAction($this->ctrl->getFormAction($this, 'savePost', $this->objCurrentPost->getId()));
     $this->ctrl->clearParameters($this);
     if ($_GET['action'] == 'showreply' || $_GET['action'] == 'ready_showreply') {
         $this->replyEditForm->setTitle($this->lng->txt('forums_your_reply'));
     } else {
         $this->replyEditForm->setTitle($this->lng->txt('forums_edit_post'));
     }
     // alias
     if ($this->objProperties->isAnonymized() && in_array($_GET['action'], array('showreply', 'ready_showreply'))) {
         $oAnonymousNameGUI = new ilTextInputGUI($this->lng->txt('forums_your_name'), 'alias');
         $oAnonymousNameGUI->setMaxLength(64);
         $oAnonymousNameGUI->setInfo($this->lng->txt('forums_use_alias'));
         $this->replyEditForm->addItem($oAnonymousNameGUI);
     }
     // subject
     $oSubjectGUI = new ilTextInputGUI($this->lng->txt('forums_subject'), 'subject');
     $oSubjectGUI->setMaxLength(64);
     $oSubjectGUI->setRequired(true);
     if ($this->objProperties->getSubjectSetting() == 'empty_subject') {
         $oSubjectGUI->setInfo($this->lng->txt('enter_new_subject'));
     }
     $this->replyEditForm->addItem($oSubjectGUI);
     // post
     $oPostGUI = new ilTextAreaInputGUI($_GET['action'] == 'showreply' || $_GET['action'] == 'ready_showreply' ? $this->lng->txt('forums_your_reply') : $this->lng->txt('forums_edit_post'), 'message');
     $oPostGUI->setRequired(true);
     $oPostGUI->setCols(50);
     $oPostGUI->setRows(15);
     $oPostGUI->setUseRte(true);
     $oPostGUI->addPlugin('latex');
     $oPostGUI->addButton('latex');
     $oPostGUI->addButton('pastelatex');
     $oPostGUI->addPlugin('ilfrmquote');
     //$oPostGUI->addPlugin('code');
     if ($_GET['action'] == 'showreply' || $_GET['action'] == 'ready_showreply') {
         $oPostGUI->addButton('ilFrmQuoteAjaxCall');
     }
     $oPostGUI->removePlugin('advlink');
     $oPostGUI->setRTERootBlockElement('');
     $oPostGUI->usePurifier(true);
     $oPostGUI->disableButtons(array('charmap', 'undo', 'redo', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'anchor', 'fullscreen', 'cut', 'copy', 'paste', 'pastetext', 'formatselect'));
     if ($_GET['action'] == 'showreply' || $_GET['action'] == 'ready_showreply') {
         $oPostGUI->setRTESupport($ilUser->getId(), 'frm~', 'frm_post', 'tpl.tinymce_frm_post.html', false, '3.4.7');
     } else {
         $oPostGUI->setRTESupport($this->objCurrentPost->getId(), 'frm', 'frm_post', 'tpl.tinymce_frm_post.html', false, '3.4.7');
     }
     // purifier
     require_once 'Services/Html/classes/class.ilHtmlPurifierFactory.php';
     $oPostGUI->setPurifier(ilHtmlPurifierFactory::_getInstanceByType('frm_post'));
     $this->replyEditForm->addItem($oPostGUI);
     // notification only if gen. notification is disabled and forum isn't anonymous
     include_once 'Services/Mail/classes/class.ilMail.php';
     $umail = new ilMail($ilUser->getId());
     if ($rbacsystem->checkAccess('internal_mail', $umail->getMailObjectReferenceId()) && !$frm->isThreadNotificationEnabled($ilUser->getId(), $this->objCurrentPost->getThreadId()) && !$this->objProperties->isAnonymized()) {
         $oNotificationGUI = new ilCheckboxInputGUI('', 'notify');
         $oNotificationGUI->setInfo($this->lng->txt('forum_notify_me'));
         $this->replyEditForm->addItem($oNotificationGUI);
     }
     // attachments
     $oFileUploadGUI = new ilFileWizardInputGUI($this->lng->txt('forums_attachments_add'), 'userfile');
     $oFileUploadGUI->setFilenames(array(0 => ''));
     $this->replyEditForm->addItem($oFileUploadGUI);
     require_once 'Services/Captcha/classes/class.ilCaptchaUtil.php';
     if ($ilUser->isAnonymous() && !$ilUser->isCaptchaVerified() && ilCaptchaUtil::isActiveForForum()) {
         require_once 'Services/Captcha/classes/class.ilCaptchaInputGUI.php';
         $captcha = new ilCaptchaInputGUI($this->lng->txt('cont_captcha_code'), 'captcha_code');
         $captcha->setRequired(true);
         $this->replyEditForm->addItem($captcha);
     }
     // edit attachments
     if (count($oFDForum->getFilesOfPost()) && ($_GET['action'] == 'showedit' || $_GET['action'] == 'ready_showedit')) {
         $oExistingAttachmentsGUI = new ilCheckboxGroupInputGUI($this->lng->txt('forums_delete_file'), 'del_file');
         foreach ($oFDForum->getFilesOfPost() as $file) {
             $oAttachmentGUI = new ilCheckboxInputGUI($file['name'], 'del_file');
             $oAttachmentGUI->setValue($file['md5']);
             $oExistingAttachmentsGUI->addOption($oAttachmentGUI);
         }
         $this->replyEditForm->addItem($oExistingAttachmentsGUI);
     }
     // buttons
     $this->replyEditForm->addCommandButton('savePost', $this->lng->txt('create'));
     if ($_GET['action'] == 'showreply' || $_GET['action'] == 'ready_showreply') {
         include_once 'Services/RTE/classes/class.ilRTE.php';
         $rtestring = ilRTE::_getRTEClassname();
         if (array_key_exists('show_rte', $_POST)) {
             ilObjAdvancedEditing::_setRichTextEditorUserState($_POST['show_rte']);
         }
         if (strtolower($rtestring) != 'iltinymce' || !ilObjAdvancedEditing::_getRichTextEditorUserState()) {
             $this->replyEditForm->addCommandButton('quotePost', $this->lng->txt('forum_add_quote'));
         }
     }
     $this->replyEditForm->addCommandButton('cancelPost', $this->lng->txt('cancel'));
 }
コード例 #19
0
 protected function initSettingsForm()
 {
     global $rbacsystem;
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->setTitle($this->lng->txt('tracking_settings'));
     $activate = new ilCheckboxGroupInputGUI($this->lng->txt('activate_tracking'));
     $form->addItem($activate);
     // learning progress
     $lp = new ilCheckboxInputGUI($this->lng->txt('trac_learning_progress'), 'learning_progress_tracking');
     if ($this->object->enabledLearningProgress()) {
         $lp->setChecked(true);
     }
     $activate->addSubItem($lp);
     // lp settings
     /*
     $desktop = new ilCheckboxInputGUI($this->lng->txt('trac_lp_on_personal_desktop'), 'lp_desktop');
     $desktop->setInfo($this->lng->txt('trac_lp_on_personal_desktop_info'));
     $desktop->setChecked($this->object->hasLearningProgressDesktop());
     $lp->addSubItem($desktop);
     */
     $learner = new ilCheckboxInputGUI($this->lng->txt('trac_lp_learner_access'), 'lp_learner');
     $learner->setInfo($this->lng->txt('trac_lp_learner_access_info'));
     $learner->setChecked($this->object->hasLearningProgressLearner());
     $lp->addSubItem($learner);
     // extended data
     $extdata = new ilCheckboxGroupInputGUI($this->lng->txt('trac_learning_progress_settings_info'), 'lp_extdata');
     $extdata->addOption(new ilCheckboxOption($this->lng->txt('trac_first_and_last_access'), 'lp_access'));
     $extdata->addOption(new ilCheckboxOption($this->lng->txt('trac_read_count'), 'lp_count'));
     $extdata->addOption(new ilCheckboxOption($this->lng->txt('trac_spent_seconds'), 'lp_spent'));
     $lp->addSubItem($extdata);
     $ext_value = array();
     if ($this->object->hasExtendedData(ilObjUserTracking::EXTENDED_DATA_LAST_ACCESS)) {
         $ext_value[] = 'lp_access';
     }
     if ($this->object->hasExtendedData(ilObjUserTracking::EXTENDED_DATA_READ_COUNT)) {
         $ext_value[] = 'lp_count';
     }
     if ($this->object->hasExtendedData(ilObjUserTracking::EXTENDED_DATA_SPENT_SECONDS)) {
         $ext_value[] = 'lp_spent';
     }
     $extdata->setValue($ext_value);
     $listgui = new ilCheckboxInputGUI($this->lng->txt('trac_lp_list_gui'), 'lp_list');
     $listgui->setInfo($this->lng->txt('trac_lp_list_gui_info'));
     $listgui->setChecked($this->object->hasLearningProgressListGUI());
     $lp->addSubItem($listgui);
     /* => REPOSITORY
     		// change event
     		$event = new ilCheckboxInputGUI($this->lng->txt('trac_repository_changes'), 'change_event_tracking');
     		if($this->object->enabledChangeEventTracking())
     		{
     			$event->setChecked(true);
     		}
     		$activate->addSubItem($event);
     		*/
     // object statistics
     $objstat = new ilCheckboxInputGUI($this->lng->txt('trac_object_statistics'), 'object_statistics');
     if ($this->object->enabledObjectStatistics()) {
         $objstat->setChecked(true);
     }
     $activate->addSubItem($objstat);
     // session statistics
     $sessstat = new ilCheckboxInputGUI($this->lng->txt('session_statistics'), 'session_statistics');
     if ($this->object->enabledSessionStatistics()) {
         $sessstat->setChecked(true);
     }
     $activate->addSubItem($sessstat);
     // Anonymized
     $user = new ilCheckboxInputGUI($this->lng->txt('trac_anonymized'), 'user_related');
     $user->setInfo($this->lng->txt('trac_anonymized_info'));
     $user->setChecked(!$this->object->enabledUserRelatedData());
     $form->addItem($user);
     // Max time gap
     $valid = new ilNumberInputGUI($this->lng->txt('trac_valid_request'), 'valid_request');
     $valid->setMaxLength(4);
     $valid->setSize(4);
     $valid->setSuffix($this->lng->txt('seconds'));
     $valid->setInfo($this->lng->txt('info_valid_request'));
     $valid->setValue($this->object->getValidTimeSpan());
     $valid->setMinValue(1);
     $valid->setMaxValue(9999);
     $valid->setRequired(true);
     $form->addItem($valid);
     include_once "Services/Administration/classes/class.ilAdministrationSettingsFormHandler.php";
     ilAdministrationSettingsFormHandler::addFieldsToForm(ilAdministrationSettingsFormHandler::FORM_LP, $form, $this);
     // #12259
     if ($rbacsystem->checkAccess("write", $this->object->getRefId())) {
         $form->addCommandButton('saveSettings', $this->lng->txt('save'));
     } else {
         $lp->setDisabled(true);
         $learner->setDisabled(true);
         $extdata->setDisabled(true);
         $listgui->setDisabled(true);
         $objstat->setDisabled(true);
         $user->setDisabled(true);
         $valid->setDisabled(true);
     }
     return $form;
 }
コード例 #20
0
 protected function initCreatePortfolioFromTemplateForm($a_prtt_id, $a_title)
 {
     global $ilSetting, $ilUser;
     if ((int) $_REQUEST["exc_id"]) {
         $this->ctrl->setParameter($this, "exc_id", (int) $_REQUEST["exc_id"]);
         $this->ctrl->setParameter($this, "ass_id", (int) $_REQUEST["ass_id"]);
     }
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $tmpl = new ilNonEditableValueGUI($this->lng->txt("obj_prtt"));
     $tmpl->setValue(ilObject::_lookupTitle($a_prtt_id));
     $form->addItem($tmpl);
     $title = new ilNonEditableValueGUI($this->lng->txt("title"), "pt");
     $title->setValue($a_title);
     $form->addItem($title);
     // gather user blogs
     if (!$ilSetting->get('disable_wsp_blogs')) {
         $blog_options = array();
         include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
         $tree = new ilWorkspaceTree($this->user_id);
         $root = $tree->readRootId();
         if ($root) {
             $root = $tree->getNodeData($root);
             foreach ($tree->getSubTree($root, true, "blog") as $node) {
                 $blog_options[$node["obj_id"]] = $node["title"];
             }
             asort($blog_options);
         }
     }
     $has_form_content = false;
     include_once "Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php";
     $check_quota = ilDiskQuotaActivationChecker::_isPersonalWorkspaceActive();
     $quota_sum = 0;
     include_once "Services/Skill/classes/class.ilPersonalSkill.php";
     $pskills = array_keys(ilPersonalSkill::getSelectedUserSkills($ilUser->getId()));
     $skill_ids = array();
     include_once "Modules/Portfolio/classes/class.ilPortfolioTemplatePage.php";
     foreach (ilPortfolioTemplatePage::getAllPages($a_prtt_id) as $page) {
         switch ($page["type"]) {
             case ilPortfolioTemplatePage::TYPE_PAGE:
                 // skills
                 $source_page = new ilPortfolioTemplatePage($page["id"]);
                 $source_page->buildDom(true);
                 $dom = $source_page->getDom();
                 if ($dom instanceof php4DOMDocument) {
                     $dom = $dom->myDOMDocument;
                 }
                 $xpath = new DOMXPath($dom);
                 $nodes = $xpath->query("//PageContent/Skills");
                 foreach ($nodes as $node) {
                     $skill_id = $node->getAttribute("Id");
                     if (!in_array($skill_id, $pskills)) {
                         $skill_ids[] = $skill_id;
                     }
                 }
                 unset($nodes);
                 unset($xpath);
                 unset($dom);
                 if ($check_quota) {
                     $quota_sum += $source_page->getPageDiskSize();
                 }
                 if (sizeof($skill_ids)) {
                     $has_form_content = true;
                 }
                 break;
             case ilPortfolioTemplatePage::TYPE_BLOG_TEMPLATE:
                 if (!$ilSetting->get('disable_wsp_blogs')) {
                     $has_form_content = true;
                     $field_id = "blog_" . $page["id"];
                     $blog = new ilRadioGroupInputGUI($this->lng->txt("obj_blog") . ": " . $page["title"], $field_id);
                     $blog->setRequired(true);
                     $blog->setValue("blog_create");
                     $form->addItem($blog);
                     $new_blog = new ilRadioOption($this->lng->txt("prtf_template_import_blog_create"), "blog_create");
                     $blog->addOption($new_blog);
                     $title = new ilTextInputGUI($this->lng->txt("title"), $field_id . "_create_title");
                     $title->setRequired(true);
                     $new_blog->addSubItem($title);
                     if (sizeof($blog_options)) {
                         $reuse_blog = new ilRadioOption($this->lng->txt("prtf_template_import_blog_reuse"), "blog_resuse");
                         $blog->addOption($reuse_blog);
                         $obj = new ilSelectInputGUI($this->lng->txt("obj_blog"), $field_id . "_reuse_blog");
                         $obj->setRequired(true);
                         $obj->setOptions(array("" => $this->lng->txt("please_select")) + $blog_options);
                         $reuse_blog->addSubItem($obj);
                     }
                     $blog->addOption(new ilRadioOption($this->lng->txt("prtf_template_import_blog_ignore"), "blog_ignore"));
                 }
                 break;
         }
     }
     if ($skill_ids) {
         include_once "Services/Skill/classes/class.ilSkillTreeNode.php";
         $skills = new ilCheckboxGroupInputGUI($this->lng->txt("skills"), "skill_ids");
         $skills->setInfo($this->lng->txt("prtf_template_import_new_skills"));
         $skills->setValue($skill_ids);
         foreach ($skill_ids as $skill_id) {
             $skills->addOption(new ilCheckboxOption(ilSkillTreeNode::_lookupTitle($skill_id), $skill_id));
         }
         $form->addItem($skills);
     }
     if ($quota_sum) {
         include_once "Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
         if (!ilDiskQuotaHandler::isUploadPossible($quota_sum)) {
             ilUtil::sendFailure($this->lng->txt("prtf_template_import_quota_failure"), true);
             $this->ctrl->redirect($this, "create");
         }
     }
     // no dialog needed, go ahead
     if (!$has_form_content) {
         return;
     }
     $form->setTitle($this->lng->txt("prtf_creation_mode") . ": " . $this->lng->txt("prtf_creation_mode_template"));
     $form->addCommandButton("createPortfolioFromTemplateProcess", $this->lng->txt("continue"));
     $form->addCommandButton("toRepository", $this->lng->txt("cancel"));
     return $form;
 }
コード例 #21
0
 /**
  * display assessment folder settings form
  */
 public function settingsObject()
 {
     global $ilAccess;
     global $ilTabs;
     $ilTabs->setTabActive('settings');
     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");
     // general properties
     $header = new ilFormSectionHeaderGUI();
     $header->setTitle($this->lng->txt("assessment_log_logging"));
     $form->addItem($header);
     // assessment logging
     $logging = new ilCheckboxInputGUI('', "chb_assessment_logging");
     $logging->setValue(1);
     $logging->setChecked($this->object->_enabledAssessmentLogging());
     $logging->setOptionTitle($this->lng->txt("activate_assessment_logging"));
     $form->addItem($logging);
     // reporting language
     $reporting = new ilSelectInputGUI($this->lng->txt('assessment_settings_reporting_language'), "reporting_language");
     $languages = $this->lng->getInstalledLanguages();
     $this->lng->loadLanguageModule("meta");
     $options = array();
     foreach ($languages as $lang) {
         $options[$lang] = $this->lng->txt("meta_l_" . $lang);
     }
     $reporting->setOptions($options);
     $reporting->setValue($this->object->_getLogLanguage());
     $form->addItem($reporting);
     // 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);
     if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
         $form->addCommandButton("saveSettings", $this->lng->txt("save"));
     }
     $this->tpl->setVariable("ADM_CONTENT", $form->getHTML());
 }
コード例 #22
0
 /**
  * Show Privacy settings
  *
  * @access public
  */
 public function showPrivacy()
 {
     $privacy = ilPrivacySettings::_getInstance();
     $this->tabs_gui->setTabActive('show_privacy');
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->setTitle($this->lng->txt('ps_privacy_protection'));
     include_once 'Services/Membership/classes/class.ilMemberAgreement.php';
     if (ilMemberAgreement::_hasAgreements()) {
         $html = new ilNonEditableValueGUI();
         $html->setValue($this->lng->txt('ps_warning_modify'));
         $form->addItem($html);
     }
     $value = array();
     if ($privacy->enabledCourseExport()) {
         $value[] = "export_course";
     }
     if ($privacy->enabledGroupExport()) {
         $value[] = "export_group";
     }
     if ($privacy->courseConfirmationRequired()) {
         $value[] = "export_confirm_course";
     }
     if ($privacy->groupConfirmationRequired()) {
         $value[] = "export_confirm_group";
     }
     if ($privacy->enabledGroupAccessTimes()) {
         $value[] = "grp_access_times";
     }
     if ($privacy->enabledCourseAccessTimes()) {
         $value[] = "crs_access_times";
     }
     $group = new ilCheckboxGroupInputGUI($this->lng->txt('ps_profile_export'), 'profile_protection');
     $group->setValue($value);
     $check = new ilCheckboxOption();
     $check->setTitle($this->lng->txt('ps_export_course'));
     $check->setValue('export_course');
     $group->addOption($check);
     $check = new ilCheckboxOption();
     $check->setTitle($this->lng->txt('ps_export_groups'));
     $check->setValue('export_group');
     $group->addOption($check);
     $check = new ilCheckboxOption();
     $check->setTitle($this->lng->txt('ps_export_confirm'));
     $check->setValue('export_confirm_course');
     $group->addOption($check);
     $check = new ilCheckboxOption();
     $check->setTitle($this->lng->txt('ps_export_confirm_group'));
     $check->setValue('export_confirm_group');
     $group->addOption($check);
     $check = new ilCheckboxOption();
     $check->setTitle($this->lng->txt('ps_show_grp_access'));
     $check->setValue('grp_access_times');
     $group->addOption($check);
     $check = new ilCheckboxOption();
     $check->setTitle($this->lng->txt('ps_show_crs_access'));
     $check->setValue('crs_access_times');
     $group->addOption($check);
     $form->addItem($group);
     $check = new ilCheckboxInputGui($this->lng->txt('enable_fora_statistics'), 'fora_statistics');
     $check->setInfo($this->lng->txt('enable_fora_statistics_desc'));
     $check->setChecked($privacy->enabledForaStatistics());
     $form->addItem($check);
     $check = new ilCheckboxInputGui($this->lng->txt('enable_anonymous_fora'), 'anonymous_fora');
     $check->setInfo($this->lng->txt('enable_anonymous_fora_desc'));
     $check->setChecked($privacy->enabledAnonymousFora());
     $form->addItem($check);
     $check = new ilCheckboxInputGui($this->lng->txt('enable_sahs_protocol_data'), 'enable_sahs_pd');
     $check->setInfo($this->lng->txt('enable_sahs_protocol_data_desc'));
     $check->setChecked($privacy->enabledSahsProtocolData());
     $form->addItem($check);
     $check = new ilCheckboxInputGui($this->lng->txt('rbac_log'), 'rbac_log');
     $check->setInfo($this->lng->txt('rbac_log_info'));
     $check->setChecked($privacy->enabledRbacLog());
     $form->addItem($check);
     $age = new ilNumberInputGUI($this->lng->txt('rbac_log_age'), 'rbac_log_age');
     $age->setInfo($this->lng->txt('rbac_log_age_info'));
     $age->setValue($privacy->getRbacLogAge());
     $age->setMinValue(1);
     $age->setMaxValue(24);
     $age->setSize(2);
     $age->setMaxLength(2);
     $check->addSubItem($age);
     $form->addCommandButton('save_privacy', $this->lng->txt('save'));
     $this->tpl->setContent($form->getHTML());
 }
コード例 #23
0
 function initForm($a_mode)
 {
     global $ilCtrl, $lng, $ilSetting;
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form_gui = new ilPropertyFormGUI();
     $form_gui->setFormAction($ilCtrl->getFormAction($this));
     $form_gui->setTitle($lng->txt("cont_ed_pglprop"));
     // title
     $title_input = new ilTextInputGUI($lng->txt("title"), "pgl_title");
     $title_input->setSize(50);
     $title_input->setMaxLength(128);
     $title_input->setValue($this->layout_object->title);
     $title_input->setTitle($lng->txt("title"));
     $title_input->setRequired(true);
     // description
     $desc_input = new ilTextAreaInputGUI($lng->txt("description"), "pgl_desc");
     $desc_input->setValue($this->layout_object->description);
     $desc_input->setRows(3);
     $desc_input->setCols(37);
     $desc_input->setTitle($lng->txt("description"));
     $desc_input->setRequired(false);
     // modules
     $mods = new ilCheckboxGroupInputGUI($this->lng->txt("modules"), "module");
     // $mods->setRequired(true);
     $mods->setValue($this->layout_object->getModules());
     foreach (ilPageLayout::getAvailableModules() as $mod_id => $mod_caption) {
         $mod = new ilCheckboxOption($mod_caption, $mod_id);
         $mods->addOption($mod);
     }
     $form_gui->addItem($title_input);
     $form_gui->addItem($desc_input);
     $form_gui->addItem($mods);
     // style
     $fixed_style = $ilSetting->get("fixed_content_style_id");
     $style_id = $this->layout_object->getStyleId();
     if ($fixed_style > 0) {
         $st = new ilNonEditableValueGUI($lng->txt("cont_current_style"));
         $st->setValue(ilObject::_lookupTitle($fixed_style) . " (" . $this->lng->txt("global_fixed") . ")");
         $form_gui->addItem($st);
     } else {
         include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
         $st_styles = ilObjStyleSheet::_getStandardStyles(true, false);
         $st_styles[0] = $this->lng->txt("default");
         ksort($st_styles);
         $style_sel = new ilSelectInputGUI($lng->txt("obj_sty"), "style_id");
         $style_sel->setOptions($st_styles);
         $style_sel->setValue($style_id);
         $form_gui->addItem($style_sel);
     }
     $form_gui->addCommandButton("updateProperties", $lng->txt($a_mode));
     return $form_gui;
 }
コード例 #24
0
 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;
 }
コード例 #25
0
 /**
  * Init field form
  * 
  * @param string $a_mode 
  * @return ilPropertyFormGUI
  */
 function initForm($a_mode = "create")
 {
     global $ilCtrl, $lng;
     include_once "Services/Membership/classes/class.ilMemberAgreement.php";
     if (ilMemberAgreement::_hasAgreements()) {
         $lng->loadLanguageModule("ps");
         ilUtil::sendInfo($lng->txt("ps_warning_modify"));
     }
     if ($this->field_definition) {
         $perms = $this->permissions->hasPermissions(ilUDFPermissionHelper::CONTEXT_FIELD, $this->field_definition["field_id"], array(array(ilUDFPermissionHelper::ACTION_FIELD_EDIT_PROPERTY, ilUDFPermissionHelper::SUBACTION_FIELD_TITLE), array(ilUDFPermissionHelper::ACTION_FIELD_EDIT_PROPERTY, ilUDFPermissionHelper::SUBACTION_FIELD_PROPERTIES), array(ilUDFPermissionHelper::ACTION_FIELD_EDIT_ACCESS, ilUDFPermissionHelper::SUBACTION_FIELD_ACCESS_VISIBLE_PERSONAL), array(ilUDFPermissionHelper::ACTION_FIELD_EDIT_ACCESS, ilUDFPermissionHelper::SUBACTION_FIELD_ACCESS_VISIBLE_REGISTRATION), array(ilUDFPermissionHelper::ACTION_FIELD_EDIT_ACCESS, ilUDFPermissionHelper::SUBACTION_FIELD_ACCESS_VISIBLE_LOCAL), array(ilUDFPermissionHelper::ACTION_FIELD_EDIT_ACCESS, ilUDFPermissionHelper::SUBACTION_FIELD_ACCESS_VISIBLE_COURSES), array(ilUDFPermissionHelper::ACTION_FIELD_EDIT_ACCESS, ilUDFPermissionHelper::SUBACTION_FIELD_ACCESS_VISIBLE_GROUPS), array(ilUDFPermissionHelper::ACTION_FIELD_EDIT_ACCESS, ilUDFPermissionHelper::SUBACTION_FIELD_ACCESS_CHANGEABLE_PERSONAL), array(ilUDFPermissionHelper::ACTION_FIELD_EDIT_ACCESS, ilUDFPermissionHelper::SUBACTION_FIELD_ACCESS_CHANGEABLE_LOCAL), array(ilUDFPermissionHelper::ACTION_FIELD_EDIT_ACCESS, ilUDFPermissionHelper::SUBACTION_FIELD_ACCESS_REQUIRED), array(ilUDFPermissionHelper::ACTION_FIELD_EDIT_ACCESS, ilUDFPermissionHelper::SUBACTION_FIELD_ACCESS_EXPORT), array(ilUDFPermissionHelper::ACTION_FIELD_EDIT_ACCESS, ilUDFPermissionHelper::SUBACTION_FIELD_ACCESS_SEARCHABLE), array(ilUDFPermissionHelper::ACTION_FIELD_EDIT_ACCESS, ilUDFPermissionHelper::SUBACTION_FIELD_ACCESS_CERTIFICATE)));
         $perm_map = self::getAccessPermissions();
     }
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($ilCtrl->getFormAction($this));
     $name = new ilTextInputGUI($lng->txt("field_name"), "name");
     $name->setRequired(true);
     $form->addItem($name);
     if ($perms && !$perms[ilUDFPermissionHelper::ACTION_FIELD_EDIT_PROPERTY][ilUDFPermissionHelper::SUBACTION_FIELD_TITLE]) {
         $name->setDisabled(true);
     }
     // type
     $radg = new ilRadioGroupInputGUI($lng->txt("field_type"), "field_type");
     $radg->setRequired(true);
     $op1 = new ilRadioOption($lng->txt("udf_type_text"), UDF_TYPE_TEXT);
     $radg->addOption($op1);
     $op2 = new ilRadioOption($lng->txt("udf_type_select"), UDF_TYPE_SELECT);
     $radg->addOption($op2);
     $op3 = new ilRadioOption($lng->txt("udf_type_wysiwyg"), UDF_TYPE_WYSIWYG);
     $radg->addOption($op3);
     $form->addItem($radg);
     // select values
     $se_mu = new ilTextWizardInputGUI($lng->txt("value"), "selvalue");
     $se_mu->setRequired(true);
     $se_mu->setSize(32);
     $se_mu->setMaxLength(128);
     $se_mu->setValues(array(''));
     $op2->addSubItem($se_mu);
     if ($perms && !$perms[ilUDFPermissionHelper::ACTION_FIELD_EDIT_PROPERTY][ilUDFPermissionHelper::SUBACTION_FIELD_PROPERTIES]) {
         $se_mu->setDisabled(true);
         $se_mu->setRequired(false);
     }
     // access
     $acc = new ilCheckboxGroupInputGUI($lng->txt("access"), "access");
     $acc_values = array();
     foreach ($this->getAccessOptions() as $id => $caption) {
         $opt = new ilCheckboxOption($caption, $id);
         $acc->addOption($opt);
         if ($this->field_definition && $this->field_definition[$id]) {
             $acc_values[] = $id;
         }
         if ($perms && !$perms[ilUDFPermissionHelper::ACTION_FIELD_EDIT_ACCESS][$perm_map[$id]]) {
             $opt->setDisabled(true);
         }
     }
     $form->addItem($acc);
     if ($a_mode == "create") {
         $radg->setValue(UDF_TYPE_TEXT);
         $form->setTitle($lng->txt('add_new_user_defined_field'));
         $form->addCommandButton("create", $lng->txt("save"));
         $form->addCommandButton("listUserDefinedFields", $lng->txt("cancel"));
     } else {
         $name->setValue($this->field_definition["field_name"]);
         $radg->setValue($this->field_definition["field_type"]);
         $radg->setDisabled(true);
         $acc->setValue($acc_values);
         switch ($this->field_definition["field_type"]) {
             case UDF_TYPE_SELECT:
                 $se_mu->setValue($this->field_definition["field_values"]);
                 $form->setTitle($lng->txt("udf_update_select_field"));
                 break;
             case UDF_TYPE_TEXT:
                 $form->setTitle($lng->txt("udf_update_text_field"));
                 break;
             case UDF_TYPE_WYSIWYG:
                 $form->setTitle($lng->txt("udf_update_wysiwyg_field"));
                 break;
         }
         $form->addCommandButton("update", $lng->txt("save"));
         $form->addCommandButton("listUserDefinedFields", $lng->txt("cancel"));
     }
     return $form;
 }
コード例 #26
0
 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;
 }
コード例 #27
0
 /**
  * Init field form
  * 
  * @param string $a_mode 
  * @return ilPropertyFormGUI
  */
 function initForm($a_mode = "create")
 {
     global $ilCtrl, $lng;
     include_once "Services/Membership/classes/class.ilMemberAgreement.php";
     if (ilMemberAgreement::_hasAgreements()) {
         $lng->loadLanguageModule("ps");
         ilUtil::sendInfo($lng->txt("ps_warning_modify"));
     }
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($ilCtrl->getFormAction($this));
     $name = new ilTextInputGUI($lng->txt("field_name"), "name");
     $name->setRequired(true);
     $form->addItem($name);
     // type
     $radg = new ilRadioGroupInputGUI($lng->txt("field_type"), "field_type");
     $radg->setRequired(true);
     $op1 = new ilRadioOption($lng->txt("udf_type_text"), UDF_TYPE_TEXT);
     $radg->addOption($op1);
     $op2 = new ilRadioOption($lng->txt("udf_type_select"), UDF_TYPE_SELECT);
     $radg->addOption($op2);
     $op3 = new ilRadioOption($lng->txt("udf_type_wysiwyg"), UDF_TYPE_WYSIWYG);
     $radg->addOption($op3);
     $form->addItem($radg);
     // select values
     $se_mu = new ilTextWizardInputGUI($lng->txt("value"), "selvalue");
     $se_mu->setRequired(true);
     $se_mu->setSize(32);
     $se_mu->setMaxLength(128);
     $se_mu->setValues(array(''));
     $op2->addSubItem($se_mu);
     // access
     $acc = new ilCheckboxGroupInputGUI($lng->txt("access"), "access");
     $acc_values = array();
     foreach ($this->getAccessOptions() as $id => $caption) {
         $opt = new ilCheckboxOption($caption, $id);
         $acc->addOption($opt);
         if ($this->field_definition && $this->field_definition[$id]) {
             $acc_values[] = $id;
         }
     }
     $form->addItem($acc);
     if ($a_mode == "create") {
         $radg->setValue(UDF_TYPE_TEXT);
         $form->setTitle($lng->txt('add_new_user_defined_field'));
         $form->addCommandButton("create", $lng->txt("save"));
         $form->addCommandButton("listUserDefinedFields", $lng->txt("cancel"));
     } else {
         $name->setValue($this->field_definition["field_name"]);
         $radg->setValue($this->field_definition["field_type"]);
         $radg->setDisabled(true);
         $acc->setValue($acc_values);
         switch ($this->field_definition["field_type"]) {
             case UDF_TYPE_SELECT:
                 $se_mu->setValue($this->field_definition["field_values"]);
                 $form->setTitle($lng->txt("udf_update_select_field"));
                 break;
             case UDF_TYPE_TEXT:
                 $form->setTitle($lng->txt("udf_update_text_field"));
                 break;
             case UDF_TYPE_WYSIWYG:
                 $form->setTitle($lng->txt("udf_update_wysiwyg_field"));
                 break;
         }
         $form->addCommandButton("update", $lng->txt("save"));
         $form->addCommandButton("listUserDefinedFields", $lng->txt("cancel"));
     }
     return $form;
 }
コード例 #28
0
 function initAddPageLayoutForm()
 {
     global $lng, $ilCtrl;
     $lng->loadLanguageModule("content");
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form_gui = new ilPropertyFormGUI();
     $form_gui->setFormAction($ilCtrl->getFormAction($this));
     $form_gui->setTitle($lng->txt("sty_create_pgl"));
     include_once "Services/Form/classes/class.ilRadioMatrixInputGUI.php";
     $title_input = new ilTextInputGUI($lng->txt("title"), "pgl_title");
     $title_input->setSize(50);
     $title_input->setMaxLength(128);
     $title_input->setValue($this->layout_object->title);
     $title_input->setTitle($lng->txt("title"));
     $title_input->setRequired(true);
     $desc_input = new ilTextAreaInputGUI($lng->txt("description"), "pgl_desc");
     $desc_input->setValue($this->layout_object->description);
     $desc_input->setRows(3);
     $desc_input->setCols(37);
     // special page?
     $options = array("0" => $lng->txt("cont_layout_template"), "1" => $lng->txt("cont_special_page"));
     $si = new ilSelectInputGUI($this->lng->txt("type"), "special_page");
     $si->setOptions($options);
     // modules
     $mods = new ilCheckboxGroupInputGUI($this->lng->txt("modules"), "module");
     // $mods->setRequired(true);
     foreach (ilPageLayout::getAvailableModules() as $mod_id => $mod_caption) {
         $mod = new ilCheckboxOption($mod_caption, $mod_id);
         $mods->addOption($mod);
     }
     $ttype_input = new ilSelectInputGUI($lng->txt("sty_based_on"), "pgl_template");
     $arr_templates = ilPageLayout::getLayouts();
     $arr_templates1 = ilPageLayout::getLayouts(false, true);
     foreach ($arr_templates1 as $v) {
         $arr_templates[] = $v;
     }
     $options = array();
     $options['-1'] = $lng->txt("none");
     foreach ($arr_templates as $templ) {
         $templ->readObject();
         $key = $templ->getId();
         $value = $templ->getTitle();
         $options[$key] = $value;
     }
     $ttype_input->setOptions($options);
     $ttype_input->setValue(-1);
     $ttype_input->setRequired(true);
     $desc_input->setTitle($lng->txt("description"));
     $desc_input->setRequired(false);
     $form_gui->addItem($title_input);
     $form_gui->addItem($desc_input);
     $form_gui->addItem($si);
     $form_gui->addItem($mods);
     $form_gui->addItem($ttype_input);
     $form_gui->addCommandButton("createPg", $lng->txt("save"));
     $form_gui->addCommandButton("cancelCreate", $lng->txt("cancel"));
     return $form_gui;
 }
コード例 #29
0
 /**
  * Init settings form
  */
 protected function initSettingsForm()
 {
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->setTitle($this->lng->txt('crs_loc_settings_tbl'));
     $type = new ilRadioGroupInputGUI($this->lng->txt('crs_loc_settings_type'), 'type');
     $type->setRequired(true);
     $type->setValue(ilLOSettings::getInstanceByObjId($this->getParentObject()->getId())->getType());
     $type_1 = new ilRadioOption($this->lng->txt('crs_loc_type_initial_all'), ilLOSettings::LOC_INITIAL_ALL);
     $type_1->setInfo($this->lng->txt('crs_loc_type_initial_all_info'));
     $type->addOption($type_1);
     $type_2 = new ilRadioOption($this->lng->txt('crs_loc_type_initial_sel'), ilLOSettings::LOC_INITIAL_SEL);
     #$type->addOption($type_2);
     $type_3 = new ilRadioOption($this->lng->txt('crs_loc_type_qualified'), ilLOSettings::LOC_QUALIFIED);
     $type_3->setInfo($this->lng->txt('crs_loc_type_qualified_info'));
     $type->addOption($type_3);
     $type_4 = new ilRadioOption($this->lng->txt('crs_loc_type_practise'), ilLOSettings::LOC_PRACTISE);
     $type_4->setInfo($this->lng->txt('crs_loc_type_practise_info'));
     $type->addOption($type_4);
     $form->addItem($type);
     $form->addCommandButton('saveSettings', $this->lng->txt('save'));
     // qualified test visibility
     $qtv = new ilCheckboxGroupInputGUI($this->lng->txt('crs_loc_qt_visibility'), 'qtv');
     $qtv_values = array();
     if ($this->getSettings()->isGeneralQualifiedTestVisible()) {
         $qtv_values[] = ilLOSettings::QT_VISIBLE_ALL;
     }
     if ($this->getSettings()->isQualifiedTestPerObjectiveVisible()) {
         $qtv_values[] = ilLOSettings::QT_VISIBLE_OBJECTIVE;
     }
     $qtv->setValue($qtv_values);
     $qtv->setRequired(true);
     $qtv->addOption(new ilCheckboxOption($this->lng->txt('crs_loc_qt_visibility_all'), ilLOSettings::QT_VISIBLE_ALL));
     $qtv->addOption(new ilCheckboxOption($this->lng->txt('crs_loc_qt_visibility_lo'), ilLOSettings::QT_VISIBLE_OBJECTIVE));
     #$form->addItem($qtv);
     // reset results
     $reset = new ilCheckboxInputGUI($this->lng->txt('crs_loc_settings_reset'), 'reset');
     $reset->setValue(1);
     $reset->setChecked($this->getSettings()->isResetResultsEnabled());
     $reset->setOptionTitle($this->lng->txt('crs_loc_settings_reset_enable'));
     $reset->setInfo($this->lng->txt('crs_loc_settings_reset_enable_info'));
     $form->addItem($reset);
     return $form;
 }