public function build() { $this->setFormAction($this->ctrl->getFormAction($this->questionSetConfigGUI)); $this->setTitle($this->lng->txt('tst_rnd_quest_set_cfg_general_form')); $this->setId('tstRndQuestSetCfgGeneralForm'); $this->addCommandButton(ilTestRandomQuestionSetConfigGUI::CMD_SAVE_GENERAL_CONFIG_FORM, $this->lng->txt('save')); // Require Pools with Homogeneous Scored Questions $requirePoolsQuestionsHomoScored = new ilCheckboxInputGUI($this->lng->txt('tst_inp_all_quest_points_equal_per_pool'), 'quest_points_equal_per_pool'); $requirePoolsQuestionsHomoScored->setInfo($this->lng->txt('tst_inp_all_quest_points_equal_per_pool_desc')); $requirePoolsQuestionsHomoScored->setChecked($this->questionSetConfig->arePoolsWithHomogeneousScoredQuestionsRequired()); $this->addItem($requirePoolsQuestionsHomoScored); // question amount config mode (per test / per pool) $questionAmountConfigMode = new ilRadioGroupInputGUI($this->lng->txt('tst_inp_quest_amount_cfg_mode'), 'quest_amount_cfg_mode'); $questionAmountConfigMode->setValue($this->fetchValidQuestionAmountConfigModeWithFallbackModePerTest($this->questionSetConfig)); $questionAmountConfigModePerTest = new ilRadioOption($this->lng->txt('tst_inp_quest_amount_cfg_mode_test'), ilTestRandomQuestionSetConfig::QUESTION_AMOUNT_CONFIG_MODE_PER_TEST); $questionAmountConfigMode->addOption($questionAmountConfigModePerTest); $questionAmountConfigModePerPool = new ilRadioOption($this->lng->txt('tst_inp_quest_amount_cfg_mode_pool'), ilTestRandomQuestionSetConfig::QUESTION_AMOUNT_CONFIG_MODE_PER_POOL); $questionAmountConfigMode->addOption($questionAmountConfigModePerPool); $questionAmountConfigMode->setRequired(true); $this->addItem($questionAmountConfigMode); // question amount per test $questionAmountPerTest = new ilNumberInputGUI($this->lng->txt('tst_inp_quest_amount_per_test'), 'quest_amount_per_test'); $questionAmountPerTest->setRequired(true); $questionAmountPerTest->setMinValue(0); $questionAmountPerTest->allowDecimals(false); $questionAmountPerTest->setMinvalueShouldBeGreater(true); $questionAmountPerTest->setSize(4); $questionAmountPerTest->setValue($this->questionSetConfig->getQuestionAmountPerTest()); $questionAmountConfigModePerTest->addSubItem($questionAmountPerTest); if ($this->testOBJ->participantDataExist()) { $requirePoolsQuestionsHomoScored->setDisabled(true); $questionAmountConfigMode->setDisabled(true); $questionAmountPerTest->setDisabled(true); } }
protected function initEditCustomForm(ilPropertyFormGUI $a_form) { global $lng, $ilSetting; if ($this->id_type == self::REPOSITORY_NODE_ID) { $appr = new ilCheckboxInputGUI($lng->txt("blog_enable_approval"), "approval"); $appr->setInfo($lng->txt("blog_enable_approval_info")); $a_form->addItem($appr); } $notes = new ilCheckboxInputGUI($lng->txt("blog_enable_notes"), "notes"); $a_form->addItem($notes); if ($ilSetting->get('enable_global_profiles')) { $rss = new ilCheckboxInputGUI($lng->txt("blog_enable_rss"), "rss"); $rss->setInfo($lng->txt("blog_enable_rss_info")); $a_form->addItem($rss); } $ppic = new ilCheckboxInputGUI($lng->txt("blog_profile_picture"), "ppic"); $a_form->addItem($ppic); $blga_set = new ilSetting("blga"); if ($blga_set->get("banner")) { $dimensions = " (" . $blga_set->get("banner_width") . "x" . $blga_set->get("banner_height") . ")"; $img = new ilImageFileInputGUI($lng->txt("blog_banner") . $dimensions, "banner"); $a_form->addItem($img); // show existing file $file = $this->object->getImageFullPath(true); if ($file) { $img->setImage($file); } } $bg_color = new ilColorPickerInputGUI($lng->txt("blog_background_color"), "bg_color"); $a_form->addItem($bg_color); $font_color = new ilColorPickerInputGUI($lng->txt("blog_font_color"), "font_color"); $a_form->addItem($font_color); }
public function addCustomSettingsToForm(ilPropertyFormGUI $a_form) { global $lng, $ilSetting; $cb = new ilCheckboxInputGUI($lng->txt("cron_mail_notification_message"), "mail_notification_message"); $cb->setInfo($lng->txt("cron_mail_notification_message_info")); $cb->setChecked($ilSetting->get("mail_notification_message")); $a_form->addItem($cb); }
public function initPluginSettings() { if ($this->getAdminConfigObject()->getDefaultAllowPublicLinksConfigAllowPublicLinks() && $this->getAdminConfigObject()->getDefaultAllowPublicLinks()) { $public_links = new ilCheckboxInputGUI($this->txt("activate_public_links"), "activate_public_links"); $public_links->setInfo($this->txt("info_activate_public_links")); $this->form->addItem($public_links); } if ($this->getAdminConfigObject()->getConfigMaxFileSize()) { $max_file_size = new ilNumberInputGUI($this->txt("max_file_size"), "max_file_size"); $max_file_size->setInfo($this->txt("info_max_file_size")); $max_file_size->setMaxLength(10); $max_file_size->setSize(10); $this->form->addItem($max_file_size); } }
/** * Edit question overview form. */ function edit($a_insert = false) { global $ilCtrl, $tpl, $lng; $this->displayValidationError(); // edit form include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($ilCtrl->getFormAction($this)); if ($a_insert) { $form->setTitle($this->lng->txt("cont_ed_insert_qover")); } else { $form->setTitle($this->lng->txt("cont_edit_qover")); } // short message $cb = new ilCheckboxInputGUI($this->lng->txt("cont_qover_short_message"), "short"); $cb->setInfo($this->lng->txt("cont_qover_short_message_info")); if (!$a_insert) { $cb->setChecked($this->content_obj->getShortMessage()); } else { $cb->setChecked(true); } $form->addItem($cb); // list wrong questions $cb = new ilCheckboxInputGUI($this->lng->txt("cont_qover_list_wrong_q"), "wrong_questions"); $cb->setInfo($this->lng->txt("cont_qover_list_wrong_q_info")); if (!$a_insert) { $cb->setChecked($this->content_obj->getListWrongQuestions()); } $form->addItem($cb); // save/cancel buttons if ($a_insert) { $form->addCommandButton("create_qover", $lng->txt("save")); $form->addCommandButton("cancelCreate", $lng->txt("cancel")); } else { $form->addCommandButton("update", $lng->txt("save")); $form->addCommandButton("cancelUpdate", $lng->txt("cancel")); } $html = $form->getHTML(); $tpl->setContent($html); return $ret; }
/** * Init configuration form. * * @return object form object */ public function initConfigurationForm() { global $lng, $ilCtrl; $pl = $this->getPluginObject(); include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); // Setting for the ephorus logging $ephorus_logging = new ilCheckboxInputGUI($pl->txt("ephorus_logging"), "ephorus_logging"); $ephorus_logging->setValue(1); $ephorus_logging->setInfo($pl->txt("ephorus_logging_description")); $form->addItem($ephorus_logging); // Setting for the hand-in code $handin_code = new ilTextInputGUI($pl->txt("handin_code"), "handin_code"); $handin_code->setRequired(true); $form->addItem($handin_code); // Setting for the hand-in address $handin_address = new ilTextInputGUI($pl->txt("handin_address"), "handin_address"); $handin_address->setSize(80); $handin_address->setRequired(true); $form->addItem($handin_address); // Setting for the index address $index_address = new ilTextInputGUI($pl->txt("index_address"), "index_address"); $index_address->setSize(80); $index_address->setRequired(true); $form->addItem($index_address); // Setting for the processtype $processtype = new ilSelectInputGUI($pl->txt("default_processtype"), "processtype"); $processtype->setOptions(array(1 => $pl->txt("default"), 3 => $pl->txt("private"))); $processtype->setInfo($pl->txt("default_processtype_description")); $form->addItem($processtype); // Setting for the disclosure $disclosure = new ilTextAreaInputGUI($pl->txt("disclosure"), "disclosure"); $disclosure->setCols(79); $disclosure->setRows(4); $form->addItem($disclosure); $form->addCommandButton("save", $lng->txt("save") . " / " . $pl->txt("check_connection")); $form->setTitle($pl->txt("ephorus_plugin_configuration")); $form->setFormAction($ilCtrl->getFormAction($this)); return $form; }
public function showTopicsSettings() { $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment'); $genSet = ilPaymentSettings::_getInstance(); $genSetData = $genSet->getAll(); $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this, 'saveTopicsSettings')); $form->setTitle($this->lng->txt('pays_general_settings')); $form->addCommandButton('saveTopicsSettings', $this->lng->txt('save')); // use topics $formItem = new ilCheckboxInputGUI($this->lng->txt('enable_topics'), 'enable_topics'); $formItem->setChecked((int) $genSetData['enable_topics']); $formItem->setInfo($this->lng->txt('enable_topics_info')); $form->addItem($formItem); // default sorting type $formItem = new ilSelectInputGUI($this->lng->txt('pay_topics_default_sorting_type'), 'topics_sorting_type'); $formItem->setValue($genSetData['topics_sorting_type']); $options = array(1 => $this->lng->txt('pay_topics_sort_by_title'), 2 => $this->lng->txt('pay_topics_sort_by_date'), 3 => $this->lng->txt('pay_topics_sort_manually')); $formItem->setOptions($options); $form->addItem($formItem); // default sorting direction $formItem = new ilSelectInputGUI($this->lng->txt('pay_topics_default_sorting_direction'), 'topics_sorting_direction'); $formItem->setValue($genSetData['topics_sorting_direction']); $options = array('asc' => $this->lng->txt('sort_asc'), 'desc' => $this->lng->txt('sort_desc')); $formItem->setOptions($options); $form->addItem($formItem); // topics custom sorting $formItem = new ilCheckboxInputGUI($this->lng->txt('pay_topics_allow_custom_sorting'), 'topics_allow_custom_sorting'); $formItem->setChecked((int) $genSetData['topics_allow_custom_sorting']); $formItem->setInfo($this->lng->txt('pay_topics_allow_custom_sorting_info')); $form->addItem($formItem); // show topics filter $formItem = new ilCheckboxInputGUI($this->lng->txt('show_topics_filter'), 'show_topics_filter'); $formItem->setChecked((int) $genSetData['show_topics_filter']); $formItem->setInfo($this->lng->txt('show_topics_filter_info')); $form->addItem($formItem); $this->tpl->setVariable('FORM', $form->getHTML()); return true; }
public function addCustomSettingsToForm(ilPropertyFormGUI $a_form) { global $lng; $lng->loadLanguageModule("file"); require_once 'Services/WebDAV/classes/class.ilObjDiskQuotaSettings.php'; $disk_quota_obj = ilObjDiskQuotaSettings::getInstance(); // Enable disk quota reminder mail $cb_prop_reminder = new ilCheckboxInputGUI($lng->txt("enable_disk_quota_reminder_mail"), "enable_disk_quota_reminder_mail"); $cb_prop_reminder->setValue('1'); $cb_prop_reminder->setChecked($disk_quota_obj->isDiskQuotaReminderMailEnabled()); $cb_prop_reminder->setInfo($lng->txt('disk_quota_reminder_mail_desc')); $a_form->addItem($cb_prop_reminder); // Enable summary mail for certain users $cb_prop_summary = new ilCheckboxInputGUI($lng->txt("enable_disk_quota_summary_mail"), "enable_disk_quota_summary_mail"); $cb_prop_summary->setValue(1); $cb_prop_summary->setChecked($disk_quota_obj->isDiskQuotaSummaryMailEnabled()); $cb_prop_summary->setInfo($lng->txt('enable_disk_quota_summary_mail_desc')); $a_form->addItem($cb_prop_summary); // Edit disk quota recipients $summary_rcpt = new ilTextInputGUI($lng->txt("disk_quota_summary_rctp"), "disk_quota_summary_rctp"); $summary_rcpt->setValue($disk_quota_obj->getSummaryRecipients()); $summary_rcpt->setInfo($lng->txt('disk_quota_summary_rctp_desc')); $cb_prop_summary->addSubItem($summary_rcpt); }
/** * Init form * * @return ilPropertyFormGUI */ public function initForm() { global $lng, $ilCtrl; /** @var $ilCtrl ilCtrl */ $ilCtrl = $ilCtrl; include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $item = new ilCustomInputGUI(); $item->setHtml($lng->txt('dcl_file_format_description')); $item->setTitle("Info"); $form->addItem($item); $file = new ilFileInputGUI($lng->txt("import_file"), "import_file"); $file->setRequired(true); $form->addItem($file); $cb = new ilCheckboxInputGUI($lng->txt("dcl_simulate_import"), "simulate"); $cb->setInfo($lng->txt("dcl_simulate_info")); $form->addItem($cb); $form->addCommandButton("importExcel", $lng->txt("save")); return $form; }
/** * Init import form. */ public function initImportForm() { global $lng, $ilCtrl; include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $new_type = $_POST["new_type"] ? $_POST["new_type"] : $_GET["new_type"]; $this->ctrl->setParameter($this, "new_type", $new_type); $form->setTarget(ilFrameTargetInfo::_getFrame("MainContent")); $form->setTableWidth("600px"); // import file $fi = new ilFileInputGUI($this->lng->txt("file"), "xmldoc"); $fi->setSuffixes(array("zip")); $fi->setRequired(true); $fi->setSize(30); $form->addItem($fi); // validation $cb = new ilCheckboxInputGUI($this->lng->txt("cont_validate_file"), "validate"); $cb->setInfo($this->lng->txt("")); $form->addItem($cb); $form->addCommandButton("importFile", $lng->txt("import")); $form->addCommandButton("cancel", $lng->txt("cancel")); $form->setTitle($this->lng->txt("import_" . $new_type)); $form->setFormAction($ilCtrl->getFormAction($this)); return $form; }
/** * Init settings property form * * @access protected */ protected function initFormSettings() { if (is_object($this->form)) { return true; } include_once 'Services/Calendar/classes/class.ilCalendarUtil.php'; include_once 'Services/Form/classes/class.ilPropertyFormGUI.php'; $this->form = new ilPropertyFormGUI(); $this->form->setFormAction($this->ctrl->getFormAction($this)); $this->form->setTitle($this->lng->txt('cal_global_settings')); $this->form->addCommandButton('save', $this->lng->txt('save')); #$this->form->addCommandButton('cancel',$this->lng->txt('cancel')); $check = new ilCheckboxInputGUI($this->lng->txt('enable_calendar'), 'enable'); $check->setValue(1); $check->setChecked($this->settings->isEnabled() ? true : false); $this->form->addItem($check); $server_tz = new ilNonEditableValueGUI($this->lng->txt('cal_server_tz')); $server_tz->setValue(ilTimeZone::_getDefaultTimeZone()); $this->form->addItem($server_tz); $select = new ilSelectInputGUI($this->lng->txt('cal_def_timezone'), 'default_timezone'); $select->setOptions(ilCalendarUtil::_getShortTimeZoneList()); $select->setInfo($this->lng->txt('cal_def_timezone_info')); $select->setValue($this->settings->getDefaultTimeZone()); $this->form->addItem($select); $year = date("Y"); $select = new ilSelectInputGUI($this->lng->txt('cal_def_date_format'), 'default_date_format'); $select->setOptions(array(ilCalendarSettings::DATE_FORMAT_DMY => '31.10.' . $year, ilCalendarSettings::DATE_FORMAT_YMD => $year . "-10-31", ilCalendarSettings::DATE_FORMAT_MDY => "10/31/" . $year)); $select->setInfo($this->lng->txt('cal_def_date_format_info')); $select->setValue($this->settings->getDefaultDateFormat()); $this->form->addItem($select); $select = new ilSelectInputGUI($this->lng->txt('cal_def_time_format'), 'default_time_format'); $select->setOptions(array(ilCalendarSettings::TIME_FORMAT_24 => '13:00', ilCalendarSettings::TIME_FORMAT_12 => '1:00pm')); $select->setInfo($this->lng->txt('cal_def_time_format_info')); $select->setValue($this->settings->getDefaultTimeFormat()); $this->form->addItem($select); // Weekstart $radio = new ilRadioGroupInputGUI($this->lng->txt('cal_def_week_start'), 'default_week_start'); $radio->setValue($this->settings->getDefaultWeekStart()); $option = new ilRadioOption($this->lng->txt('l_su'), 0); $radio->addOption($option); $option = new ilRadioOption($this->lng->txt('l_mo'), 1); $radio->addOption($option); $this->form->addItem($radio); // Day start $day_start = new ilSelectInputGUI($this->lng->txt('cal_day_start'), 'dst'); $day_start->setOptions(ilCalendarUtil::getHourSelection($this->settings->getDefaultTimeFormat())); $day_start->setValue($this->settings->getDefaultDayStart()); $this->form->addItem($day_start); $day_end = new ilSelectInputGUI($this->lng->txt('cal_day_end'), 'den'); $day_end->setOptions(ilCalendarUtil::getHourSelection($this->settings->getDefaultTimeFormat())); $day_end->setValue($this->settings->getDefaultDayEnd()); $this->form->addItem($day_end); $sync = new ilCheckboxInputGUI($this->lng->txt('cal_webcal_sync'), 'webcal'); $sync->setValue(1); $sync->setChecked($this->settings->isWebCalSyncEnabled()); $sync->setInfo($this->lng->txt('cal_webcal_sync_info')); $sync_min = new ilNumberInputGUI('', 'webcal_hours'); $sync_min->setSize(2); $sync_min->setMaxLength(3); $sync_min->setValue($this->settings->getWebCalSyncHours()); $sync_min->setSuffix($this->lng->txt('hours')); $sync->addSubItem($sync_min); $this->form->addItem($sync); // enable milestone planning in groups $mil = new ilFormSectionHeaderGUI(); $mil->setTitle($this->lng->txt('cal_milestone_settings')); $this->form->addItem($mil); $checkm = new ilCheckboxInputGUI($this->lng->txt('cal_enable_group_milestones'), 'enable_grp_milestones'); $checkm->setValue(1); $checkm->setChecked($this->settings->getEnableGroupMilestones() ? true : false); $checkm->setInfo($this->lng->txt('cal_enable_group_milestones_desc')); $this->form->addItem($checkm); // Consultation hours $con = new ilFormSectionHeaderGUI(); $con->setTitle($this->lng->txt('cal_ch_form_header')); $this->form->addItem($con); $ch = new ilCheckboxInputGUI($this->lng->txt('cal_ch_form'), 'ch'); $ch->setInfo($this->lng->txt('cal_ch_form_info')); $ch->setValue(1); $ch->setChecked($this->settings->areConsultationHoursEnabled()); $this->form->addItem($ch); // repository visibility default $rep = new ilFormSectionHeaderGUI(); $rep->setTitle($GLOBALS['lng']->txt('cal_setting_global_vis_repos')); $this->form->addItem($rep); $crs = new ilCheckboxInputGUI($GLOBALS['lng']->txt('cal_setting_global_crs_vis'), 'visible_crs'); $crs->setInfo($GLOBALS['lng']->txt('cal_setting_global_crs_vis_info')); $crs->setValue(1); $crs->setInfo($GLOBALS['lng']->txt('cal_setting_global_crs_vis_info')); $crs->setChecked($this->settings->isCourseCalendarEnabled()); $this->form->addItem($crs); $grp = new ilCheckboxInputGUI($GLOBALS['lng']->txt('cal_setting_global_grp_vis'), 'visible_grp'); $grp->setInfo($GLOBALS['lng']->txt('cal_setting_global_grp_vis_info')); $grp->setValue(1); $grp->setInfo($GLOBALS['lng']->txt('cal_setting_global_grp_vis_info')); $grp->setChecked($this->settings->isGroupCalendarEnabled()); $this->form->addItem($grp); // Notifications $not = new ilFormSectionHeaderGUI(); $not->setTitle($this->lng->txt('notifications')); $this->form->addItem($not); $cgn = new ilCheckboxInputGUI($this->lng->txt('cal_notification'), 'cn'); $cgn->setOptionTitle($this->lng->txt('cal_notification_crsgrp')); $cgn->setValue(1); $cgn->setChecked($this->settings->isNotificationEnabled()); $cgn->setInfo($this->lng->txt('cal_adm_notification_info')); $this->form->addItem($cgn); $cnu = new ilCheckboxInputGUI('', 'cnu'); $cnu->setOptionTitle($this->lng->txt('cal_notification_users')); $cnu->setValue(1); $cnu->setChecked($this->settings->isUserNotificationEnabled()); $cnu->setInfo($this->lng->txt('cal_adm_notification_user_info')); $this->form->addItem($cnu); // Registration $book = new ilFormSectionHeaderGUI(); $book->setTitle($this->lng->txt('cal_registrations')); $this->form->addItem($book); $cgn = new ilCheckboxInputGUI($this->lng->txt('cal_cg_registrations'), 'cgr'); $cgn->setValue(1); $cgn->setChecked($this->settings->isCGRegistrationEnabled()); $cgn->setInfo($this->lng->txt('cal_cg_registration_info')); $this->form->addItem($cgn); // Synchronisation cache $sec = new ilFormSectionHeaderGUI(); $sec->setTitle($this->lng->txt('cal_cache_settings')); $this->form->addItem($sec); $cache = new ilRadioGroupInputGUI($this->lng->txt('cal_sync_cache'), 'sync_cache'); $cache->setValue((int) $this->settings->isSynchronisationCacheEnabled()); $cache->setInfo($this->lng->txt('cal_sync_cache_info')); $cache->setRequired(true); $sync_cache = new ilRadioOption($this->lng->txt('cal_sync_disabled'), 0); $cache->addOption($sync_cache); $sync_cache = new ilRadioOption($this->lng->txt('cal_sync_enabled'), 1); $cache->addOption($sync_cache); $cache_t = new ilNumberInputGUI('', 'sync_cache_time'); $cache_t->setValue($this->settings->getSynchronisationCacheMinutes()); $cache_t->setMinValue(0); $cache_t->setSize(3); $cache_t->setMaxLength(3); $cache_t->setSuffix($this->lng->txt('form_minutes')); $sync_cache->addSubItem($cache_t); $this->form->addItem($cache); // Calendar cache $cache = new ilRadioGroupInputGUI($this->lng->txt('cal_cache'), 'cache'); $cache->setValue((int) $this->settings->isCacheUsed()); $cache->setInfo($this->lng->txt('cal_cache_info')); $cache->setRequired(true); $sync_cache = new ilRadioOption($this->lng->txt('cal_cache_disabled'), 0); $cache->addOption($sync_cache); $sync_cache = new ilRadioOption($this->lng->txt('cal_cache_enabled'), 1); $cache->addOption($sync_cache); $cache_t = new ilNumberInputGUI('', 'cache_time'); $cache_t->setValue($this->settings->getCacheMinutes()); $cache_t->setMinValue(0); $cache_t->setSize(3); $cache_t->setMaxLength(3); $cache_t->setSuffix($this->lng->txt('form_minutes')); $sync_cache->addSubItem($cache_t); $this->form->addItem($cache); }
protected function initCustomIconsForm() { global $ilSetting; include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; include_once "Services/Form/classes/class.ilCombinationInputGUI.php"; $form = new ilPropertyFormGUI(); $form->setTitle($this->lng->txt("rep_custom_icons")); $form->setFormAction($this->ctrl->getFormAction($this, 'saveCustomIcons')); $cb = new ilCheckboxInputGUI($this->lng->txt("enable_custom_icons"), "custom_icons"); $cb->setInfo($this->lng->txt("enable_custom_icons_info")); $cb->setChecked($ilSetting->get("custom_icons")); $form->addItem($cb); /* $size_big = new ilCombinationInputGUI($this->lng->txt("custom_icon_size_big")); $form->addItem($size_big); $width = new ilNumberInputGUI("", "custom_icon_big_width"); $width->setSize(3); $width->setValue($ilSetting->get("custom_icon_big_width")); $size_big->addCombinationItem("bgw", $width, $this->lng->txt("width")); $height = new ilNumberInputGUI("", "custom_icon_big_height"); $height->setSize(3); $height->setValue($ilSetting->get("custom_icon_big_height")); $size_big->addCombinationItem("bgh", $height, $this->lng->txt("height")); $size_small = new ilCombinationInputGUI($this->lng->txt("custom_icon_size_standard")); $form->addItem($size_small); $width = new ilNumberInputGUI("", "custom_icon_small_width"); $width->setSize(3); $width->setValue($ilSetting->get("custom_icon_small_width")); $size_small->addCombinationItem("smw", $width, $this->lng->txt("width")); $height = new ilNumberInputGUI("", "custom_icon_small_height"); $height->setSize(3); $height->setValue($ilSetting->get("custom_icon_small_height")); $size_small->addCombinationItem("smh", $height, $this->lng->txt("height")); $size_tiny = new ilCombinationInputGUI($this->lng->txt("custom_icon_size_tiny")); $form->addItem($size_tiny); $width = new ilNumberInputGUI("", "custom_icon_tiny_width"); $width->setSize(3); $width->setValue($ilSetting->get("custom_icon_tiny_width")); $size_tiny->addCombinationItem("tnw", $width, $this->lng->txt("width")); $height = new ilNumberInputGUI("", "custom_icon_tiny_height"); $height->setSize(3); $height->setValue($ilSetting->get("custom_icon_tiny_height")); $size_tiny->addCombinationItem("tnh", $height, $this->lng->txt("height")); */ $form->addCommandButton('saveCustomIcons', $this->lng->txt('save')); return $form; }
/** * @param $question_id * @param $question_pool_id * * @return ilPropertyFormGUI */ protected function buildAdjustQuestionForm($question_id, $question_pool_id) { require_once './Services/Form/classes/class.ilPropertyFormGUI.php'; require_once './Modules/TestQuestionPool/classes/class.assQuestion.php'; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this)); $form->setMultipart(FALSE); $form->setTableWidth("100%"); $form->setId("adjustment"); /** @var $question assQuestionGUI|ilGuiQuestionScoringAdjustable|ilGuiAnswerScoringAdjustable */ $question = assQuestion::instantiateQuestionGUI($question_id); $form->setTitle($question->object->getTitle() . '<br /><small>(' . $question->outQuestionType() . ')</small>'); $hidden_question_id = new ilHiddenInputGUI('q_id'); $hidden_question_id->setValue($question_id); $form->addItem($hidden_question_id); $hidden_qpl_id = new ilHiddenInputGUI('qpl_id'); $hidden_qpl_id->setValue($question_pool_id); $form->addItem($hidden_qpl_id); $this->populateScoringAdjustments($question, $form); $manscoring_section = new ilFormSectionHeaderGUI(); $manscoring_section->setTitle($this->lng->txt('manscoring')); $form->addItem($manscoring_section); $manscoring_preservation = new ilCheckboxInputGUI($this->lng->txt('preserve_manscoring'), 'preserve_manscoring'); $manscoring_preservation->setChecked(true); $manscoring_preservation->setInfo($this->lng->txt('preserve_manscoring_info')); $form->addItem($manscoring_preservation); $form->addCommandButton("savescoringfortest", $this->lng->txt("save")); $participants = $this->object->getParticipants(); $active_ids = array_keys($participants); $results = array(); foreach ($active_ids as $active_id) { $passes[] = $this->object->_getPass($active_id); foreach ($passes as $key => $pass) { for ($i = 0; $i <= $pass; $i++) { $results[] = $question->object->getSolutionValues($active_id, $i); } } } $relevant_answers = array(); foreach ($results as $result) { foreach ($result as $answer) { if ($answer['question_fi'] == $question->object->getId()) { $relevant_answers[] = $answer; } } } $answers_view = $question->getAggregatedAnswersView($relevant_answers); include_once 'Services/jQuery/classes/class.iljQueryUtil.php'; iljQueryUtil::initjQuery(); include_once 'Services/YUI/classes/class.ilYuiUtil.php'; ilYuiUtil::initPanel(); ilYuiUtil::initOverlay(); $this->tpl->addJavascript('./Services/UIComponent/Overlay/js/ilOverlay.js'); $this->tpl->addJavaScript("./Services/JavaScript/js/Basic.js"); $container = new ilTemplate('tpl.il_as_tst_adjust_answer_aggregation_container.html', true, true, 'Modules/Test'); $container->setVariable('FORM_ELEMENT_NAME', 'aggr_usr_answ'); $container->setVariable('CLOSE_HTML', json_encode(ilGlyphGUI::get(ilGlyphGUI::CLOSE, $this->lng->txt('close')))); $container->setVariable('TXT_SHOW_ANSWER_OVERVIEW', $this->lng->txt('show_answer_overview')); $container->setVariable('TXT_CLOSE', $this->lng->txt('close')); $container->setVariable('ANSWER_OVERVIEW', $answers_view); $custom_input = new ilCustomInputGUI('', 'aggr_usr_answ'); $custom_input->setHtml($container->get()); $form->addItem($custom_input); return $form; }
public function getApacheAuthSettingsForm() { include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this)); $form->setTitle($this->lng->txt('apache_settings')); $chb_enabled = new ilCheckboxInputGUI($this->lng->txt('apache_enable_auth'), 'apache_enable_auth'); $form->addItem($chb_enabled); $chb_local_create_account = new ilCheckboxInputGUI($this->lng->txt('apache_autocreate'), 'apache_local_autocreate'); $chb_enabled->addSubitem($chb_local_create_account); global $rbacreview; $roles = $rbacreview->getGlobalRolesArray(); $select = new ilSelectInputGUI($this->lng->txt('apache_default_role'), 'apache_default_role'); $roleOptions = array(); foreach ($roles as $role) { $roleOptions[$role['obj_id']] = ilObject::_lookupTitle($role['obj_id']); } $select->setOptions($roleOptions); $select->setValue(4); $chb_local_create_account->addSubitem($select); $chb_local = new ilCheckboxInputGUI($this->lng->txt('apache_enable_local'), 'apache_enable_local'); $form->addItem($chb_local); $chb_ldap = new ilCheckboxInputGUI($this->lng->txt('apache_enable_ldap'), 'apache_enable_ldap'); $chb_ldap->setInfo($this->lng->txt('apache_ldap_hint_ldap_must_be_configured')); $form->addItem($chb_ldap); $txt = new ilTextInputGUI($this->lng->txt('apache_auth_indicator_name'), 'apache_auth_indicator_name'); $txt->setRequired(true); $form->addItem($txt); $txt = new ilTextInputGUI($this->lng->txt('apache_auth_indicator_value'), 'apache_auth_indicator_value'); $txt->setRequired(true); $form->addItem($txt); $chb = new ilCheckboxInputGUI($this->lng->txt('apache_auth_enable_override_login'), 'apache_auth_enable_override_login_page'); $form->addItem($chb); $txt = new ilTextInputGUI($this->lng->txt('apache_auth_target_override_login'), 'apache_auth_target_override_login_page'); $txt->setRequired(true); $chb->addSubItem($txt); $chb = new ilCheckboxInputGUI($this->lng->txt('apache_auth_authenticate_on_login_page'), 'apache_auth_authenticate_on_login_page'); $form->addItem($chb); $sec = new ilFormSectionHeaderGUI(); $sec->setTitle($this->lng->txt('apache_auth_username_config')); $form->addItem($sec); $rag = new ilRadioGroupInputGUI($this->lng->txt('apache_auth_username_config_type'), 'apache_auth_username_config_type'); $form->addItem($rag); $rao = new ilRadioOption($this->lng->txt('apache_auth_username_direct_mapping'), 1); $rag->addOption($rao); $txt = new ilTextInputGUI($this->lng->txt('apache_auth_username_direct_mapping_fieldname'), 'apache_auth_username_direct_mapping_fieldname'); //$txt->setRequired(true); $rao->addSubItem($txt); $rao = new ilRadioOption($this->lng->txt('apache_auth_username_extended_mapping'), 2); $rao->setDisabled(true); $rag->addOption($rao); $rao = new ilRadioOption($this->lng->txt('apache_auth_username_by_function'), 3); $rag->addOption($rao); /* $txt = new ilTextInputGUI($this->lng->txt('apache_auth_username_by_function_functionname'), 'apache_auth_username_by_function_functionname'); $rao->addSubItem($txt);*/ $sec = new ilFormSectionHeaderGUI(); $sec->setTitle($this->lng->txt('apache_auth_security')); $form->addItem($sec); $txt = new ilTextAreaInputGUI($this->lng->txt('apache_auth_domains'), 'apache_auth_domains'); $txt->setInfo($this->lng->txt('apache_auth_domains_description')); $form->addItem($txt); $form->addCommandButton('saveApacheSettings', $this->lng->txt('save')); $form->addCommandButton('cancel', $this->lng->txt('cancel')); return $form; }
/** * Init settings property form * * @access protected */ protected function initFormSettings() { global $lng; include_once 'Services/Form/classes/class.ilPropertyFormGUI.php'; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this)); $form->setTitle($this->lng->txt('blog_settings')); $form->addCommandButton('saveSettings', $this->lng->txt('save')); $form->addCommandButton('cancel', $this->lng->txt('cancel')); $banner = new ilCheckboxInputGUI($lng->txt("blog_preview_banner"), "banner"); $banner->setInfo($lng->txt("blog_preview_banner_info")); $form->addItem($banner); $width = new ilNumberInputGUI($lng->txt("blog_preview_banner_width"), "width"); $width->setRequired(true); $width->setSize(4); $banner->addSubItem($width); $height = new ilNumberInputGUI($lng->txt("blog_preview_banner_height"), "height"); $height->setRequired(true); $height->setSize(4); $banner->addSubItem($height); $blga_set = new ilSetting("blga"); $banner->setChecked($blga_set->get("banner", false)); if ($blga_set->get("banner")) { $width->setValue($blga_set->get("banner_width")); $height->setValue($blga_set->get("banner_height")); } else { $width->setValue(1370); $height->setValue(100); } $mask = new ilCheckboxInputGUI($lng->txt("blog_allow_html"), "mask"); $mask->setInfo($lng->txt("blog_allow_html_info")); $mask->setChecked($blga_set->get("mask", false)); $form->addItem($mask); return $form; }
/** * */ protected function initFormDSettings() { include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingSettings.php'; include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this)); $form->setTitle($this->lng->txt('general_settings')); $active = new ilCheckboxInputGUI($this->lng->txt('ecs_node_mapping_activate'), 'active'); $active->setChecked(ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->isDirectoryMappingEnabled()); $form->addItem($active); $create_empty = new ilCheckboxInputGUI($this->lng->txt('ecs_node_mapping_create_empty'), 'empty'); $create_empty->setChecked(!ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->isEmptyContainerCreationEnabled()); $create_empty->setInfo($this->lng->txt('ecs_node_mapping_create_empty_info')); $form->addItem($create_empty); $form->addCommandButton('dUpdateSettings', $this->lng->txt('save')); $form->addCommandButton('cancel', $this->lng->txt('cancel')); return $form; }
/** * Init survey settings form * * @return ilPropertyFormGUI */ function initPropertiesForm() { $template_settings = $hide_rte_switch = null; $template = $this->object->getTemplate(); if ($template) { include_once "Services/Administration/classes/class.ilSettingsTemplate.php"; $template = new ilSettingsTemplate($template); $template_settings = $template->getSettings(); $hide_rte_switch = $template_settings["rte_switch"]["hide"]; } include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this)); $form->setTableWidth("100%"); $form->setId("survey_properties"); // general properties $header = new ilFormSectionHeaderGUI(); $header->setTitle($this->lng->txt("settings")); $form->addItem($header); // title & description (meta data) include_once 'Services/MetaData/classes/class.ilMD.php'; $md_obj = new ilMD($this->object->getId(), 0, "svy"); $md_section = $md_obj->getGeneral(); $title = new ilTextInputGUI($this->lng->txt("title"), "title"); $title->setRequired(true); $title->setValue($md_section->getTitle()); $form->addItem($title); $ids = $md_section->getDescriptionIds(); if ($ids) { $desc_obj = $md_section->getDescription(array_pop($ids)); $desc = new ilTextAreaInputGUI($this->lng->txt("description"), "description"); $desc->setCols(50); $desc->setRows(4); $desc->setValue($desc_obj->getDescription()); $form->addItem($desc); } // pool usage $pool_usage = new ilRadioGroupInputGUI($this->lng->txt("survey_question_pool_usage"), "use_pool"); $opt = new ilRadioOption($this->lng->txt("survey_question_pool_usage_active"), 1); $opt->setInfo($this->lng->txt("survey_question_pool_usage_active_info")); $pool_usage->addOption($opt); $opt = new ilRadioOption($this->lng->txt("survey_question_pool_usage_inactive"), 0); $opt->setInfo($this->lng->txt("survey_question_pool_usage_inactive_info")); $pool_usage->addOption($opt); $pool_usage->setValue($this->object->getPoolUsage()); $form->addItem($pool_usage); // 360°: appraisees if ($this->object->get360Mode()) { $self_eval = new ilCheckboxInputGUI($this->lng->txt("survey_360_self_evaluation"), "self_eval"); $self_eval->setInfo($this->lng->txt("survey_360_self_evaluation_info")); $self_eval->setChecked($this->object->get360SelfEvaluation()); $form->addItem($self_eval); $self_rate = new ilCheckboxInputGUI($this->lng->txt("survey_360_self_raters"), "self_rate"); $self_rate->setInfo($this->lng->txt("survey_360_self_raters_info")); $self_rate->setChecked($this->object->get360SelfRaters()); $form->addItem($self_rate); $self_appr = new ilCheckboxInputGUI($this->lng->txt("survey_360_self_appraisee"), "self_appr"); $self_appr->setInfo($this->lng->txt("survey_360_self_appraisee_info")); $self_appr->setChecked($this->object->get360SelfAppraisee()); $form->addItem($self_appr); } // activation include_once "Services/Object/classes/class.ilObjectActivation.php"; $this->lng->loadLanguageModule('rep'); $section = new ilFormSectionHeaderGUI(); $section->setTitle($this->lng->txt('rep_activation_availability')); $form->addItem($section); // additional info only with multiple references $act_obj_info = $act_ref_info = ""; if (sizeof(ilObject::_getAllReferences($this->object->getId())) > 1) { $act_obj_info = ' ' . $this->lng->txt('rep_activation_online_object_info'); $act_ref_info = $this->lng->txt('rep_activation_access_ref_info'); } $online = new ilCheckboxInputGUI($this->lng->txt('rep_activation_online'), 'online'); $online->setInfo($this->lng->txt('svy_activation_online_info') . $act_obj_info); $online->setChecked($this->object->isOnline()); $form->addItem($online); $act_type = new ilCheckboxInputGUI($this->lng->txt('rep_visibility_until'), 'access_type'); // $act_type->setInfo($this->lng->txt('svy_availability_until_info')); $act_type->setChecked($this->object->isActivationLimited()); $this->tpl->addJavaScript('./Services/Form/js/date_duration.js'); include_once "Services/Form/classes/class.ilDateDurationInputGUI.php"; $dur = new ilDateDurationInputGUI($this->lng->txt('rep_time_period'), "access_period"); $dur->setShowTime(true); $date = $this->object->getActivationStartDate(); $dur->setStart(new ilDateTime($date ? $date : time(), IL_CAL_UNIX)); $dur->setStartText($this->lng->txt('rep_activation_limited_start')); $date = $this->object->getActivationEndDate(); $dur->setEnd(new ilDateTime($date ? $date : time(), IL_CAL_UNIX)); $dur->setEndText($this->lng->txt('rep_activation_limited_end')); $act_type->addSubItem($dur); $visible = new ilCheckboxInputGUI($this->lng->txt('rep_activation_limited_visibility'), 'access_visiblity'); $visible->setInfo($this->lng->txt('svy_activation_limited_visibility_info')); $visible->setChecked($this->object->getActivationVisibility()); $act_type->addSubItem($visible); $form->addItem($act_type); // before start $section = new ilFormSectionHeaderGUI(); $section->setTitle($this->lng->txt('svy_settings_section_before_start')); $form->addItem($section); // introduction $intro = new ilTextAreaInputGUI($this->lng->txt("introduction"), "introduction"); $intro->setValue($this->object->prepareTextareaOutput($this->object->getIntroduction())); $intro->setRows(10); $intro->setCols(80); $intro->setUseRte(TRUE); $intro->setInfo($this->lng->txt("survey_introduction_info")); include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php"; $intro->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("survey")); $intro->addPlugin("latex"); $intro->addButton("latex"); $intro->addButton("pastelatex"); $intro->setRTESupport($this->object->getId(), "svy", "survey", null, $hide_rte_switch); $form->addItem($intro); // access $section = new ilFormSectionHeaderGUI(); $section->setTitle($this->lng->txt('svy_settings_section_access')); $form->addItem($section); // enable start date $start = $this->object->getStartDate(); $enablestartingtime = new ilCheckboxInputGUI($this->lng->txt("start_date"), "enabled_start_date"); $enablestartingtime->setValue(1); // $enablestartingtime->setOptionTitle($this->lng->txt("enabled")); $enablestartingtime->setChecked($start); // start date $startingtime = new ilDateTimeInputGUI('', 'start_date'); $startingtime->setShowTime(true); if ($start) { $startingtime->setDate(new ilDate($start, IL_CAL_TIMESTAMP)); } $enablestartingtime->addSubItem($startingtime); $form->addItem($enablestartingtime); // enable end date $end = $this->object->getEndDate(); $enableendingtime = new ilCheckboxInputGUI($this->lng->txt("end_date"), "enabled_end_date"); $enableendingtime->setValue(1); // $enableendingtime->setOptionTitle($this->lng->txt("enabled")); $enableendingtime->setChecked($end); // end date $endingtime = new ilDateTimeInputGUI('', 'end_date'); $endingtime->setShowTime(true); if ($end) { $endingtime->setDate(new ilDate($end, IL_CAL_TIMESTAMP)); } $enableendingtime->addSubItem($endingtime); $form->addItem($enableendingtime); // anonymization if (!$this->object->get360Mode()) { $codes = new ilCheckboxInputGUI($this->lng->txt("survey_access_codes"), "acc_codes"); $codes->setInfo($this->lng->txt("survey_access_codes_info")); $codes->setChecked(!$this->object->isAccessibleWithoutCode()); $form->addItem($codes); if ($this->object->_hasDatasets($this->object->getSurveyId())) { $codes->setDisabled(true); } } // question behaviour $section = new ilFormSectionHeaderGUI(); $section->setTitle($this->lng->txt('svy_settings_section_question_behaviour')); $form->addItem($section); // show question titles $show_question_titles = new ilCheckboxInputGUI($this->lng->txt("svy_show_questiontitles"), "show_question_titles"); $show_question_titles->setValue(1); $show_question_titles->setChecked($this->object->getShowQuestionTitles()); $form->addItem($show_question_titles); // finishing $info = new ilFormSectionHeaderGUI(); $info->setTitle($this->lng->txt("svy_settings_section_finishing")); $form->addItem($info); $view_own = new ilCheckboxInputGUI($this->lng->txt("svy_results_view_own"), "view_own"); $view_own->setInfo($this->lng->txt("svy_results_view_own_info")); $view_own->setChecked($this->object->hasViewOwnResults()); $form->addItem($view_own); $mail_own = new ilCheckboxInputGUI($this->lng->txt("svy_results_mail_own"), "mail_own"); $mail_own->setInfo($this->lng->txt("svy_results_mail_own_info")); $mail_own->setChecked($this->object->hasMailOwnResults()); $form->addItem($mail_own); // final statement $finalstatement = new ilTextAreaInputGUI($this->lng->txt("outro"), "outro"); $finalstatement->setValue($this->object->prepareTextareaOutput($this->object->getOutro())); $finalstatement->setRows(10); $finalstatement->setCols(80); $finalstatement->setUseRte(TRUE); $finalstatement->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("survey")); $finalstatement->addPlugin("latex"); $finalstatement->addButton("latex"); $finalstatement->addButton("pastelatex"); $finalstatement->setRTESupport($this->object->getId(), "svy", "survey", null, $hide_rte_switch); $form->addItem($finalstatement); // mail notification $mailnotification = new ilCheckboxInputGUI($this->lng->txt("mailnotification"), "mailnotification"); // $mailnotification->setOptionTitle($this->lng->txt("activate")); $mailnotification->setInfo($this->lng->txt("svy_result_mail_notification_info")); // #11762 $mailnotification->setValue(1); $mailnotification->setChecked($this->object->getMailNotification()); // addresses $mailaddresses = new ilTextInputGUI($this->lng->txt("mailaddresses"), "mailaddresses"); $mailaddresses->setValue($this->object->getMailAddresses()); $mailaddresses->setSize(80); $mailaddresses->setInfo($this->lng->txt('mailaddresses_info')); $mailaddresses->setRequired(true); // participant data $participantdata = new ilTextAreaInputGUI($this->lng->txt("mailparticipantdata"), "mailparticipantdata"); $participantdata->setValue($this->object->getMailParticipantData()); $participantdata->setRows(6); $participantdata->setCols(80); $participantdata->setUseRte(false); $participantdata->setInfo($this->lng->txt("mailparticipantdata_info")); // #12755 - because of privacy concerns we restrict user data to a minimum $placeholders = array("FIRST_NAME" => "firstname", "LAST_NAME" => "lastname", "LOGIN" => "login"); $txt = array(); foreach ($placeholders as $placeholder => $caption) { $txt[] = "[" . strtoupper($placeholder) . "]: " . $this->lng->txt($caption); } $txt = implode("<br />", $txt); $participantdatainfo = new ilNonEditableValueGUI($this->lng->txt("mailparticipantdata_placeholder"), "", true); $participantdatainfo->setValue($txt); $mailnotification->addSubItem($mailaddresses); $mailnotification->addSubItem($participantdata); $mailnotification->addSubItem($participantdatainfo); $form->addItem($mailnotification); // tutor notification - currently not available for 360° if (!$this->object->get360Mode()) { // parent course? global $tree; $has_parent = $tree->checkForParentType($this->object->getRefId(), "grp"); if (!$has_parent) { $has_parent = $tree->checkForParentType($this->object->getRefId(), "crs"); } $num_inv = sizeof($this->object->getInvitedUsers()); // notification $tut = new ilCheckboxInputGUI($this->lng->txt("survey_notification_tutor_setting"), "tut"); $tut->setChecked($this->object->getTutorNotificationStatus()); $form->addItem($tut); $tut_logins = array(); $tuts = $this->object->getTutorNotificationRecipients(); if ($tuts) { foreach ($tuts as $tut_id) { $tmp = ilObjUser::_lookupName($tut_id); if ($tmp["login"]) { $tut_logins[] = $tmp["login"]; } } } $tut_ids = new ilTextInputGUI($this->lng->txt("survey_notification_tutor_recipients"), "tut_ids"); $tut_ids->setDataSource($this->ctrl->getLinkTarget($this, "doAutoComplete", "", true)); $tut_ids->setRequired(true); $tut_ids->setMulti(true); $tut_ids->setMultiValues($tut_logins); $tut_ids->setValue(array_shift($tut_logins)); $tut->addSubItem($tut_ids); $tut_grp = new ilRadioGroupInputGUI($this->lng->txt("survey_notification_target_group"), "tut_grp"); $tut_grp->setRequired(true); $tut_grp->setValue($this->object->getTutorNotificationTarget()); $tut->addSubItem($tut_grp); $tut_grp_crs = new ilRadioOption($this->lng->txt("survey_notification_target_group_parent_course"), ilObjSurvey::NOTIFICATION_PARENT_COURSE); if (!$has_parent) { $tut_grp_crs->setInfo($this->lng->txt("survey_notification_target_group_parent_course_inactive")); } $tut_grp->addOption($tut_grp_crs); $tut_grp_inv = new ilRadioOption($this->lng->txt("survey_notification_target_group_invited"), ilObjSurvey::NOTIFICATION_INVITED_USERS); $tut_grp_inv->setInfo(sprintf($this->lng->txt("survey_notification_target_group_invited_info"), $num_inv)); $tut_grp->addOption($tut_grp_inv); } // reminders // reminder - currently not available for 360° if (!$this->object->get360Mode()) { $info = new ilFormSectionHeaderGUI(); $info->setTitle($this->lng->txt("svy_settings_section_reminders")); $form->addItem($info); $rmd = new ilCheckboxInputGUI($this->lng->txt("survey_reminder_setting"), "rmd"); $rmd->setChecked($this->object->getReminderStatus()); $form->addItem($rmd); $rmd_start = new ilDateTimeInputGUI($this->lng->txt("survey_reminder_start"), "rmd_start"); $rmd_start->setRequired(true); $start = $this->object->getReminderStart(); if ($start) { $rmd_start->setDate($start); } $rmd->addSubItem($rmd_start); $end = $this->object->getReminderEnd(); $rmd_end = new ilDateTimeInputGUI($this->lng->txt("survey_reminder_end"), "rmd_end"); $rmd_end->enableDateActivation("", "rmd_end_tgl", (bool) $end); if ($end) { $rmd_end->setDate($end); } $rmd->addSubItem($rmd_end); $rmd_freq = new ilNumberInputGUI($this->lng->txt("survey_reminder_frequency"), "rmd_freq"); $rmd_freq->setRequired(true); $rmd_freq->setSize(3); $rmd_freq->setSuffix($this->lng->txt("survey_reminder_frequency_days")); $rmd_freq->setValue($this->object->getReminderFrequency()); $rmd_freq->setMinValue(1); $rmd->addSubItem($rmd_freq); $rmd_grp = new ilRadioGroupInputGUI($this->lng->txt("survey_notification_target_group"), "rmd_grp"); $rmd_grp->setRequired(true); $rmd_grp->setValue($this->object->getReminderTarget()); $rmd->addSubItem($rmd_grp); $rmd_grp_crs = new ilRadioOption($this->lng->txt("survey_notification_target_group_parent_course"), ilObjSurvey::NOTIFICATION_PARENT_COURSE); if (!$has_parent) { $rmd_grp_crs->setInfo($this->lng->txt("survey_notification_target_group_parent_course_inactive")); } $rmd_grp->addOption($rmd_grp_crs); $rmd_grp_inv = new ilRadioOption($this->lng->txt("survey_notification_target_group_invited"), ilObjSurvey::NOTIFICATION_INVITED_USERS); $rmd_grp_inv->setInfo(sprintf($this->lng->txt("survey_notification_target_group_invited_info"), $num_inv)); $rmd_grp->addOption($rmd_grp_inv); } // results $results = new ilFormSectionHeaderGUI(); $results->setTitle($this->lng->txt("results")); $form->addItem($results); // evaluation access if (!$this->object->get360Mode()) { $evaluation_access = new ilRadioGroupInputGUI($this->lng->txt('evaluation_access'), "evaluation_access"); $option = new ilCheckboxOption($this->lng->txt("evaluation_access_off"), ilObjSurvey::EVALUATION_ACCESS_OFF, ''); $option->setInfo($this->lng->txt("svy_evaluation_access_off_info")); $evaluation_access->addOption($option); $option = new ilCheckboxOption($this->lng->txt("evaluation_access_all"), ilObjSurvey::EVALUATION_ACCESS_ALL, ''); $option->setInfo($this->lng->txt("svy_evaluation_access_all_info")); $evaluation_access->addOption($option); $option = new ilCheckboxOption($this->lng->txt("evaluation_access_participants"), ilObjSurvey::EVALUATION_ACCESS_PARTICIPANTS, ''); $option->setInfo($this->lng->txt("svy_evaluation_access_participants_info")); $evaluation_access->addOption($option); $evaluation_access->setValue($this->object->getEvaluationAccess()); $form->addItem($evaluation_access); $anonymization_options = new ilRadioGroupInputGUI($this->lng->txt("survey_results_anonymization"), "anonymization_options"); $option = new ilCheckboxOption($this->lng->txt("survey_results_personalized"), "statpers"); $option->setInfo($this->lng->txt("survey_results_personalized_info")); $anonymization_options->addOption($option); $option = new ilCheckboxOption($this->lng->txt("survey_results_anonymized"), "statanon"); $option->setInfo($this->lng->txt("survey_results_anonymized_info")); $anonymization_options->addOption($option); $anonymization_options->setValue($this->object->hasAnonymizedResults() ? "statanon" : "statpers"); $form->addItem($anonymization_options); if ($this->object->_hasDatasets($this->object->getSurveyId())) { $anonymization_options->setDisabled(true); } } else { $ts_results = new ilRadioGroupInputGUI($this->lng->txt("survey_360_results"), "ts_res"); $ts_results->setValue($this->object->get360Results()); $option = new ilRadioOption($this->lng->txt("survey_360_results_none"), ilObjSurvey::RESULTS_360_NONE); $option->setInfo($this->lng->txt("survey_360_results_none_info")); $ts_results->addOption($option); $option = new ilRadioOption($this->lng->txt("survey_360_results_own"), ilObjSurvey::RESULTS_360_OWN); $option->setInfo($this->lng->txt("survey_360_results_own_info")); $ts_results->addOption($option); $option = new ilRadioOption($this->lng->txt("survey_360_results_all"), ilObjSurvey::RESULTS_360_ALL); $option->setInfo($this->lng->txt("survey_360_results_all_info")); $ts_results->addOption($option); $form->addItem($ts_results); } // competence service activation for 360 mode include_once "./Services/Skill/classes/class.ilSkillManagementSettings.php"; $skmg_set = new ilSkillManagementSettings(); if ($this->object->get360Mode() && $skmg_set->isActivated()) { $other = new ilFormSectionHeaderGUI(); $other->setTitle($this->lng->txt("other")); $form->addItem($other); $skill_service = new ilCheckboxInputGUI($this->lng->txt("survey_activate_skill_service"), "skill_service"); $skill_service->setInfo($this->lng->txt("survey_activate_skill_service_info")); $skill_service->setChecked($this->object->get360SkillService()); $form->addItem($skill_service); } $form->addCommandButton("saveProperties", $this->lng->txt("save")); // remove items when using template if ($template_settings) { foreach ($template_settings as $id => $item) { if ($item["hide"]) { $form->removeItemByPostVar($id); } } } return $form; }
/** * @return ilPropertyFormGUI */ protected function getSettingsForm() { require_once 'Services/Form/classes/class.ilPropertyFormGUI.php'; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this, 'saveSettings')); $form->setTitle($this->lng->txt('settings')); $frm_radio = new ilRadioGroupInputGUI($this->lng->txt('show_topics_overview'), 'forum_overview'); $frm_radio->addOption(new ilRadioOption($this->lng->txt('new') . ', ' . $this->lng->txt('is_read') . ', ' . $this->lng->txt('unread'), '0')); $frm_radio->addOption(new ilRadioOption($this->lng->txt('is_read') . ', ' . $this->lng->txt('unread'), '1')); $frm_radio->setInfo($this->lng->txt('topics_overview_info')); $form->addItem($frm_radio); $check = new ilCheckboxInputGui($this->lng->txt('enable_fora_statistics'), 'fora_statistics'); $check->setInfo($this->lng->txt('enable_fora_statistics_desc')); $form->addItem($check); $check = new ilCheckboxInputGui($this->lng->txt('enable_anonymous_fora'), 'anonymous_fora'); $check->setInfo($this->lng->txt('enable_anonymous_fora_desc')); $form->addItem($check); require_once 'Services/Cron/classes/class.ilCronManager.php'; if (ilCronManager::isJobActive('frm_notification')) { require_once 'Services/Administration/classes/class.ilAdministrationSettingsFormHandler.php'; ilAdministrationSettingsFormHandler::addFieldsToForm(ilAdministrationSettingsFormHandler::FORM_FORUM, $form, $this); } else { $notifications = new ilCheckboxInputGui($this->lng->txt('cron_forum_notification'), 'forum_notification'); $notifications->setInfo($this->lng->txt('cron_forum_notification_desc')); $notifications->setValue(1); $form->addItem($notifications); } require_once 'Services/Captcha/classes/class.ilCaptchaUtil.php'; $cap = new ilCheckboxInputGUI($this->lng->txt('adm_captcha_anonymous_short'), 'activate_captcha_anonym'); $cap->setInfo($this->lng->txt('adm_captcha_anonymous_frm')); $cap->setValue(1); if (!ilCaptchaUtil::checkFreetype()) { $cap->setAlert(ilCaptchaUtil::getPreconditionsMessage()); } $form->addItem($cap); $form->addCommandButton('saveSettings', $this->lng->txt('save')); $form->addCommandButton('cancel', $this->lng->txt('cancel')); return $form; }
/** * init form edit * * @access protected * @return */ protected function initFormEdit() { global $tree; include_once "Services/Object/classes/class.ilObjectActivation.php"; include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; $this->form = new ilPropertyFormGUI(); $this->form->setFormAction($this->ctrl->getFormAction($this)); $title = ilObject::_lookupTitle(ilObject::_lookupObjId($this->getItemId())); $this->form->setTitle($title . ': ' . $this->lng->txt('crs_edit_timings')); $timings = new ilRadioGroupInputGUI($this->lng->txt('timings'), 'timing_type'); // opt deactivated $dea = new ilRadioOption($this->lng->txt('crs_timings_disabled'), ilObjectActivation::TIMINGS_DEACTIVATED); $dea->setInfo($this->lng->txt('crs_timings_disabled_info')); $timings->addOption($dea); // Visiblity $vis = new ilRadioOption($this->lng->txt('crs_timings_availability_enabled'), ilObjectActivation::TIMINGS_ACTIVATION); #$vis->setInfo($this->lng->txt('crs_timings_visibility')); $start = new ilDateTimeInputGUI($this->lng->txt('crs_timings_start'), 'timing_start'); $start->setShowTime(true); #$start->setMinuteStepSize(5); $vis->addSubItem($start); $end = new ilDateTimeInputGUI($this->lng->txt('crs_timings_end'), 'timing_end'); $end->setShowTime(true); #$end->setMinuteStepSize(5); $vis->addSubItem($end); $isv = new ilCheckboxInputGUI($this->lng->txt('crs_timings_visibility_short'), 'visible'); $isv->setInfo($this->lng->txt('crs_timings_visibility')); $isv->setValue(1); $vis->addSubItem($isv); $timings->addOption($vis); // Timings $tim = new ilRadioOption($this->lng->txt('crs_timings_presetting'), ilObjectActivation::TIMINGS_PRESETTING); $tim->setInfo($this->lng->txt('crs_item_presetting_info')); $start = new ilDateTimeInputGUI($this->lng->txt('crs_timings_sug_begin'), 'sug_start'); $tim->addSubItem($start); $end = new ilDateTimeInputGUI($this->lng->txt('crs_timings_sug_end'), 'sug_end'); $tim->addSubItem($end); if ($tree->checkForParentType($this->parent_ref_id, 'crs')) { $cha = new ilCheckboxInputGUI($this->lng->txt('crs_timings_changeable'), 'changeable'); $tim->addSubItem($cha); $start = new ilDateTimeInputGUI($this->lng->txt('crs_timings_early_begin'), 'early_start'); $tim->addSubItem($start); $late = new ilDateTimeInputGUI($this->lng->txt('crs_timings_short_limit_start_end'), 'late_end'); $tim->addSubItem($late); } $timings->addOption($tim); $this->form->addItem($timings); $this->form->addCommandButton('update', $this->lng->txt('save')); $this->form->addCommandButton('cancel', $this->lng->txt('cancel')); }
protected function initEditCustomForm(ilPropertyFormGUI $a_form) { global $lng; // activation include_once "Services/Object/classes/class.ilObjectActivation.php"; $this->lng->loadLanguageModule('rep'); $section = new ilFormSectionHeaderGUI(); $section->setTitle($this->lng->txt('rep_activation_availability')); $a_form->addItem($section); // additional info only with multiple references $act_obj_info = $act_ref_info = ""; if (sizeof(ilObject::_getAllReferences($this->object->getId())) > 1) { $act_obj_info = ' ' . $this->lng->txt('rep_activation_online_object_info'); $act_ref_info = $this->lng->txt('rep_activation_access_ref_info'); } $online = new ilCheckboxInputGUI($this->lng->txt('rep_activation_online'), 'online'); $online->setInfo($this->lng->txt('poll_activation_online_info') . $act_obj_info); $a_form->addItem($online); $act_type = new ilCheckboxInputGUI($this->lng->txt('rep_visibility_until'), 'access_type'); // $act_type->setInfo($this->lng->txt('poll_availability_until_info')); $this->tpl->addJavaScript('./Services/Form/js/date_duration.js'); include_once "Services/Form/classes/class.ilDateDurationInputGUI.php"; $dur = new ilDateDurationInputGUI($this->lng->txt('rep_time_period'), "access_period"); $dur->setShowTime(true); $date = $this->object->getAccessBegin(); $dur->setStart(new ilDateTime($date ? $date : time(), IL_CAL_UNIX)); $dur->setStartText($this->lng->txt('rep_activation_limited_start')); $date = $this->object->getAccessEnd(); $dur->setEnd(new ilDateTime($date ? $date : time(), IL_CAL_UNIX)); $dur->setEndText($this->lng->txt('rep_activation_limited_end')); $act_type->addSubItem($dur); $a_form->addItem($act_type); // period/results $section = new ilFormSectionHeaderGUI(); $section->setTitle($this->lng->txt('poll_voting_period_and_results')); $a_form->addItem($section); $prd = new ilCheckboxInputGUI($this->lng->txt('poll_voting_period_limited'), 'period'); $vdur = new ilDateDurationInputGUI($this->lng->txt('rep_time_period'), "voting_period"); $vdur->setShowTime(true); $date = $this->object->getVotingPeriodBegin(); $vdur->setStart(new ilDateTime($date ? $date : time(), IL_CAL_UNIX)); $vdur->setStartText($this->lng->txt('poll_voting_period_start')); $date = $this->object->getVotingPeriodEnd(); $vdur->setEnd(new ilDateTime($date ? $date : time(), IL_CAL_UNIX)); $vdur->setEndText($this->lng->txt('poll_voting_period_end')); $prd->addSubItem($vdur); $a_form->addItem($prd); $results = new ilRadioGroupInputGUI($lng->txt("poll_view_results"), "results"); $results->setRequired(true); $results->addOption(new ilRadioOption($lng->txt("poll_view_results_always"), ilObjPoll::VIEW_RESULTS_ALWAYS)); $results->addOption(new ilRadioOption($lng->txt("poll_view_results_never"), ilObjPoll::VIEW_RESULTS_NEVER)); $results->addOption(new ilRadioOption($lng->txt("poll_view_results_after_vote"), ilObjPoll::VIEW_RESULTS_AFTER_VOTE)); $results->addOption(new ilRadioOption($lng->txt("poll_view_results_after_period"), ilObjPoll::VIEW_RESULTS_AFTER_PERIOD)); $a_form->addItem($results); $show_result_as = new ilRadioGroupInputGUI($lng->txt("poll_show_results_as"), "show_results_as"); $show_result_as->setRequired(true); $result_bar = new ilRadioOption($lng->txt("poll_barchart"), ilObjPoll::SHOW_RESULTS_AS_BARCHART); $show_result_as->addOption($result_bar); $show_result_as->addOption(new ilRadioOption($lng->txt("poll_piechart"), ilObjPoll::SHOW_RESULTS_AS_PIECHART)); $a_form->addItem($show_result_as); $sort = new ilRadioGroupInputGUI($lng->txt("poll_result_sorting"), "sort"); $sort->setRequired(true); $sort->addOption(new ilRadioOption($lng->txt("poll_result_sorting_answers"), 0)); $sort->addOption(new ilRadioOption($lng->txt("poll_result_sorting_votes"), 1)); $a_form->addItem($sort); $section = new ilFormSectionHeaderGUI(); $section->setTitle($this->lng->txt('poll_comments')); $a_form->addItem($section); $comment = new ilCheckboxInputGUI($this->lng->txt('poll_comments'), 'comment'); //$comment->setInfo($this->lng->txt('poll_comments_info')); $a_form->addItem($comment); }
public function populateQuestionSpecificFormPart(ilPropertyFormGUI $form) { // maxsize $maxsize = new ilNumberInputGUI($this->lng->txt("maxsize"), "maxsize"); $maxsize->setValue($this->object->getMaxSize()); $maxsize->setInfo($this->lng->txt("maxsize_info")); $maxsize->setSize(10); $maxsize->setMinValue(0); $maxsize->setMaxValue($this->determineMaxFilesize()); $maxsize->setRequired(FALSE); $form->addItem($maxsize); // allowedextensions $allowedextensions = new ilTextInputGUI($this->lng->txt("allowedextensions"), "allowedextensions"); $allowedextensions->setInfo($this->lng->txt("allowedextensions_info")); $allowedextensions->setValue($this->object->getAllowedExtensions()); $allowedextensions->setRequired(FALSE); $form->addItem($allowedextensions); // points $points = new ilNumberInputGUI($this->lng->txt("points"), "points"); $points->allowDecimals(true); $points->setValue(is_numeric($this->object->getPoints()) && $this->object->getPoints() >= 0 ? $this->object->getPoints() : ''); $points->setRequired(TRUE); $points->setSize(3); $points->setMinValue(0.0); $points->setMinvalueShouldBeGreater(false); $form->addItem($points); $subcompl = new ilCheckboxInputGUI($this->lng->txt('ass_completion_by_submission'), 'completion_by_submission'); $subcompl->setInfo($this->lng->txt('ass_completion_by_submission_info')); $subcompl->setValue(1); $subcompl->setChecked($this->object->isCompletionBySubmissionEnabled()); $form->addItem($subcompl); return $form; }
/** * Init upload form. */ public function initUploadForm() { global $lng, $ilCtrl; include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form = new ilPropertyFormGUI(); // type selection $options = array("scorm2004" => $lng->txt("lm_type_scorm2004"), "scorm" => $lng->txt("lm_type_scorm"), "aicc" => $lng->txt("lm_type_aicc"), "hacp" => $lng->txt("lm_type_hacp")); $si = new ilSelectInputGUI($this->lng->txt("type"), "sub_type"); $si->setOptions($options); $this->form->addItem($si); // input file $fi = new ilFileInputGUI($this->lng->txt("select_file"), "scormfile"); $fi->setRequired(true); $this->form->addItem($fi); // todo "uploaded file" // todo wysiwyg editor removement include_once 'Services/FileSystem/classes/class.ilUploadFiles.php'; if (ilUploadFiles::_getUploadDirectory()) { $options = array(); $fi->setRequired(false); $files = ilUploadFiles::_getUploadFiles(); $options[""] = $this->lng->txt("cont_select_from_upload_dir"); foreach ($files as $file) { $file = htmlspecialchars($file, ENT_QUOTES, "utf-8"); $options[$file] = $file; } // $si = new ilSelectInputGUI($this->lng->txt("cont_uploaded_file"), "uploaded_file"); $si->setOptions($options); $this->form->addItem($si); } // validate file $cb = new ilCheckboxInputGUI($this->lng->txt("cont_validate_file"), "validate"); $cb->setValue("y"); //$cb->setChecked(true); $this->form->addItem($cb); // import for editing $cb = new ilCheckboxInputGUI($this->lng->txt("sahs_authoring_mode"), "editable"); $cb->setValue("y"); $cb->setInfo($this->lng->txt("sahs_authoring_mode_info")); $this->form->addItem($cb); // $radg = new ilRadioGroupInputGUI($lng->txt("sahs_sequencing"), "import_sequencing"); $radg->setValue(0); $op1 = new ilRadioOption($lng->txt("sahs_std_sequencing"), 0, $lng->txt("sahs_std_sequencing_info")); $radg->addOption($op1); $op1 = new ilRadioOption($lng->txt("sahs_import_sequencing"), 1, $lng->txt("sahs_import_sequencing_info")); $radg->addOption($op1); $cb->addSubItem($radg); $this->form->addCommandButton("upload", $lng->txt("import")); $this->form->addCommandButton("cancel", $lng->txt("cancel")); $this->form->setTitle($lng->txt("import_sahs")); $this->form->setFormAction($ilCtrl->getFormAction($this, "upload")); $this->form->setTarget(ilFrameTargetInfo::_getFrame("MainContent")); }
private function initLoginSettingsForm() { $this->setSubTabs('settings'); $this->tabs_gui->setTabActive('settings'); $this->tabs_gui->setSubTabActive('loginname_settings'); include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $this->loginSettingsForm = new ilPropertyFormGUI(); $this->loginSettingsForm->setFormAction($this->ctrl->getFormAction($this, 'saveLoginnameSettings')); $this->loginSettingsForm->setTitle($this->lng->txt('loginname_settings')); $chbChangeLogin = new ilCheckboxInputGUI($this->lng->txt('allow_change_loginname'), 'allow_change_loginname'); $chbChangeLogin->setValue(1); $this->loginSettingsForm->addItem($chbChangeLogin); $chbCreateHistory = new ilCheckboxInputGUI($this->lng->txt('history_loginname'), 'create_history_loginname'); $chbCreateHistory->setInfo($this->lng->txt('loginname_history_info')); $chbCreateHistory->setValue(1); $chbChangeLogin->addSubItem($chbCreateHistory); $chbReuseLoginnames = new ilCheckboxInputGUI($this->lng->txt('reuse_of_loginnames_contained_in_history'), 'reuse_of_loginnames'); $chbReuseLoginnames->setValue(1); $chbReuseLoginnames->setInfo($this->lng->txt('reuse_of_loginnames_contained_in_history_info')); $chbChangeLogin->addSubItem($chbReuseLoginnames); $chbChangeBlockingTime = new ilNumberInputGUI($this->lng->txt('loginname_change_blocking_time'), 'loginname_change_blocking_time'); $chbChangeBlockingTime->allowDecimals(true); $chbChangeBlockingTime->setSuffix($this->lng->txt('days')); $chbChangeBlockingTime->setInfo($this->lng->txt('loginname_change_blocking_time_info')); $chbChangeBlockingTime->setSize(10); $chbChangeBlockingTime->setMaxLength(10); $chbChangeLogin->addSubItem($chbChangeBlockingTime); $this->loginSettingsForm->addCommandButton('saveLoginnameSettings', $this->lng->txt('save')); }
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; }
/** * Set the language settings */ function settingsObject() { global $ilSetting; $translate_key = "lang_translate_" . $this->object->key; // save and get the page translation setting if (!empty($_POST)) { $ilSetting->set($translate_key, (bool) $_POST["translation"]); ilUtil::sendSuccess($this->lng->txt("settings_saved")); } $translate = $ilSetting->get($translate_key, false); require_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this)); $form->setTitle($this->lng->txt("language_settings")); $form->setPreventDoubleSubmission(false); $form->addCommandButton('settings', $this->lng->txt("language_change_settings")); $ci = new ilCheckboxInputGUI($this->lng->txt("language_translation_enabled"), "translation"); $ci->setChecked((bool) $translate); $ci->setInfo($this->lng->txt("language_note_translation")); $form->addItem($ci); $this->tpl->setContent($form->getHTML()); }
private function initForm() { include_once 'Services/Form/classes/class.ilPropertyFormGUI.php'; $this->form = new ilPropertyFormGUI(); $this->form->setFormAction($this->ctrl->getFormAction($this, 'save')); $this->form->setTitle($this->lng->txt('general_settings')); // Subject prefix $pre = new ilTextInputGUI($this->lng->txt('mail_subject_prefix'), 'mail_subject_prefix'); $pre->setSize(12); $pre->setMaxLength(32); $pre->setInfo($this->lng->txt('mail_subject_prefix_info')); $this->form->addItem($pre); // incoming type include_once 'Services/Mail/classes/class.ilMailOptions.php'; $options = array(IL_MAIL_LOCAL => $this->lng->txt('mail_incoming_local'), IL_MAIL_EMAIL => $this->lng->txt('mail_incoming_smtp'), IL_MAIL_BOTH => $this->lng->txt('mail_incoming_both')); $si = new ilSelectInputGUI($this->lng->txt('mail_incoming'), 'mail_incoming_mail'); $si->setOptions($options); $this->ctrl->setParameterByClass('ilobjuserfoldergui', 'ref_id', USER_FOLDER_ID); $si->setInfo(sprintf($this->lng->txt('mail_settings_incoming_type_see_also'), $this->ctrl->getLinkTargetByClass('ilobjuserfoldergui', 'settings'))); $this->ctrl->clearParametersByClass('ilobjuserfoldergui'); $this->form->addItem($si); // noreply address $ti = new ilTextInputGUI($this->lng->txt('mail_external_sender_noreply'), 'mail_external_sender_noreply'); $ti->setInfo($this->lng->txt('info_mail_external_sender_noreply')); $ti->setMaxLength(255); $this->form->addItem($ti); $system_sender_name = new ilTextInputGUI($this->lng->txt('mail_system_sender_name'), 'mail_system_sender_name'); $system_sender_name->setInfo($this->lng->txt('mail_system_sender_name_info')); $system_sender_name->setMaxLength(255); $this->form->addItem($system_sender_name); $cb = new ilCheckboxInputGUI($this->lng->txt('mail_use_pear_mail'), 'pear_mail_enable'); $cb->setInfo($this->lng->txt('mail_use_pear_mail_info')); $cb->setValue(1); $this->form->addItem($cb); // prevent smtp mails $cb = new ilCheckboxInputGUI($this->lng->txt('mail_prevent_smtp_globally'), 'prevent_smtp_globally'); $cb->setValue(1); $this->form->addItem($cb); $cron_mail = new ilSelectInputGUI($this->lng->txt('cron_mail_notification'), 'mail_notification'); $cron_options = array(0 => $this->lng->txt('cron_mail_notification_never'), 1 => $this->lng->txt('cron_mail_notification_cron')); $cron_mail->setOptions($cron_options); $cron_mail->setInfo($this->lng->txt('cron_mail_notification_desc')); $this->form->addItem($cron_mail); // section header $sh = new ilFormSectionHeaderGUI(); $sh->setTitle($this->lng->txt('mail') . ' (' . $this->lng->txt('internal_system') . ')'); $this->form->addItem($sh); // max attachment size $ti = new ilNumberInputGUI($this->lng->txt('mail_maxsize_attach'), 'mail_maxsize_attach'); $ti->setSuffix($this->lng->txt('kb')); $ti->setInfo($this->lng->txt('mail_max_size_attachments_total')); $ti->setMaxLength(10); $ti->setSize(10); $this->form->addItem($ti); // Course/Group member notification $mn = new ilFormSectionHeaderGUI(); $mn->setTitle($this->lng->txt('mail_member_notification')); $this->form->addItem($mn); include_once "Services/Administration/classes/class.ilAdministrationSettingsFormHandler.php"; ilAdministrationSettingsFormHandler::addFieldsToForm(ilAdministrationSettingsFormHandler::FORM_MAIL, $this->form, $this); $this->form->addCommandButton('save', $this->lng->txt('save')); }
public function StatutoryRegulationsObject() { $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment'); $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this, 'saveStatutoryRegulations')); $form->setTitle($this->lng->txt('statutory_regulations')); $form->setTableWidth('100%'); // message $post_gui = new ilTextAreaInputGUI($this->lng->txt('content'), 'statutory_regulations'); $post_gui->setCols(50); $post_gui->setRows(15); $post_gui->setUseRte(true); $post_gui->addPlugin('latex'); $post_gui->addButton('latex'); $post_gui->addButton('pastelatex'); $post_gui->addPlugin('ilimgupload'); $post_gui->addButton('ilimgupload'); $post_gui->removePlugin('advlink'); $post_gui->removePlugin(ilRTE::ILIAS_IMG_MANAGER_PLUGIN); $post_gui->removePlugin('image'); $post_gui->usePurifier(true); $post_gui->setRTERootBlockElement(''); $post_gui->setRTESupport(ilObject::_lookupObjId($this->ref_id), 'pays~', 'frm_post', 'tpl.tinymce_frm_post.html', false, '3.4.7'); $post_gui->disableButtons(array('charmap', 'undo', 'redo', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'anchor', 'fullscreen', 'cut', 'copy', 'paste', 'pastetext', 'formatselect', 'image')); // purifier require_once 'Services/Html/classes/class.ilHtmlPurifierFactory.php'; require_once 'Services/RTE/classes/class.ilRTE.php'; $post_gui->setPurifier(ilHtmlPurifierFactory::_getInstanceByType('frm_post')); $post_gui->setValue(ilRTE::_replaceMediaObjectImageSrc($this->genSetData->get('statutory_regulations'), 1)); $form->addItem($post_gui); // show staturaltyio regulations in shoppingcart $cb_showShoppingCart = new ilCheckboxInputGUI($this->lng->txt('show_sr_shoppingcart'), 'show_sr_shoppingcart'); $cb_showShoppingCart->setInfo($this->lng->txt('show_sr_shoppingcart_info')); $cb_showShoppingCart->setValue(1); $cb_showShoppingCart->setChecked($this->genSetData->get('show_sr_shoppingcart')); $form->addItem($cb_showShoppingCart); // attach staturaltyio regulations at invoice $cb_attachInvoice = new ilCheckboxInputGUI($this->lng->txt('attach_sr_invoice'), 'attach_sr_invoice'); $cb_attachInvoice->setInfo($this->lng->txt('attach_sr_invoice_info')); $cb_attachInvoice->setValue(1); $cb_attachInvoice->setChecked($this->genSetData->get('attach_sr_invoice')); $form->addItem($cb_attachInvoice); $form->addCommandButton('saveStatutoryRegulations', $this->lng->txt('save')); $this->tpl->setVariable('FORM', $form->getHTML()); }
/** * Edit disk quota settings. */ public function editDiskQuotaSettings() { global $rbacsystem, $ilErr, $ilSetting, $tpl, $lng, $ilCtrl; if (!$rbacsystem->checkAccess("visible,read", $this->object->getRefId())) { $ilErr->raiseError($lng->txt("no_permission"), $ilErr->WARNING); } $this->tabs_gui->setTabActive('disk_quota'); $this->addDiskQuotaSubtabs('settings'); require_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; require_once "./Services/Form/classes/class.ilCheckboxInputGUI.php"; require_once "./Services/Form/classes/class.ilRadioGroupInputGUI.php"; require_once "./Services/Form/classes/class.ilRadioOption.php"; require_once "./Services/Form/classes/class.ilTextAreaInputGUI.php"; require_once "./Services/WebDAV/classes/class.ilDAVServer.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($ilCtrl->getFormAction($this)); $form->setTitle($lng->txt("settings")); // Enable disk quota $cb_prop = new ilCheckboxInputGUI($lng->txt("enable_disk_quota"), "enable_disk_quota"); $cb_prop->setValue('1'); $cb_prop->setChecked($this->disk_quota_obj->isDiskQuotaEnabled()); $cb_prop->setInfo($lng->txt('enable_disk_quota_info')); $form->addItem($cb_prop); // Enable disk quota reminder mail $cb_prop_reminder = new ilCheckboxInputGUI($lng->txt("enable_disk_quota_reminder_mail"), "enable_disk_quota_reminder_mail"); $cb_prop_reminder->setValue('1'); $cb_prop_reminder->setChecked($this->disk_quota_obj->isDiskQuotaReminderMailEnabled()); $cb_prop_reminder->setInfo($lng->txt('disk_quota_reminder_mail_desc')); $cb_prop->addSubItem($cb_prop_reminder); // Enable summary mail for certain users $cb_prop_summary = new ilCheckboxInputGUI($lng->txt("enable_disk_quota_summary_mail"), "enable_disk_quota_summary_mail"); $cb_prop_summary->setValue(1); $cb_prop_summary->setChecked($this->disk_quota_obj->isDiskQuotaSummaryMailEnabled()); $cb_prop_summary->setInfo($lng->txt('enable_disk_quota_summary_mail_desc')); $cb_prop->addSubItem($cb_prop_summary); // Edit disk quota recipients $summary_rcpt = new ilTextInputGUI($lng->txt("disk_quota_summary_rctp"), "disk_quota_summary_rctp"); $summary_rcpt->setValue($this->disk_quota_obj->getSummaryRecipients()); $summary_rcpt->setInfo($lng->txt('disk_quota_summary_rctp_desc')); $cb_prop_summary->addSubItem($summary_rcpt); // command buttons $form->addCommandButton('saveDiskQuotaSettings', $lng->txt('save')); $form->addCommandButton('editDiskQuotaSettings', $lng->txt('cancel')); $tpl->setContent($form->getHTML()); }
/** * Init assignment form. * * @param int $a_mode "create"/"edit" */ public function initAssignmentForm($a_mode = "create") { global $lng, $ilCtrl, $ilSetting; // init form $lng->loadLanguageModule("form"); include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form = new ilPropertyFormGUI(); $this->form->setTableWidth("600px"); if ($a_mode == "edit") { $this->form->setTitle($lng->txt("exc_edit_assignment")); } else { $this->form->setTitle($lng->txt("exc_new_assignment")); } $this->form->setFormAction($ilCtrl->getFormAction($this)); // type include_once "./Modules/Exercise/classes/class.ilExAssignment.php"; $types = array(ilExAssignment::TYPE_UPLOAD => $this->lng->txt("exc_type_upload"), ilExAssignment::TYPE_UPLOAD_TEAM => $this->lng->txt("exc_type_upload_team"), ilExAssignment::TYPE_TEXT => $this->lng->txt("exc_type_text")); if (!$ilSetting->get('disable_wsp_blogs')) { $types[ilExAssignment::TYPE_BLOG] = $this->lng->txt("exc_type_blog"); } if ($ilSetting->get('user_portfolios')) { $types[ilExAssignment::TYPE_PORTFOLIO] = $this->lng->txt("exc_type_portfolio"); } if (sizeof($types) > 1) { $ty = new ilSelectInputGUI($this->lng->txt("exc_assignment_type"), "type"); $ty->setOptions($types); $ty->setRequired(true); } else { $ty = new ilHiddenInputGUI("type"); $ty->setValue(ilExAssignment::TYPE_UPLOAD); } $this->form->addItem($ty); // title $ti = new ilTextInputGUI($this->lng->txt("title"), "title"); $ti->setMaxLength(200); $ti->setRequired(true); $this->form->addItem($ti); // start time y/n $cb = new ilCheckboxInputGUI($this->lng->txt("exc_start_time"), "start_time_cb"); $this->form->addItem($cb); // start time $edit_date = new ilDateTimeInputGUI("", "start_time"); $edit_date->setShowTime(true); $cb->addSubItem($edit_date); // deadline y/n $dcb = new ilCheckboxInputGUI($this->lng->txt("exc_deadline"), "deadline_cb"); $dcb->setChecked(true); $this->form->addItem($dcb); // Deadline $edit_date = new ilDateTimeInputGUI($lng->txt(""), "deadline"); $edit_date->setShowTime(true); $dcb->addSubItem($edit_date); // mandatory $cb = new ilCheckboxInputGUI($this->lng->txt("exc_mandatory"), "mandatory"); $cb->setInfo($this->lng->txt("exc_mandatory_info")); $cb->setChecked(true); $this->form->addItem($cb); // Work Instructions $desc_input = new ilTextAreaInputGUI($lng->txt("exc_instruction"), "instruction"); $desc_input->setRows(20); $desc_input->setUseRte(true); $desc_input->setRteTagSet("mini"); $this->form->addItem($desc_input); // files if ($a_mode == "create") { $files = new ilFileWizardInputGUI($this->lng->txt('objs_file'), 'files'); $files->setFilenames(array(0 => '')); $this->form->addItem($files); } // peer review $peer = new ilCheckboxInputGUI($lng->txt("exc_peer_review"), "peer"); $peer->setInfo($this->lng->txt("exc_peer_review_ass_setting_info")); $this->form->addItem($peer); if ($a_mode == "create") { $peer->setInfo($lng->txt("exc_peer_review_info")); } $peer_min = new ilNumberInputGUI($lng->txt("exc_peer_review_min_number"), "peer_min"); $peer_min->setInfo($lng->txt("exc_peer_review_min_number_info")); $peer_min->setRequired(true); $peer_min->setValue(5); $peer_min->setSize(3); $peer_min->setValue(2); $peer->addSubItem($peer_min); $peer_dl = new ilDateTimeInputGUI($lng->txt("exc_peer_review_deadline"), "peer_dl"); $peer_dl->setInfo($lng->txt("exc_peer_review_deadline_info")); $peer_dl->enableDateActivation("", "peer_dl_tgl"); $peer_dl->setShowTime(true); $peer->addSubItem($peer_dl); $peer_file = new ilCheckboxInputGUI($lng->txt("exc_peer_review_file"), "peer_file"); $peer_file->setInfo($lng->txt("exc_peer_review_file_info")); $peer->addSubItem($peer_file); $peer_prsl = new ilCheckboxInputGUI($lng->txt("exc_peer_review_personal"), "peer_prsl"); $peer_prsl->setInfo($lng->txt("exc_peer_review_personal_info")); $peer->addSubItem($peer_prsl); if ($a_mode != "create" && $this->ass && $this->ass->getDeadline() && $this->ass->getDeadline() < time()) { $peer_prsl->setDisabled(true); } // global feedback $fb = new ilCheckboxInputGUI($lng->txt("exc_global_feedback_file"), "fb"); $this->form->addItem($fb); $fb_file = new ilFileInputGUI($lng->txt("file"), "fb_file"); // $fb_file->setRequired(true); $fb_file->setALlowDeletion(true); $fb->addSubItem($fb_file); $fb_date = new ilRadioGroupInputGUI($lng->txt("exc_global_feedback_file_date"), "fb_date"); $fb_date->setRequired(true); $fb_date->addOption(new ilRadioOption($lng->txt("exc_global_feedback_file_date_deadline"), ilExAssignment::FEEDBACK_DATE_DEADLINE)); $fb_date->addOption(new ilRadioOption($lng->txt("exc_global_feedback_file_date_upload"), ilExAssignment::FEEDBACK_DATE_SUBMISSION)); $fb->addSubItem($fb_date); $fb_cron = new ilCheckboxInputGUI($lng->txt("exc_global_feedback_file_cron"), "fb_cron"); $fb_cron->setInfo($lng->txt("exc_global_feedback_file_cron_info")); $fb->addSubItem($fb_cron); // save and cancel commands if ($a_mode == "create") { $this->form->addCommandButton("saveAssignment", $lng->txt("save")); $this->form->addCommandButton("listAssignments", $lng->txt("cancel")); } else { $this->form->addCommandButton("updateAssignment", $lng->txt("save")); $this->form->addCommandButton("listAssignments", $lng->txt("cancel")); } }
/** * @param ilPropertyFormGUI $a_form */ protected function initEditCustomForm(ilPropertyFormGUI $a_form) { global $ilCtrl, $ilErr, $ilTabs; $ilTabs->activateTab("id_settings"); // is_online $cb = new ilCheckboxInputGUI($this->lng->txt("online"), "is_online"); $cb->setInfo($this->lng->txt("dcl_online_info")); $a_form->addItem($cb); // Notification $cb = new ilCheckboxInputGUI($this->lng->txt("dcl_activate_notification"), "notification"); $cb->setInfo($this->lng->txt("dcl_notification_info")); $a_form->addItem($cb); }