/**
  * Init service settings form
  * @param ilPropertyFormGUI $form
  * @param type $services
  */
 public static function initServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services)
 {
     global $ilSetting;
     if (in_array(self::CALENDAR_VISIBILITY, $services)) {
         include_once './Services/Calendar/classes/class.ilObjCalendarSettings.php';
         if (ilCalendarSettings::_getInstance()->isEnabled()) {
             // Container tools (calendar, news, ... activation)
             $cal = new ilCheckboxInputGUI('', self::CALENDAR_VISIBILITY);
             $cal->setValue(1);
             include_once './Services/Calendar/classes/class.ilObjCalendarSettings.php';
             $cal->setChecked(ilCalendarSettings::lookupCalendarActivated($a_obj_id));
             $cal->setOptionTitle($GLOBALS['lng']->txt('obj_tool_setting_calendar'));
             $form->addItem($cal);
         }
     }
     if (in_array(self::NEWS_VISIBILITY, $services)) {
         if ($ilSetting->get('block_activated_news')) {
             // Container tools (calendar, news, ... activation)
             $news = new ilCheckboxInputGUI('', self::NEWS_VISIBILITY);
             $news->setValue(1);
             $news->setChecked(ilContainer::_lookupContainerSetting($a_obj_id, self::NEWS_VISIBILITY, $ilSetting->get('block_activated_news', true)));
             $news->setOptionTitle($GLOBALS['lng']->txt('obj_tool_setting_news'));
             $form->addItem($news);
         }
     }
     return $form;
 }
 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);
     }
 }
 /**
  * List templates
  */
 function listTemplates()
 {
     // list pages
     include_once "./Modules/Wiki/classes/class.ilWikiPage.php";
     $pages = ilWikiPage::getAllPages($this->wiki->getId());
     $options = array("" => $this->lng->txt("please_select"));
     foreach ($pages as $p) {
         //if (!in_array($p["id"], $ipages_ids))
         //{
         $options[$p["id"]] = ilUtil::shortenText($p["title"], 60, true);
         //}
     }
     $this->toolbar->setFormAction($this->ctrl->getFormAction($this));
     $this->toolbar->setOpenFormTag(true);
     $this->toolbar->setCloseFormTag(false);
     if (count($options) > 0) {
         include_once "./Services/Form/classes/class.ilSelectInputGUI.php";
         $si = new ilSelectInputGUI($this->lng->txt("wiki_pages"), "templ_page_id");
         $si->setOptions($options);
         $this->toolbar->addInputItem($si);
         $this->toolbar->addFormButton($this->lng->txt("wiki_add_template"), "add");
         $this->toolbar->addSeparator();
     }
     // empty page as template?
     include_once "./Services/Form/classes/class.ilCheckboxInputGUI.php";
     $cb = new ilCheckboxInputGUI($this->lng->txt("wiki_empty_page_template"), "empty_page_templ");
     $cb->setChecked($this->wiki->getEmptyPageTemplate());
     $this->toolbar->addInputItem($cb, true);
     $this->toolbar->addFormButton($this->lng->txt("save"), "saveTemplateSettings");
     include_once "./Modules/Wiki/classes/class.ilWikiPageTemplatesTableGUI.php";
     $tab = new ilWikiPageTemplatesTableGUI($this, "listTemplates", $this->wiki->getId());
     $tab->setOpenFormTag(false);
     $tab->setCloseFormTag(true);
     $this->tpl->setContent($tab->getHTML());
 }
 public function addToForm()
 {
     global $lng;
     $adt = $this->getADT();
     $default = false;
     if ($adt->isNull()) {
         // see ilPersonalProfileGUI::addLocationToForm()
         // use installation default
         include_once "./Services/Maps/classes/class.ilMapUtil.php";
         $def = ilMapUtil::getDefaultSettings();
         $adt->setLatitude($def["latitude"]);
         $adt->setLongitude($def["longitude"]);
         $adt->setZoom($def["zoom"]);
         $default = true;
     }
     $optional = new ilCheckboxInputGUI($this->getTitle(), $this->addToElementId("tgl"));
     if (!$default && !$adt->isNull()) {
         $optional->setChecked(true);
     }
     $loc = new ilLocationInputGUI($lng->txt("location"), $this->getElementId());
     $loc->setLongitude($adt->getLongitude());
     $loc->setLatitude($adt->getLatitude());
     $loc->setZoom($adt->getZoom());
     $optional->addSubItem($loc);
     $rad = new ilNumberInputGUI($lng->txt("form_location_radius"), $this->addToElementId("rad"));
     $rad->setSize(4);
     $rad->setSuffix($lng->txt("form_location_radius_km"));
     $rad->setValue($this->radius);
     $rad->setRequired(true);
     $optional->addSubItem($rad);
     $this->addToParentElement($optional);
 }
 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);
 }
 /**
  * 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;
 }
 /**
  * @param ilRadioOption $option
  * @throws ilCloudPluginConfigException
  */
 public function initPluginCreationFormSection(ilRadioOption $option)
 {
     $option->setInfo($this->txt("create_info1") . "</br>" . $this->txt("create_info2") . $this->getAdminConfigObject()->getAppName() . $this->txt("create_info3"));
     $sub_selection = new ilRadioGroupInputGUI($this->txt(self::F_BASE_FOLDER), "dropbox_base_folder");
     $sub_selection->setRequired(true);
     $option_default = new ilRadioOption($this->txt("default_base_folder"), self::F_DROPBOX_DEFAULT_BASE_FOLDER);
     $option_custom = new ilRadioOption($this->txt("custom_base_folder"), self::F_DROPBOX_CUSTOM_FOLDER_SELECTION);
     $custom_base_folder_input = new ilTextInputGUI($this->txt("custom_base_folder_input"), self::F_DROPBOX_CUSTOM_BASE_FOLDER_INPUT);
     $custom_base_folder_input->setRequired(true);
     $custom_base_folder_input->setInfo($this->txt("custom_base_folder_input_info"));
     $option_custom->addSubItem($custom_base_folder_input);
     $sub_selection->addOption($option_default);
     $sub_selection->addOption($option_custom);
     $sub_selection->setValue(self::F_DROPBOX_DEFAULT_BASE_FOLDER);
     $option->addSubItem($sub_selection);
     $sub_selection2 = new ilCheckboxInputGUI($this->txt(self::F_ONLINE), self::F_ONLINE);
     if ($this->getAdminConfigObject()->getValue('config_default_online')) {
         $sub_selection2->setChecked(true);
     }
     $option->addSubItem($sub_selection2);
 }
 public function 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;
 }
 /**
  * Init configuration form
  * @global type $ilCtrl 
  */
 protected function initConfigurationForm()
 {
     global $ilCtrl, $lng;
     $settings = ilFhoevEventSettings::getInstance();
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setTitle($this->getPluginObject()->txt('tbl_fhoev_event_settings'));
     $form->setFormAction($ilCtrl->getFormAction($this));
     $form->addCommandButton('save', $lng->txt('save'));
     $form->setShowTopButtons(false);
     $lock = new ilCheckboxInputGUI($this->getPluginObject()->txt('tbl_settings_active'), 'active');
     $lock->setValue(1);
     $lock->setChecked($settings->isActive());
     $form->addItem($lock);
     $dtpl = new ilNumberInputGUI($this->getPluginObject()->txt('tbl_settings_dtpl'), 'dtpl');
     $dtpl->setSize(8);
     $dtpl->setValue($settings->getTemplateId());
     $dtpl->setRequired(TRUE);
     $dtpl->setMinValue(1);
     $form->addItem($dtpl);
     return $form;
 }
 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);
 }
 public function editPriceObject()
 {
     $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment');
     $price_id = $_GET['price_id'] ? $_GET['price_id'] : $_POST['price_id'];
     $price = ilPaymentPrices::_getPrice($price_id);
     $this->ctrl->setParameter($this, 'pobject_id', (int) $_GET['pobject_id']);
     $tmp_pobject = ilPaymentObject::_getObjectData($_GET['pobject_id']);
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $tmp_obj = ilObjectFactory::getInstanceByRefId($tmp_pobject['ref_id'], false);
     if ($tmp_obj) {
         $form->setTitle($tmp_obj->getTitle());
     } else {
         $form->setTitle($this->lng->txt('object_not_found'));
     }
     //price_type
     $radio_group = new ilRadioGroupInputGUI('', 'price_type');
     $radio_group->setTitle($this->lng->txt('duration'));
     $radio_group->setRequired(true);
     $radio_group->setValue($price['price_type']);
     $radio_group->setPostVar('price_type');
     $radio_option_1 = new ilRadioOption($this->lng->txt('duration_month'), ilPaymentPrices::TYPE_DURATION_MONTH);
     // duration month
     $oDuration = new ilNumberInputGUI();
     $oDuration->setTitle($this->lng->txt('paya_months'));
     $oDuration->setSize('20%');
     $oDuration->setValue($price['duration']);
     $oDuration->setPostVar('duration_month');
     $radio_option_1->addSubItem($oDuration);
     $radio_group->addOption($radio_option_1);
     $radio_option_3 = new ilRadioOption($this->lng->txt('duration_date'), ilPaymentPrices::TYPE_DURATION_DATE);
     // duration_date from
     $o_date_from = new ilDateTimeInputGUI();
     $o_date_from->setTitle($this->lng->txt('cal_from'));
     $o_date_from->setDate(new ilDate($price['duration_from'], IL_CAL_DATE));
     $o_date_from->setPostVar('duration_date_from');
     $radio_option_3->addSubItem($o_date_from);
     // duration_date until
     $o_date_until = new ilDateTimeInputGUI();
     $o_date_until->setTitle($this->lng->txt('cal_until'));
     $o_date_until->setDate(new ilDate($price['duration_until'], IL_CAL_DATE));
     $o_date_until->setPostVar('duration_date_until');
     $radio_option_3->addSubItem($o_date_until);
     $radio_group->addOption($radio_option_3);
     $radio_option_2 = new ilRadioOption($this->lng->txt('unlimited_duration'), ilPaymentPrices::TYPE_UNLIMITED_DURATION);
     $radio_group->addOption($radio_option_2);
     $form->addItem($radio_group);
     // description
     $oDescription = new ilTextAreaInputGUI($this->lng->txt('description'), 'description');
     $oDescription->setRows(4);
     $oDescription->setCols(35);
     $oDescription->setValue($price['description']);
     $form->addItem($oDescription);
     // price
     $oPrice = new ilNumberInputGUI();
     $oPrice->setTitle($this->lng->txt('price_a'));
     $oPrice->setSize('20%');
     $oPrice->setRequired(true);
     $oPrice->setValue($price['price']);
     include_once './Services/Payment/classes/class.ilPaymentSettings.php';
     $genSet = ilPaymentSettings::_getInstance();
     $oPrice->setInfo($genSet->get('currency_unit'));
     $oPrice->setPostVar('price');
     $oPrice->allowDecimals(true);
     $form->addItem($oPrice);
     //extension
     $oExtension = new ilCheckboxInputGUI($this->lng->txt('extension_price'), 'extension');
     $oExtension->setChecked($price['extension']);
     $form->addItem($oExtension);
     $o_hidden_1 = new ilHiddenInputGUI('pobject_id');
     $o_hidden_1->setValue((int) $_GET['pobject_id']);
     $o_hidden_1->setPostVar('pobject_id');
     $o_hidden_2 = new ilHiddenInputGUI('price_id');
     $o_hidden_2->setValue((int) $_GET['price_id']);
     $o_hidden_2->setPostVar('price_id');
     $form->addItem($o_hidden_1);
     $form->addItem($o_hidden_2);
     $form->addCommandButton('updatePrice', $this->lng->txt('save'));
     $form->addCommandButton('editPrices', $this->lng->txt('cancel'));
     $this->tpl->setVariable('FORM', $form->getHTML());
 }
 /**
  * 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());
 }
 /**
  * init general settings form
  * @return 
  */
 protected function initFormGeneralSettings()
 {
     global $ilSetting;
     $this->setSubTabs('settings');
     $this->tabs_gui->setTabActive('settings');
     $this->tabs_gui->setSubTabActive('general_settings');
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form = new ilPropertyFormGUI();
     $this->form->setFormAction($this->ctrl->getFormAction($this, 'saveGeneralSettings'));
     $this->form->setTitle($this->lng->txt('general_settings'));
     $lua = new ilCheckboxInputGUI($this->lng->txt('enable_local_user_administration'), 'lua');
     $lua->setInfo($this->lng->txt('enable_local_user_administration_info'));
     $lua->setValue(1);
     $this->form->addItem($lua);
     $lrua = new ilCheckboxInputGUI($this->lng->txt('restrict_user_access'), 'lrua');
     $lrua->setInfo($this->lng->txt('restrict_user_access_info'));
     $lrua->setValue(1);
     $this->form->addItem($lrua);
     // enable alphabetical navigation in user administration
     $alph = new ilCheckboxInputGUI($this->lng->txt('user_adm_enable_alpha_nav'), 'user_adm_alpha_nav');
     //$alph->setInfo($this->lng->txt('restrict_user_access_info'));
     $alph->setValue(1);
     $this->form->addItem($alph);
     // account codes
     $code = new ilCheckboxInputGUI($this->lng->txt("user_account_code_setting"), "user_reactivate_code");
     $code->setInfo($this->lng->txt('user_account_code_setting_info'));
     $this->form->addItem($code);
     // delete own account
     $own = new ilCheckboxInputGUI($this->lng->txt("user_allow_delete_own_account"), "user_own_account");
     $this->form->addItem($own);
     $own_email = new ilEMailInputGUI($this->lng->txt("user_delete_own_account_notification_email"), "user_own_account_email");
     $own->addSubItem($own_email);
     // BEGIN SESSION SETTINGS
     // create session handling radio group
     $ssettings = new ilRadioGroupInputGUI($this->lng->txt('sess_mode'), 'session_handling_type');
     // first option, fixed session duration
     $fixed = new ilRadioOption($this->lng->txt('sess_fixed_duration'), ilSession::SESSION_HANDLING_FIXED);
     // create session reminder subform
     $cb = new ilCheckboxInputGUI($this->lng->txt("session_reminder"), "session_reminder_enabled");
     $expires = ilSession::getSessionExpireValue();
     $time = ilFormat::_secondsToString($expires, true);
     $cb->setInfo($this->lng->txt("session_reminder_info") . "<br />" . sprintf($this->lng->txt('session_reminder_session_duration'), $time));
     $fixed->addSubItem($cb);
     // add session handling to radio group
     $ssettings->addOption($fixed);
     // second option, session control
     $ldsh = new ilRadioOption($this->lng->txt('sess_load_dependent_session_handling'), ilSession::SESSION_HANDLING_LOAD_DEPENDENT);
     // add session control subform
     require_once 'Services/Authentication/classes/class.ilSessionControl.php';
     // this is the max count of active sessions
     // that are getting started simlutanously
     $sub_ti = new ilTextInputGUI($this->lng->txt('session_max_count'), 'session_max_count');
     $sub_ti->setMaxLength(5);
     $sub_ti->setSize(5);
     $sub_ti->setInfo($this->lng->txt('session_max_count_info'));
     if (!$ilSetting->get('session_allow_client_maintenance', ilSessionControl::DEFAULT_ALLOW_CLIENT_MAINTENANCE)) {
         $sub_ti->setDisabled(true);
     }
     $ldsh->addSubItem($sub_ti);
     // after this (min) idle time the session can be deleted,
     // if there are further requests for new sessions,
     // but max session count is reached yet
     $sub_ti = new ilTextInputGUI($this->lng->txt('session_min_idle'), 'session_min_idle');
     $sub_ti->setMaxLength(5);
     $sub_ti->setSize(5);
     $sub_ti->setInfo($this->lng->txt('session_min_idle_info'));
     if (!$ilSetting->get('session_allow_client_maintenance', ilSessionControl::DEFAULT_ALLOW_CLIENT_MAINTENANCE)) {
         $sub_ti->setDisabled(true);
     }
     $ldsh->addSubItem($sub_ti);
     // after this (max) idle timeout the session expires
     // and become invalid, so it is not considered anymore
     // when calculating current count of active sessions
     $sub_ti = new ilTextInputGUI($this->lng->txt('session_max_idle'), 'session_max_idle');
     $sub_ti->setMaxLength(5);
     $sub_ti->setSize(5);
     $sub_ti->setInfo($this->lng->txt('session_max_idle_info'));
     if (!$ilSetting->get('session_allow_client_maintenance', ilSessionControl::DEFAULT_ALLOW_CLIENT_MAINTENANCE)) {
         $sub_ti->setDisabled(true);
     }
     $ldsh->addSubItem($sub_ti);
     // this is the max duration that can elapse between the first and the secnd
     // request to the system before the session is immidietly deleted
     $sub_ti = new ilTextInputGUI($this->lng->txt('session_max_idle_after_first_request'), 'session_max_idle_after_first_request');
     $sub_ti->setMaxLength(5);
     $sub_ti->setSize(5);
     $sub_ti->setInfo($this->lng->txt('session_max_idle_after_first_request_info'));
     if (!$ilSetting->get('session_allow_client_maintenance', ilSessionControl::DEFAULT_ALLOW_CLIENT_MAINTENANCE)) {
         $sub_ti->setDisabled(true);
     }
     $ldsh->addSubItem($sub_ti);
     // add session control to radio group
     $ssettings->addOption($ldsh);
     // add radio group to form
     if ($ilSetting->get('session_allow_client_maintenance', ilSessionControl::DEFAULT_ALLOW_CLIENT_MAINTENANCE)) {
         // just shows the status wether the session
         //setting maintenance is allowed by setup
         $this->form->addItem($ssettings);
     } else {
         // just shows the status wether the session
         //setting maintenance is allowed by setup
         $ti = new ilNonEditableValueGUI($this->lng->txt('session_config'), "session_config");
         $ti->setValue($this->lng->txt('session_config_maintenance_disabled'));
         $ssettings->setDisabled(true);
         $ti->addSubItem($ssettings);
         $this->form->addItem($ti);
     }
     // END SESSION SETTINGS
     $this->lng->loadLanguageModule('ps');
     $pass = new ilFormSectionHeaderGUI();
     $pass->setTitle($this->lng->txt('ps_password_settings'));
     $this->form->addItem($pass);
     // password generation
     $cb = new ilCheckboxInputGUI($this->lng->txt("passwd_generation"), "passwd_auto_generate");
     $cb->setChecked($ilSetting->get("passwd_auto_generate"));
     $cb->setInfo($this->lng->txt("passwd_generation_info"));
     $this->form->addItem($cb);
     $check = new ilCheckboxInputGUI($this->lng->txt('ps_password_change_on_first_login_enabled'), 'password_change_on_first_login_enabled');
     $check->setInfo($this->lng->txt('ps_password_change_on_first_login_enabled_info'));
     $this->form->addItem($check);
     include_once './Services/PrivacySecurity/classes/class.ilSecuritySettings.php';
     $check = new ilCheckboxInputGUI($this->lng->txt('ps_password_must_not_contain_loginame'), 'password_must_not_contain_loginame');
     $check->setInfo($this->lng->txt('ps_password_must_not_contain_loginame_info'));
     $this->form->addItem($check);
     $check = new ilCheckboxInputGUI($this->lng->txt('ps_password_chars_and_numbers_enabled'), 'password_chars_and_numbers_enabled');
     //$check->setOptionTitle($this->lng->txt('ps_password_chars_and_numbers_enabled'));
     $check->setInfo($this->lng->txt('ps_password_chars_and_numbers_enabled_info'));
     $this->form->addItem($check);
     $check = new ilCheckboxInputGUI($this->lng->txt('ps_password_special_chars_enabled'), 'password_special_chars_enabled');
     //$check->setOptionTitle($this->lng->txt('ps_password_special_chars_enabled'));
     $check->setInfo($this->lng->txt('ps_password_special_chars_enabled_info'));
     $this->form->addItem($check);
     $text = new ilNumberInputGUI($this->lng->txt('ps_password_min_length'), 'password_min_length');
     $text->setInfo($this->lng->txt('ps_password_min_length_info'));
     $text->setSize(1);
     $text->setMaxLength(2);
     $this->form->addItem($text);
     $text = new ilNumberInputGUI($this->lng->txt('ps_password_max_length'), 'password_max_length');
     $text->setInfo($this->lng->txt('ps_password_max_length_info'));
     $text->setSize(2);
     $text->setMaxLength(3);
     $this->form->addItem($text);
     $text = new ilNumberInputGUI($this->lng->txt('ps_password_uppercase_chars_num'), 'password_ucase_chars_num');
     $text->setInfo($this->lng->txt('ps_password_uppercase_chars_num_info'));
     $text->setMinValue(0);
     $text->setSize(2);
     $text->setMaxLength(3);
     $this->form->addItem($text);
     $text = new ilNumberInputGUI($this->lng->txt('ps_password_lowercase_chars_num'), 'password_lowercase_chars_num');
     $text->setInfo($this->lng->txt('ps_password_lowercase_chars_num_info'));
     $text->setMinValue(0);
     $text->setSize(2);
     $text->setMaxLength(3);
     $this->form->addItem($text);
     $text = new ilNumberInputGUI($this->lng->txt('ps_password_max_age'), 'password_max_age');
     $text->setInfo($this->lng->txt('ps_password_max_age_info'));
     $text->setSize(2);
     $text->setMaxLength(3);
     $this->form->addItem($text);
     // password assistance
     $cb = new ilCheckboxInputGUI($this->lng->txt("enable_password_assistance"), "password_assistance");
     $cb->setInfo($this->lng->txt("password_assistance_info"));
     $this->form->addItem($cb);
     $pass = new ilFormSectionHeaderGUI();
     $pass->setTitle($this->lng->txt('ps_security_protection'));
     $this->form->addItem($pass);
     $text = new ilNumberInputGUI($this->lng->txt('ps_login_max_attempts'), 'login_max_attempts');
     $text->setInfo($this->lng->txt('ps_login_max_attempts_info'));
     $text->setSize(1);
     $text->setMaxLength(2);
     $this->form->addItem($text);
     // prevent login from multiple pcs at the same time
     $objCb = new ilCheckboxInputGUI($this->lng->txt('ps_prevent_simultaneous_logins'), 'ps_prevent_simultaneous_logins');
     $objCb->setValue(1);
     $objCb->setInfo($this->lng->txt('ps_prevent_simultaneous_logins_info'));
     $this->form->addItem($objCb);
     $log = new ilFormSectionHeaderGUI();
     $log->setTitle($this->lng->txt('loginname_settings'));
     $this->form->addItem($log);
     $chbChangeLogin = new ilCheckboxInputGUI($this->lng->txt('allow_change_loginname'), 'allow_change_loginname');
     $chbChangeLogin->setValue(1);
     $this->form->addItem($chbChangeLogin);
     $chbCreateHistory = new ilCheckboxInputGUI($this->lng->txt('history_loginname'), 'create_history_loginname');
     $chbCreateHistory->setInfo($this->lng->txt('loginname_history_info'));
     $chbCreateHistory->setValue(1);
     $chbChangeLogin->addSubItem($chbCreateHistory);
     $chbReuseLoginnames = new ilCheckboxInputGUI($this->lng->txt('reuse_of_loginnames_contained_in_history'), 'reuse_of_loginnames');
     $chbReuseLoginnames->setValue(1);
     $chbReuseLoginnames->setInfo($this->lng->txt('reuse_of_loginnames_contained_in_history_info'));
     $chbChangeLogin->addSubItem($chbReuseLoginnames);
     $chbChangeBlockingTime = new ilNumberInputGUI($this->lng->txt('loginname_change_blocking_time'), 'loginname_change_blocking_time');
     $chbChangeBlockingTime->allowDecimals(true);
     $chbChangeBlockingTime->setSuffix($this->lng->txt('days'));
     $chbChangeBlockingTime->setInfo($this->lng->txt('loginname_change_blocking_time_info'));
     $chbChangeBlockingTime->setSize(10);
     $chbChangeBlockingTime->setMaxLength(10);
     $chbChangeLogin->addSubItem($chbChangeBlockingTime);
     $this->form->addCommandButton('saveGeneralSettings', $this->lng->txt('save'));
 }
 /**
  * init settings form
  *
  * @access protected
  */
 protected function initSettingsForm($a_mode = 'update')
 {
     if (is_object($this->form)) {
         return true;
     }
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $this->form = new ilPropertyFormGUI();
     $this->form->setFormAction($this->ctrl->getFormAction($this, 'settings'));
     $this->form->setTitle($this->lng->txt('ecs_connection_settings'));
     $ena = new ilCheckboxInputGUI($this->lng->txt('ecs_active'), 'active');
     $ena->setChecked($this->settings->isEnabled());
     $ena->setValue(1);
     $this->form->addItem($ena);
     $ser = new ilTextInputGUI($this->lng->txt('ecs_server_url'), 'server');
     $ser->setValue((string) $this->settings->getServer());
     $ser->setRequired(true);
     $this->form->addItem($ser);
     $pro = new ilSelectInputGUI($this->lng->txt('ecs_protocol'), 'protocol');
     // fixed to https
     #$pro->setOptions(array(ilECSSetting::PROTOCOL_HTTP => $this->lng->txt('http'),
     #		ilECSSetting::PROTOCOL_HTTPS => $this->lng->txt('https')));
     $pro->setOptions(array(ilECSSetting::PROTOCOL_HTTPS => 'HTTPS'));
     $pro->setValue($this->settings->getProtocol());
     $pro->setRequired(true);
     $this->form->addItem($pro);
     $por = new ilTextInputGUI($this->lng->txt('ecs_port'), 'port');
     $por->setSize(5);
     $por->setMaxLength(5);
     $por->setValue((string) $this->settings->getPort());
     $por->setRequired(true);
     $this->form->addItem($por);
     $tcer = new ilRadioGroupInputGUI($this->lng->txt('ecs_auth_type'), 'auth_type');
     $tcer->setValue($this->settings->getAuthType());
     $this->form->addItem($tcer);
     // Certificate based authentication
     $cert_based = new ilRadioOption($this->lng->txt('ecs_auth_type_cert'), ilECSSetting::AUTH_CERTIFICATE);
     $tcer->addOption($cert_based);
     $cli = new ilTextInputGUI($this->lng->txt('ecs_client_cert'), 'client_cert');
     $cli->setSize(60);
     $cli->setValue((string) $this->settings->getClientCertPath());
     $cli->setRequired(true);
     $cert_based->addSubItem($cli);
     $key = new ilTextInputGUI($this->lng->txt('ecs_cert_key'), 'key_path');
     $key->setSize(60);
     $key->setValue((string) $this->settings->getKeyPath());
     $key->setRequired(true);
     $cert_based->addSubItem($key);
     $cerp = new ilTextInputGUI($this->lng->txt('ecs_key_password'), 'key_password');
     $cerp->setSize(12);
     $cerp->setValue((string) $this->settings->getKeyPassword());
     $cerp->setInputType('password');
     $cerp->setRequired(true);
     $cert_based->addSubItem($cerp);
     $cer = new ilTextInputGUI($this->lng->txt('ecs_ca_cert'), 'ca_cert');
     $cer->setSize(60);
     $cer->setValue((string) $this->settings->getCACertPath());
     $cer->setRequired(true);
     $cert_based->addSubItem($cer);
     // Apache auth
     $apa_based = new ilRadioOption($this->lng->txt('ecs_auth_type_apache'), ilECSSetting::AUTH_APACHE);
     $tcer->addOption($apa_based);
     $user = new ilTextInputGUI($this->lng->txt('ecs_apache_user'), 'auth_user');
     $user->setSize(32);
     $user->setValue((string) $this->settings->getAuthUser());
     $user->setRequired(true);
     $apa_based->addSubItem($user);
     $pass = new ilPasswordInputGUI($this->lng->txt('ecs_apache_pass'), 'auth_pass');
     $pass->setRetype(false);
     $pass->setSize(16);
     $pass->setMaxLength(32);
     $pass->setValue((string) $this->settings->getAuthPass());
     $pass->setRequired(true);
     $apa_based->addSubItem($pass);
     $ser = new ilNonEditableValueGUI($this->lng->txt('cert_serial'));
     $ser->setValue($this->settings->getCertSerialNumber() ? $this->settings->getCertSerialNumber() : $this->lng->txt('ecs_no_value'));
     $cert_based->addSubItem($ser);
     $loc = new ilFormSectionHeaderGUI();
     $loc->setTitle($this->lng->txt('ecs_local_settings'));
     $this->form->addItem($loc);
     $pol = new ilDurationInputGUI($this->lng->txt('ecs_polling'), 'polling');
     $pol->setShowDays(false);
     $pol->setShowHours(false);
     $pol->setShowMinutes(true);
     $pol->setShowSeconds(true);
     $pol->setSeconds($this->settings->getPollingTimeSeconds());
     $pol->setMinutes($this->settings->getPollingTimeMinutes());
     $pol->setRequired(true);
     $pol->setInfo($this->lng->txt('ecs_polling_info'));
     $this->form->addItem($pol);
     $imp = new ilCustomInputGUI($this->lng->txt('ecs_import_id'));
     $imp->setRequired(true);
     $tpl = new ilTemplate('tpl.ecs_import_id_form.html', true, true, 'Services/WebServices/ECS');
     $tpl->setVariable('SIZE', 5);
     $tpl->setVariable('MAXLENGTH', 11);
     $tpl->setVariable('POST_VAR', 'import_id');
     $tpl->setVariable('PROPERTY_VALUE', $this->settings->getImportId());
     if ($this->settings->getImportId()) {
         $tpl->setVariable('COMPLETE_PATH', $this->buildPath($this->settings->getImportId()));
     }
     $imp->setHTML($tpl->get());
     $imp->setInfo($this->lng->txt('ecs_import_id_info'));
     $this->form->addItem($imp);
     $loc = new ilFormSectionHeaderGUI();
     $loc->setTitle($this->lng->txt('ecs_remote_user_settings'));
     $this->form->addItem($loc);
     $role = new ilSelectInputGUI($this->lng->txt('ecs_role'), 'global_role');
     $role->setOptions($this->prepareRoleSelect());
     $role->setValue($this->settings->getGlobalRole());
     $role->setInfo($this->lng->txt('ecs_global_role_info'));
     $role->setRequired(true);
     $this->form->addItem($role);
     $duration = new ilDurationInputGUI($this->lng->txt('ecs_account_duration'), 'duration');
     $duration->setInfo($this->lng->txt('ecs_account_duration_info'));
     $duration->setMonths($this->settings->getDuration());
     $duration->setShowSeconds(false);
     $duration->setShowMinutes(false);
     $duration->setShowHours(false);
     $duration->setShowDays(false);
     $duration->setShowMonths(true);
     $duration->setRequired(true);
     $this->form->addItem($duration);
     // Email recipients
     $loc = new ilFormSectionHeaderGUI();
     $loc->setTitle($this->lng->txt('ecs_notifications'));
     $this->form->addItem($loc);
     $rcp_user = new ilTextInputGUI($this->lng->txt('ecs_user_rcp'), 'user_recipients');
     $rcp_user->setValue((string) $this->settings->getUserRecipientsAsString());
     $rcp_user->setInfo($this->lng->txt('ecs_user_rcp_info'));
     $this->form->addItem($rcp_user);
     $rcp_econ = new ilTextInputGUI($this->lng->txt('ecs_econ_rcp'), 'econtent_recipients');
     $rcp_econ->setValue((string) $this->settings->getEContentRecipientsAsString());
     $rcp_econ->setInfo($this->lng->txt('ecs_econ_rcp_info'));
     $this->form->addItem($rcp_econ);
     $rcp_app = new ilTextInputGUI($this->lng->txt('ecs_approval_rcp'), 'approval_recipients');
     $rcp_app->setValue((string) $this->settings->getApprovalRecipientsAsString());
     $rcp_app->setInfo($this->lng->txt('ecs_approval_rcp_info'));
     $this->form->addItem($rcp_app);
     if ($a_mode == 'update') {
         $this->form->addCommandButton('update', $this->lng->txt('save'));
     } else {
         $this->form->addCommandButton('save', $this->lng->txt('save'));
     }
     $this->form->addCommandButton('overview', $this->lng->txt('cancel'));
 }
 /**
  * get html
  *
  * @access public
  * @param
  * @return
  */
 public function initForm()
 {
     $rec = new ilSelectInputGUI($this->lng->txt('cal_recurrences'), 'frequence');
     $rec->setRequired(true);
     $rec->setOptions(array(0 => $this->lng->txt('cal_no_recurrence'), ilCalendarRecurrence::FREQ_DAILY => $this->lng->txt('cal_rec_daily'), ilCalendarRecurrence::FREQ_WEEKLY => $this->lng->txt('cal_rec_weekly'), ilCalendarRecurrence::FREQ_MONTHLY => $this->lng->txt('cal_rec_monthly'), ilCalendarRecurrence::FREQ_YEARLY => $this->lng->txt('cal_rec_yearly')));
     $rec->setValue($this->recurrence->getFrequenceType());
     $this->form->addItem($rec);
     // DAILY part
     $interval = new ilTextInputGUI($this->lng->txt('interval'), 'interval');
     $interval->setSize(2);
     $interval->setMaxLength(3);
     $interval->setValue($this->recurrence->getInterval() ? $this->recurrence->getInterval() : 1);
     $interval->setInfo($this->lng->txt('interval_info'));
     $rec->addSubItem($interval);
     // Weekly
     $check = new ilCheckboxInputGUI($this->lng->txt('Su_short'), 'w_day[0]');
     $check->setChecked(true);
     $rec->addSubItem($check);
     $check = new ilCheckboxInputGUI($this->lng->txt('Mo_short'), 'w_day[1]');
     $check->setChecked(true);
     $rec->addSubItem($check);
     $check = new ilCheckboxInputGUI($this->lng->txt('Tu_short'), 'w_day[2]');
     $check->setChecked(true);
     $rec->addSubItem($check);
     $check = new ilCheckboxInputGUI($this->lng->txt('We_short'), 'w_day[3]');
     $check->setChecked(true);
     $rec->addSubItem($check);
     $check = new ilCheckboxInputGUI($this->lng->txt('Th_short'), 'w_day[4]');
     $check->setChecked(true);
     $rec->addSubItem($check);
     $check = new ilCheckboxInputGUI($this->lng->txt('Fr_short'), 'w_day[5]');
     $check->setChecked(true);
     $rec->addSubItem($check);
     $check = new ilCheckboxInputGUI($this->lng->txt('Sa_short'), 'w_day[6]');
     $check->setChecked(true);
     $rec->addSubItem($check);
 }
 /**
  * init auth mode determinitation form
  *
  * @access protected
  */
 protected function initAuthModeDetermination()
 {
     if (is_object($this->form)) {
         return true;
     }
     // Are there any authentication methods that support automatic determination ?
     include_once 'Services/Authentication/classes/class.ilAuthModeDetermination.php';
     $det = ilAuthModeDetermination::_getInstance();
     if ($det->getCountActiveAuthModes() <= 1) {
         return false;
     }
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $this->form = new ilPropertyFormGUI();
     $this->form->setFormAction($this->ctrl->getFormAction($this));
     $this->form->setTableWidth('100%');
     $this->form->setTitle($this->lng->txt('auth_auth_settings'));
     $this->form->addCommandButton('updateAuthModeDetermination', $this->lng->txt('save'));
     require_once 'Services/Captcha/classes/class.ilCaptchaUtil.php';
     $cap = new ilCheckboxInputGUI($this->lng->txt('adm_captcha_anonymous_short'), 'activate_captcha_anonym');
     $cap->setInfo($this->lng->txt('adm_captcha_anonymous_auth'));
     $cap->setValue(1);
     if (!ilCaptchaUtil::checkFreetype()) {
         $cap->setAlert(ilCaptchaUtil::getPreconditionsMessage());
     }
     $cap->setChecked(ilCaptchaUtil::isActiveForLogin());
     $this->form->addItem($cap);
     $header = new ilFormSectionHeaderGUI();
     $header->setTitle($this->lng->txt('auth_auth_mode_determination'));
     $this->form->addItem($header);
     $kind = new ilRadioGroupInputGUI($this->lng->txt('auth_kind_determination'), 'kind');
     $kind->setInfo($this->lng->txt('auth_mode_determination_info'));
     $kind->setValue($det->getKind());
     $kind->setRequired(true);
     $option_user = new ilRadioOption($this->lng->txt('auth_by_user'), 0);
     $kind->addOption($option_user);
     $option_determination = new ilRadioOption($this->lng->txt('auth_automatic'), 1);
     include_once 'Services/Authentication/classes/class.ilAuthUtils.php';
     $auth_sequenced = $det->getAuthModeSequence();
     $counter = 1;
     foreach ($auth_sequenced as $auth_mode) {
         switch ($auth_mode) {
             case AUTH_LDAP:
                 $text = $this->lng->txt('auth_ldap');
                 break;
             case AUTH_RADIUS:
                 $text = $this->lng->txt('auth_radius');
                 break;
             case AUTH_LOCAL:
                 $text = $this->lng->txt('auth_local');
                 break;
             case AUTH_SOAP:
                 $text = $this->lng->txt('auth_soap');
                 break;
             case AUTH_APACHE:
                 $text = $this->lng->txt('auth_apache');
                 break;
                 // begin-patch auth_plugin
             // begin-patch auth_plugin
             default:
                 foreach (ilAuthUtils::getAuthPlugins() as $pl) {
                     $option = $pl->getMultipleAuthModeOptions($auth_mode);
                     $text = $option[$auth_mode]['txt'];
                 }
                 break;
                 // end-patch auth_plugin
         }
         $pos = new ilTextInputGUI($text, 'position[' . $auth_mode . ']');
         $pos->setValue($counter++);
         $pos->setSize(1);
         $pos->setMaxLength(1);
         $option_determination->addSubItem($pos);
     }
     $kind->addOption($option_determination);
     $this->form->addItem($kind);
     return true;
 }
示例#17
0
 /**
  * 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;
 }
 private function initHTTPSForm()
 {
     global $ilCtrl, $lng;
     $this->setServerInfoSubTabs('adm_https');
     $lng->loadLanguageModule('ps');
     include_once './Services/PrivacySecurity/classes/class.ilSecuritySettings.php';
     $security = ilSecuritySettings::_getInstance();
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setTitle($lng->txt("adm_https"));
     $form->setFormAction($ilCtrl->getFormAction($this, 'saveHTTPS'));
     $check2 = new ilCheckboxInputGUI($lng->txt('activate_https'), 'https_enabled');
     $check2->setChecked($security->isHTTPSEnabled() ? 1 : 0);
     $check2->setValue(1);
     $form->addItem($check2);
     // save and cancel commands
     $form->addCommandButton('saveHTTPS', $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;
 }
 /**
  * Init form settings
  */
 protected function dInitFormTreeSettings(ilPropertyFormGUI $form = null)
 {
     include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSMappingUtils.php';
     include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
     if ($form instanceof ilPropertyFormGUI) {
         return $form;
     }
     include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignment.php';
     $assignment = new ilECSNodeMappingAssignment($this->getServer()->getServerId(), $this->getMid(), (int) $_REQUEST['tid'], 0);
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this, 'dEditTree'));
     $form->setTitle($this->lng->txt('general_settings'));
     $form->addCommandButton('dUpdateTreeSettings', $this->lng->txt('save'));
     $form->addCommandButton('dTrees', $this->lng->txt('cancel'));
     $form->setTableWidth('30%');
     // CMS id (readonly)
     include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
     $cmsid = new ilNumberInputGUI($this->lng->txt('ecs_cms_id'), 'cmsid');
     $cmsid->setValue(ilECSCmsData::lookupCmsId(ilECSCmsTree::lookupRootId((int) $_REQUEST['tid'])));
     $cmsid->setDisabled(true);
     $cmsid->setSize(7);
     $cmsid->setMaxLength(12);
     $form->addItem($cmsid);
     $mapping_status = ilECSMappingUtils::lookupMappingStatus($this->getServer()->getServerId(), $this->getMid(), (int) $_REQUEST['tid']);
     $mapping_advanced = $mapping_status != ilECSMappingUtils::MAPPED_MANUAL ? true : false;
     // Status (readonly)
     $status = new ilNonEditableValueGUI($this->lng->txt('status'), '');
     $status->setValue(ilECSMappingUtils::mappingStatusToString($mapping_status));
     $form->addItem($status);
     // title update
     $title = new ilCheckboxInputGUI($this->lng->txt('ecs_title_updates'), 'title');
     $title->setValue(1);
     $title->setChecked($assignment->isTitleUpdateEnabled());
     #$title->setInfo($this->lng->txt('ecs_title_update_info'));
     $form->addItem($title);
     $position = new ilCheckboxInputGUI($this->lng->txt('ecs_position_updates'), 'position');
     $position->setDisabled(!$mapping_advanced);
     $position->setChecked($mapping_advanced && $assignment->isPositionUpdateEnabled());
     $position->setValue(1);
     #$position->setInfo($this->lng->txt('ecs_position_update_info'));
     $form->addItem($position);
     $tree = new ilCheckboxInputGUI($this->lng->txt('ecs_tree_updates'), 'tree');
     $tree->setDisabled(!$mapping_advanced);
     $tree->setChecked($mapping_advanced && $assignment->isTreeUpdateEnabled());
     $tree->setValue(1);
     #$tree->setInfo($this->lng->txt('ecs_tree_update_info'));
     $form->addItem($tree);
     return $form;
 }
示例#21
0
 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 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 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;
 }
 private function buildForm()
 {
     require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->addCommandButton(self::CMD_SAVE_FORM, $this->lng->txt("save"));
     $form->setTableWidth("100%");
     $form->setId("test_properties");
     if (!$this->settingsTemplate || $this->formShowGeneralSection($this->settingsTemplate->getSettings())) {
         // general properties
         $header = new ilFormSectionHeaderGUI();
         $header->setTitle($this->lng->txt("tst_general_properties"));
         $form->addItem($header);
     }
     // title & description (meta data)
     include_once 'Services/MetaData/classes/class.ilMD.php';
     $md_obj = new ilMD($this->testOBJ->getId(), 0, "tst");
     $md_section = $md_obj->getGeneral();
     $title = new ilTextInputGUI($this->lng->txt("title"), "title");
     $title->setRequired(true);
     $title->setValue($md_section->getTitle());
     $form->addItem($title);
     $ids = $md_section->getDescriptionIds();
     if ($ids) {
         $desc_obj = $md_section->getDescription(array_pop($ids));
         $desc = new ilTextAreaInputGUI($this->lng->txt("description"), "description");
         $desc->setCols(50);
         $desc->setRows(4);
         $desc->setValue($desc_obj->getDescription());
         $form->addItem($desc);
     }
     // anonymity
     $anonymity = new ilRadioGroupInputGUI($this->lng->txt('tst_anonymity'), 'anonymity');
     if ($this->testOBJ->participantDataExist()) {
         $anonymity->setDisabled(true);
     }
     $rb = new ilRadioOption($this->lng->txt('tst_anonymity_no_anonymization'), 0);
     $anonymity->addOption($rb);
     $rb = new ilRadioOption($this->lng->txt('tst_anonymity_anonymous_test'), 1);
     $anonymity->addOption($rb);
     $anonymity->setValue((int) $this->testOBJ->getAnonymity());
     $form->addItem($anonymity);
     // test mode (question set type)
     $questSetType = new ilRadioGroupInputGUI($this->lng->txt("tst_question_set_type"), 'question_set_type');
     $questSetTypeFixed = new ilRadioOption($this->lng->txt("tst_question_set_type_fixed"), ilObjTest::QUESTION_SET_TYPE_FIXED, $this->lng->txt("tst_question_set_type_fixed_desc"));
     $questSetType->addOption($questSetTypeFixed);
     $questSetTypeRandom = new ilRadioOption($this->lng->txt("tst_question_set_type_random"), ilObjTest::QUESTION_SET_TYPE_RANDOM, $this->lng->txt("tst_question_set_type_random_desc"));
     $questSetType->addOption($questSetTypeRandom);
     $questSetTypeContinues = new ilRadioOption($this->lng->txt("tst_question_set_type_dynamic"), ilObjTest::QUESTION_SET_TYPE_DYNAMIC, $this->lng->txt("tst_question_set_type_dynamic_desc"));
     $questSetType->addOption($questSetTypeContinues);
     $questSetType->setValue($this->testOBJ->getQuestionSetType());
     if ($this->testOBJ->participantDataExist()) {
         $questSetType->setDisabled(true);
     }
     $form->addItem($questSetType);
     // pool usage
     $pool_usage = new ilCheckboxInputGUI($this->lng->txt("test_question_pool_usage"), "use_pool");
     $pool_usage->setValue(1);
     $pool_usage->setChecked($this->testOBJ->getPoolUsage());
     $form->addItem($pool_usage);
     // enable_archiving
     $enable_archiving = new ilCheckboxInputGUI($this->lng->txt('test_enable_archiving'), 'enable_archiving');
     $enable_archiving->setValue(1);
     $enable_archiving->setChecked($this->testOBJ->getEnableArchiving());
     $form->addItem($enable_archiving);
     // activation/availability  (no template support yet)
     include_once "Services/Object/classes/class.ilObjectActivation.php";
     $this->lng->loadLanguageModule('rep');
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('rep_activation_availability'));
     $form->addItem($section);
     // additional info only with multiple references
     $act_obj_info = $act_ref_info = "";
     if (sizeof(ilObject::_getAllReferences($this->testOBJ->getId())) > 1) {
         $act_obj_info = ' ' . $this->lng->txt('rep_activation_online_object_info');
         $act_ref_info = $this->lng->txt('rep_activation_access_ref_info');
     }
     $online = new ilCheckboxInputGUI($this->lng->txt('rep_activation_online'), 'online');
     $online->setChecked($this->testOBJ->isOnline());
     $online->setInfo($this->lng->txt('tst_activation_online_info') . $act_obj_info);
     $form->addItem($online);
     $act_type = new ilRadioGroupInputGUI($this->lng->txt('rep_activation_access'), 'activation_type');
     $act_type->setInfo($act_ref_info);
     $act_type->setValue($this->testOBJ->isActivationLimited() ? ilObjectActivation::TIMINGS_ACTIVATION : ilObjectActivation::TIMINGS_DEACTIVATED);
     $opt = new ilRadioOption($this->lng->txt('rep_visibility_limitless'), ilObjectActivation::TIMINGS_DEACTIVATED);
     $opt->setInfo($this->lng->txt('tst_availability_limitless_info'));
     $act_type->addOption($opt);
     $opt = new ilRadioOption($this->lng->txt('rep_visibility_until'), ilObjectActivation::TIMINGS_ACTIVATION);
     $opt->setInfo($this->lng->txt('tst_availability_until_info'));
     $this->tpl->addJavaScript('./Services/Form/js/date_duration.js');
     include_once "Services/Form/classes/class.ilDateDurationInputGUI.php";
     $dur = new ilDateDurationInputGUI("", "access_period");
     $dur->setShowTime(true);
     $date = $this->testOBJ->getActivationStartingTime();
     $dur->setStart(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
     $dur->setStartText($this->lng->txt('rep_activation_limited_start'));
     $date = $this->testOBJ->getActivationEndingTime();
     $dur->setEnd(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
     $dur->setEndText($this->lng->txt('rep_activation_limited_end'));
     $opt->addSubItem($dur);
     $visible = new ilCheckboxInputGUI($this->lng->txt('rep_activation_limited_visibility'), 'activation_visibility');
     $visible->setInfo($this->lng->txt('tst_activation_limited_visibility_info'));
     $visible->setChecked($this->testOBJ->getActivationVisibility());
     $opt->addSubItem($visible);
     $act_type->addOption($opt);
     $form->addItem($act_type);
     if (!$this->settingsTemplate || $this->formShowBeginningEndingInformation($this->settingsTemplate->getSettings())) {
         // general properties
         $header = new ilFormSectionHeaderGUI();
         $header->setTitle($this->lng->txt("tst_beginning_ending_information"));
         $form->addItem($header);
     }
     // introduction
     $intro = new ilTextAreaInputGUI($this->lng->txt("tst_introduction"), "introduction");
     $intro->setValue($this->testOBJ->prepareTextareaOutput($this->testOBJ->getIntroduction()));
     $intro->setRows(10);
     $intro->setCols(80);
     $intro->setUseRte(TRUE);
     $intro->addPlugin("latex");
     $intro->addButton("latex");
     $intro->setRTESupport($this->testOBJ->getId(), "tst", "assessment");
     $intro->setRteTagSet('full');
     $intro->setInfo($this->lng->txt('intro_desc'));
     // showinfo
     $showinfo = new ilCheckboxInputGUI('', "showinfo");
     $showinfo->setValue(1);
     $showinfo->setChecked($this->testOBJ->getShowInfo());
     $showinfo->setOptionTitle($this->lng->txt("showinfo"));
     $showinfo->setInfo($this->lng->txt("showinfo_desc"));
     $intro->addSubItem($showinfo);
     $form->addItem($intro);
     // final statement
     $finalstatement = new ilTextAreaInputGUI($this->lng->txt("final_statement"), "finalstatement");
     $finalstatement->setValue($this->testOBJ->prepareTextareaOutput($this->testOBJ->getFinalStatement()));
     $finalstatement->setRows(10);
     $finalstatement->setCols(80);
     $finalstatement->setUseRte(TRUE);
     $finalstatement->addPlugin("latex");
     $finalstatement->addButton("latex");
     $finalstatement->setRTESupport($this->testOBJ->getId(), "tst", "assessment");
     $finalstatement->setRteTagSet('full');
     // show final statement
     $showfinal = new ilCheckboxInputGUI('', "showfinalstatement");
     $showfinal->setValue(1);
     $showfinal->setChecked($this->testOBJ->getShowFinalStatement());
     $showfinal->setOptionTitle($this->lng->txt("final_statement_show"));
     $showfinal->setInfo($this->lng->txt("final_statement_show_desc"));
     $finalstatement->addSubItem($showfinal);
     $form->addItem($finalstatement);
     // examview
     $enable_examview = new ilCheckboxInputGUI($this->lng->txt("enable_examview"), 'enable_examview');
     $enable_examview->setValue(1);
     $enable_examview->setChecked($this->testOBJ->getEnableExamview());
     $enable_examview->setInfo($this->lng->txt("enable_examview_desc"));
     $show_examview_html = new ilCheckboxInputGUI('', 'show_examview_html');
     $show_examview_html->setValue(1);
     $show_examview_html->setChecked($this->testOBJ->getShowExamviewHtml());
     $show_examview_html->setOptionTitle($this->lng->txt("show_examview_html"));
     $show_examview_html->setInfo($this->lng->txt("show_examview_html_desc"));
     $enable_examview->addSubItem($show_examview_html);
     $show_examview_pdf = new ilCheckboxInputGUI('', 'show_examview_pdf');
     $show_examview_pdf->setValue(1);
     $show_examview_pdf->setChecked($this->testOBJ->getShowExamviewPdf());
     $show_examview_pdf->setOptionTitle($this->lng->txt("show_examview_pdf"));
     $show_examview_pdf->setInfo($this->lng->txt("show_examview_pdf_desc"));
     $enable_examview->addSubItem($show_examview_pdf);
     $form->addItem($enable_examview);
     if (!$this->settingsTemplate || $this->formShowSessionSection($this->settingsTemplate->getSettings())) {
         // session properties
         $sessionheader = new ilFormSectionHeaderGUI();
         $sessionheader->setTitle($this->lng->txt("tst_session_settings"));
         $form->addItem($sessionheader);
     }
     // max. number of passes
     $nr_of_tries = new ilTextInputGUI($this->lng->txt("tst_nr_of_tries"), "nr_of_tries");
     $nr_of_tries->setSize(3);
     $nr_of_tries->setValue($this->testOBJ->getNrOfTries());
     $nr_of_tries->setRequired(true);
     $nr_of_tries->setSuffix($this->lng->txt("0_unlimited"));
     $total = $this->testOBJ->evalTotalPersons();
     if ($total) {
         $nr_of_tries->setDisabled(true);
     }
     $form->addItem($nr_of_tries);
     // enable max. processing time
     $processing = new ilCheckboxInputGUI($this->lng->txt("tst_processing_time"), "chb_processing_time");
     $processing->setValue(1);
     //$processing->setOptionTitle($this->lng->txt("enabled"));
     if ($this->settingsTemplate && $this->getTemplateSettingValue('chb_processing_time')) {
         $processing->setChecked(true);
     } else {
         $processing->setChecked($this->testOBJ->getEnableProcessingTime());
     }
     // max. processing time
     $processingtime = new ilDurationInputGUI('', 'processing_time');
     $ptime = $this->testOBJ->getProcessingTimeAsArray();
     $processingtime->setHours($ptime['hh']);
     $processingtime->setMinutes($ptime['mm']);
     $processingtime->setSeconds($ptime['ss']);
     $processingtime->setShowMonths(false);
     $processingtime->setShowDays(false);
     $processingtime->setShowHours(true);
     $processingtime->setShowMinutes(true);
     $processingtime->setShowSeconds(true);
     $processingtime->setInfo($this->lng->txt("tst_processing_time_desc"));
     $processing->addSubItem($processingtime);
     // reset max. processing time
     $resetprocessing = new ilCheckboxInputGUI('', "chb_reset_processing_time");
     $resetprocessing->setValue(1);
     $resetprocessing->setOptionTitle($this->lng->txt("tst_reset_processing_time"));
     $resetprocessing->setChecked($this->testOBJ->getResetProcessingTime());
     $resetprocessing->setInfo($this->lng->txt("tst_reset_processing_time_desc"));
     $processing->addSubItem($resetprocessing);
     $form->addItem($processing);
     // enable starting time
     $enablestartingtime = new ilCheckboxInputGUI($this->lng->txt("tst_starting_time"), "chb_starting_time");
     $enablestartingtime->setValue(1);
     //$enablestartingtime->setOptionTitle($this->lng->txt("enabled"));
     if ($this->settingsTemplate && $this->getTemplateSettingValue('chb_starting_time')) {
         $enablestartingtime->setChecked(true);
     } else {
         $enablestartingtime->setChecked(strlen($this->testOBJ->getStartingTime()));
     }
     // starting time
     $startingtime = new ilDateTimeInputGUI('', 'starting_time');
     $startingtime->setShowDate(true);
     $startingtime->setShowTime(true);
     if (strlen($this->testOBJ->getStartingTime())) {
         $startingtime->setDate(new ilDateTime($this->testOBJ->getStartingTime(), IL_CAL_TIMESTAMP));
     } else {
         $startingtime->setDate(new ilDateTime(time(), IL_CAL_UNIX));
     }
     $enablestartingtime->addSubItem($startingtime);
     $form->addItem($enablestartingtime);
     if ($this->testOBJ->participantDataExist()) {
         $enablestartingtime->setDisabled(true);
         $startingtime->setDisabled(true);
     }
     // enable ending time
     $enableendingtime = new ilCheckboxInputGUI($this->lng->txt("tst_ending_time"), "chb_ending_time");
     $enableendingtime->setValue(1);
     //$enableendingtime->setOptionTitle($this->lng->txt("enabled"));
     if ($this->settingsTemplate && $this->getTemplateSettingValue('chb_ending_time')) {
         $enableendingtime->setChecked(true);
     } else {
         $enableendingtime->setChecked(strlen($this->testOBJ->getEndingTime()));
     }
     // ending time
     $endingtime = new ilDateTimeInputGUI('', 'ending_time');
     $endingtime->setShowDate(true);
     $endingtime->setShowTime(true);
     if (strlen($this->testOBJ->getEndingTime())) {
         $endingtime->setDate(new ilDateTime($this->testOBJ->getEndingTime(), IL_CAL_TIMESTAMP));
     } else {
         $endingtime->setDate(new ilDateTime(time(), IL_CAL_UNIX));
     }
     $enableendingtime->addSubItem($endingtime);
     $form->addItem($enableendingtime);
     // test password
     $password = new ilTextInputGUI($this->lng->txt("tst_password"), "password");
     $password->setSize(20);
     $password->setValue($this->testOBJ->getPassword());
     $password->setInfo($this->lng->txt("tst_password_details"));
     $form->addItem($password);
     if (!$this->settingsTemplate || $this->formShowPresentationSection($this->settingsTemplate->getSettings())) {
         // sequence properties
         $seqheader = new ilFormSectionHeaderGUI();
         $seqheader->setTitle($this->lng->txt("tst_presentation_properties"));
         $form->addItem($seqheader);
     }
     // use previous answers
     $prevanswers = new ilCheckboxInputGUI($this->lng->txt("tst_use_previous_answers"), "chb_use_previous_answers");
     $prevanswers->setValue(1);
     $prevanswers->setChecked($this->testOBJ->getUsePreviousAnswers());
     $prevanswers->setInfo($this->lng->txt("tst_use_previous_answers_description"));
     $form->addItem($prevanswers);
     // force js
     $forcejs = new ilCheckboxInputGUI($this->lng->txt("forcejs_short"), "forcejs");
     $forcejs->setValue(1);
     $forcejs->setChecked($this->testOBJ->getForceJS());
     $forcejs->setOptionTitle($this->lng->txt("forcejs"));
     $forcejs->setInfo($this->lng->txt("forcejs_desc"));
     $form->addItem($forcejs);
     // question title output
     $title_output = new ilRadioGroupInputGUI($this->lng->txt("tst_title_output"), "title_output");
     $title_output->addOption(new ilRadioOption($this->lng->txt("tst_title_output_full"), 0, ''));
     $title_output->addOption(new ilRadioOption($this->lng->txt("tst_title_output_hide_points"), 1, ''));
     $title_output->addOption(new ilRadioOption($this->lng->txt("tst_title_output_no_title"), 2, ''));
     $title_output->setValue($this->testOBJ->getTitleOutput());
     $title_output->setInfo($this->lng->txt("tst_title_output_description"));
     $form->addItem($title_output);
     // selector for unicode characters
     global $ilSetting;
     if ($ilSetting->get('char_selector_availability') > 0) {
         require_once 'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
         $char_selector = new ilCharSelectorGUI(ilCharSelectorConfig::CONTEXT_TEST);
         $char_selector->getConfig()->setAvailability($this->testOBJ->getCharSelectorAvailability());
         $char_selector->getConfig()->setDefinition($this->testOBJ->getCharSelectorDefinition());
         $char_selector->addFormProperties($form);
         $char_selector->setFormValues($form);
     }
     // Autosave
     $autosave_output = new ilCheckboxInputGUI($this->lng->txt('autosave'), 'autosave');
     $autosave_output->setValue(1);
     $autosave_output->setChecked($this->testOBJ->getAutosave());
     $autosave_output->setInfo($this->lng->txt('autosave_info'));
     $autosave_interval = new ilTextInputGUI($this->lng->txt('autosave_ival'), 'autosave_ival');
     $autosave_interval->setSize(10);
     $autosave_interval->setValue($this->testOBJ->getAutosaveIval() / 1000);
     $autosave_interval->setInfo($this->lng->txt('autosave_ival_info'));
     $autosave_output->addSubItem($autosave_interval);
     $form->addItem($autosave_output);
     if (!$this->settingsTemplate || $this->formShowSequenceSection($this->settingsTemplate->getSettings())) {
         // sequence properties
         $seqheader = new ilFormSectionHeaderGUI();
         $seqheader->setTitle($this->lng->txt("tst_sequence_properties"));
         $form->addItem($seqheader);
     }
     // postpone questions
     $postpone = new ilCheckboxInputGUI($this->lng->txt("tst_postpone"), "chb_postpone");
     $postpone->setValue(1);
     $postpone->setChecked($this->testOBJ->getSequenceSettings());
     $postpone->setInfo($this->lng->txt("tst_postpone_description"));
     $form->addItem($postpone);
     // shuffle questions
     $shuffle = new ilCheckboxInputGUI($this->lng->txt("tst_shuffle_questions"), "chb_shuffle_questions");
     $shuffle->setValue(1);
     $shuffle->setChecked($this->testOBJ->getShuffleQuestions());
     $shuffle->setInfo($this->lng->txt("tst_shuffle_questions_description"));
     $form->addItem($shuffle);
     // show list of questions
     $list_of_questions = new ilCheckboxInputGUI($this->lng->txt("tst_show_summary"), "list_of_questions");
     //$list_of_questions->setOptionTitle($this->lng->txt("tst_show_summary"));
     $list_of_questions->setValue(1);
     $list_of_questions->setChecked($this->testOBJ->getListOfQuestions());
     $list_of_questions->setInfo($this->lng->txt("tst_show_summary_description"));
     $list_of_questions_options = new ilCheckboxGroupInputGUI('', "list_of_questions_options");
     $list_of_questions_options->addOption(new ilCheckboxOption($this->lng->txt("tst_list_of_questions_start"), 'chb_list_of_questions_start', ''));
     $list_of_questions_options->addOption(new ilCheckboxOption($this->lng->txt("tst_list_of_questions_end"), 'chb_list_of_questions_end', ''));
     $list_of_questions_options->addOption(new ilCheckboxOption($this->lng->txt("tst_list_of_questions_with_description"), 'chb_list_of_questions_with_description', ''));
     $values = array();
     if ($this->testOBJ->getListOfQuestionsStart()) {
         array_push($values, 'chb_list_of_questions_start');
     }
     if ($this->testOBJ->getListOfQuestionsEnd()) {
         array_push($values, 'chb_list_of_questions_end');
     }
     if ($this->testOBJ->getListOfQuestionsDescription()) {
         array_push($values, 'chb_list_of_questions_with_description');
     }
     $list_of_questions_options->setValue($values);
     $list_of_questions->addSubItem($list_of_questions_options);
     $form->addItem($list_of_questions);
     // show question marking
     $marking = new ilCheckboxInputGUI($this->lng->txt("question_marking"), "chb_show_marker");
     $marking->setValue(1);
     $marking->setChecked($this->testOBJ->getShowMarker());
     $marking->setInfo($this->lng->txt("question_marking_description"));
     $form->addItem($marking);
     // show suspend test
     $cancel = new ilCheckboxInputGUI($this->lng->txt("tst_show_cancel"), "chb_show_cancel");
     $cancel->setValue(1);
     $cancel->setChecked($this->testOBJ->getShowCancel());
     $cancel->setInfo($this->lng->txt("tst_show_cancel_description"));
     $form->addItem($cancel);
     if (!$this->settingsTemplate || $this->formShowNotificationSection($this->settingsTemplate->getSettings())) {
         // notifications
         $notifications = new ilFormSectionHeaderGUI();
         $notifications->setTitle($this->lng->txt("tst_mail_notification"));
         $form->addItem($notifications);
     }
     // mail notification
     $mailnotification = new ilRadioGroupInputGUI($this->lng->txt("tst_finish_notification"), "mailnotification");
     $mailnotification->addOption(new ilRadioOption($this->lng->txt("tst_finish_notification_no"), 0, ''));
     $mailnotification->addOption(new ilRadioOption($this->lng->txt("tst_finish_notification_simple"), 1, ''));
     $mailnotification->addOption(new ilRadioOption($this->lng->txt("tst_finish_notification_advanced"), 2, ''));
     $mailnotification->setValue($this->testOBJ->getMailNotification());
     $form->addItem($mailnotification);
     $mailnottype = new ilCheckboxInputGUI('', "mailnottype");
     $mailnottype->setValue(1);
     $mailnottype->setOptionTitle($this->lng->txt("mailnottype"));
     $mailnottype->setChecked($this->testOBJ->getMailNotificationType());
     $form->addItem($mailnottype);
     /* This options always active (?) */
     $highscore_head = new ilFormSectionHeaderGUI();
     $highscore_head->setTitle($this->lng->txt("tst_highscore_options"));
     $form->addItem($highscore_head);
     $highscore = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_enabled"), "highscore_enabled");
     $highscore->setValue(1);
     $highscore->setChecked($this->testOBJ->getHighscoreEnabled());
     $highscore->setInfo($this->lng->txt("tst_highscore_description"));
     $form->addItem($highscore);
     $highscore_anon = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_anon"), "highscore_anon");
     $highscore_anon->setValue(1);
     $highscore_anon->setChecked($this->testOBJ->getHighscoreAnon());
     $highscore_anon->setInfo($this->lng->txt("tst_highscore_anon_description"));
     $highscore->addSubItem($highscore_anon);
     $highscore_achieved_ts = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_achieved_ts"), "highscore_achieved_ts");
     $highscore_achieved_ts->setValue(1);
     $highscore_achieved_ts->setChecked($this->testOBJ->getHighscoreAchievedTS());
     $highscore_achieved_ts->setInfo($this->lng->txt("tst_highscore_achieved_ts_description"));
     $highscore->addSubItem($highscore_achieved_ts);
     $highscore_score = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_score"), "highscore_score");
     $highscore_score->setValue(1);
     $highscore_score->setChecked($this->testOBJ->getHighscoreScore());
     $highscore_score->setInfo($this->lng->txt("tst_highscore_score_description"));
     $highscore->addSubItem($highscore_score);
     $highscore_percentage = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_percentage"), "highscore_percentage");
     $highscore_percentage->setValue(1);
     $highscore_percentage->setChecked($this->testOBJ->getHighscorePercentage());
     $highscore_percentage->setInfo($this->lng->txt("tst_highscore_percentage_description"));
     $highscore->addSubItem($highscore_percentage);
     $highscore_hints = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_hints"), "highscore_hints");
     $highscore_hints->setValue(1);
     $highscore_hints->setChecked($this->testOBJ->getHighscoreHints());
     $highscore_hints->setInfo($this->lng->txt("tst_highscore_hints_description"));
     $highscore->addSubItem($highscore_hints);
     $highscore_wtime = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_wtime"), "highscore_wtime");
     $highscore_wtime->setValue(1);
     $highscore_wtime->setChecked($this->testOBJ->getHighscoreWTime());
     $highscore_wtime->setInfo($this->lng->txt("tst_highscore_wtime_description"));
     $highscore->addSubItem($highscore_wtime);
     $highscore_own_table = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_own_table"), "highscore_own_table");
     $highscore_own_table->setValue(1);
     $highscore_own_table->setChecked($this->testOBJ->getHighscoreOwnTable());
     $highscore_own_table->setInfo($this->lng->txt("tst_highscore_own_table_description"));
     $highscore->addSubItem($highscore_own_table);
     $highscore_top_table = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_top_table"), "highscore_top_table");
     $highscore_top_table->setValue(1);
     $highscore_top_table->setChecked($this->testOBJ->getHighscoreTopTable());
     $highscore_top_table->setInfo($this->lng->txt("tst_highscore_top_table_description"));
     $highscore->addSubItem($highscore_top_table);
     $highscore_top_num = new ilTextInputGUI($this->lng->txt("tst_highscore_top_num"), "highscore_top_num");
     $highscore_top_num->setSize(4);
     $highscore_top_num->setSuffix($this->lng->txt("tst_highscore_top_num_unit"));
     $highscore_top_num->setValue($this->testOBJ->getHighscoreTopNum());
     $highscore_top_num->setInfo($this->lng->txt("tst_highscore_top_num_description"));
     $highscore->addSubItem($highscore_top_num);
     if (!$this->settingsTemplate || $this->formShowTestExecutionSection($this->settingsTemplate->getSettings())) {
         $testExecution = new ilFormSectionHeaderGUI();
         $testExecution->setTitle($this->lng->txt("tst_test_execution"));
         $form->addItem($testExecution);
     }
     // kiosk mode
     $kiosk = new ilCheckboxInputGUI($this->lng->txt("kiosk"), "kiosk");
     $kiosk->setValue(1);
     $kiosk->setChecked($this->testOBJ->getKioskMode());
     $kiosk->setInfo($this->lng->txt("kiosk_description"));
     // kiosk mode options
     $kiosktitle = new ilCheckboxGroupInputGUI($this->lng->txt("kiosk_options"), "kiosk_options");
     $kiosktitle->addOption(new ilCheckboxOption($this->lng->txt("kiosk_show_title"), 'kiosk_title', ''));
     $kiosktitle->addOption(new ilCheckboxOption($this->lng->txt("kiosk_show_participant"), 'kiosk_participant', ''));
     $kiosktitle->addOption(new ilCheckboxOption($this->lng->txt('examid_in_kiosk'), 'examid_in_kiosk'));
     $values = array();
     if ($this->testOBJ->getShowKioskModeTitle()) {
         array_push($values, 'kiosk_title');
     }
     if ($this->testOBJ->getShowKioskModeParticipant()) {
         array_push($values, 'kiosk_participant');
     }
     if ($this->testOBJ->getExamidInKiosk()) {
         array_push($values, 'examid_in_kiosk');
     }
     $kiosktitle->setValue($values);
     $kiosktitle->setInfo($this->lng->txt("kiosk_options_desc"));
     $kiosk->addSubItem($kiosktitle);
     $form->addItem($kiosk);
     $redirection_mode = $this->testOBJ->getRedirectionMode();
     $rm_enabled = new ilCheckboxInputGUI($this->lng->txt('redirect_after_finishing_tst'), 'redirection_enabled');
     $rm_enabled->setChecked($redirection_mode == '0' ? false : true);
     $radio_rm = new ilRadioGroupInputGUI($this->lng->txt('redirect_after_finishing_tst'), 'redirection_mode');
     $always = new ilRadioOption($this->lng->txt('tst_results_access_always'), REDIRECT_ALWAYS);
     $radio_rm->addOption($always);
     $kiosk = new ilRadioOption($this->lng->txt('redirect_in_kiosk_mode'), REDIRECT_KIOSK);
     $radio_rm->addOption($kiosk);
     $radio_rm->setValue(in_array($redirection_mode, array(REDIRECT_ALWAYS, REDIRECT_KIOSK)) ? $redirection_mode : REDIRECT_ALWAYS);
     $rm_enabled->addSubItem($radio_rm);
     $redirection_url = new ilTextInputGUI($this->lng->txt('redirection_url'), 'redirection_url');
     $redirection_url->setValue((string) $this->testOBJ->getRedirectionUrl());
     $redirection_url->setRequired(true);
     $rm_enabled->addSubItem($redirection_url);
     $form->addItem($rm_enabled);
     // Sign submission
     $sign_submission = $this->testOBJ->getSignSubmission();
     $sign_submission_enabled = new ilCheckboxInputGUI($this->lng->txt('sign_submission'), 'sign_submission');
     $sign_submission_enabled->setChecked($sign_submission);
     $sign_submission_enabled->setInfo($this->lng->txt('sign_submission_info'));
     $form->addItem($sign_submission_enabled);
     if (!$this->settingsTemplate || $this->formShowParticipantSection($this->settingsTemplate->getSettings())) {
         // participants properties
         $restrictions = new ilFormSectionHeaderGUI();
         $restrictions->setTitle($this->lng->txt("tst_max_allowed_users"));
         $form->addItem($restrictions);
     }
     $fixedparticipants = new ilCheckboxInputGUI($this->lng->txt('participants_invitation'), "fixedparticipants");
     $fixedparticipants->setValue(1);
     $fixedparticipants->setChecked($this->testOBJ->getFixedParticipants());
     $fixedparticipants->setOptionTitle($this->lng->txt("tst_allow_fixed_participants"));
     $fixedparticipants->setInfo($this->lng->txt("participants_invitation_description"));
     $invited_users = $this->testOBJ->getInvitedUsers();
     if ($total && count($invited_users) == 0) {
         $fixedparticipants->setDisabled(true);
     }
     $form->addItem($fixedparticipants);
     // simultaneous users
     $simul = new ilTextInputGUI($this->lng->txt("tst_allowed_users"), "allowedUsers");
     $simul->setSize(3);
     $simul->setValue($this->testOBJ->getAllowedUsers() ? $this->testOBJ->getAllowedUsers() : '');
     $form->addItem($simul);
     // idle time
     $idle = new ilTextInputGUI($this->lng->txt("tst_allowed_users_time_gap"), "allowedUsersTimeGap");
     $idle->setSize(4);
     $idle->setSuffix($this->lng->txt("seconds"));
     $idle->setValue($this->testOBJ->getAllowedUsersTimeGap() ? $this->testOBJ->getAllowedUsersTimeGap() : '');
     $form->addItem($idle);
     // Edit ecs export settings
     include_once 'Modules/Test/classes/class.ilECSTestSettings.php';
     $ecs = new ilECSTestSettings($this->testOBJ);
     $ecs->addSettingsToForm($form, 'tst');
     // remove items when using template
     if ($this->settingsTemplate) {
         foreach ($this->settingsTemplate->getSettings() as $id => $item) {
             if ($item["hide"]) {
                 $form->removeItemByPostVar($id);
             }
         }
     }
     return $form;
 }
 /**
  * Init 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);
 }
 /**
  * Init form
  *
  * @param string $a_cmd
  * @return ilPropertyFormGUI
  */
 public function initForm($a_cmd = "")
 {
     global $ilCtrl, $lng;
     $lng->loadLanguageModule('crs');
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setFormAction($ilCtrl->getFormAction($this->parent_obj, $a_cmd));
     $form->setTarget('_blank');
     $form->setTitle($lng->txt('sess_gen_attendance_list'));
     $title = new ilTextInputGUI($lng->txt('title'), 'title');
     $title->setValue($this->title);
     $form->addItem($title);
     $desc = new ilTextInputGUI($lng->txt('description'), 'desc');
     $desc->setValue($this->description);
     $form->addItem($desc);
     if (sizeof($this->presets)) {
         $preset = new ilCheckboxGroupInputGUI($lng->txt('user_detail'), 'preset');
         $preset_value = array();
         foreach ($this->presets as $id => $item) {
             $preset->addOption(new ilCheckboxOption($item[0], $id));
             if ($item[1]) {
                 $preset_value[] = $id;
             }
         }
         $preset->setValue($preset_value);
         $form->addItem($preset);
     }
     $blank = new ilTextInputGUI($lng->txt('event_blank_columns'), 'blank');
     $blank->setMulti(true);
     $form->addItem($blank);
     if ($this->pre_blanks) {
         $blank->setValue($this->pre_blanks);
     }
     $part = new ilFormSectionHeaderGUI();
     $part->setTitle($lng->txt('event_participant_selection'));
     $form->addItem($part);
     // Admins
     $admin = new ilCheckboxInputGUI($lng->txt('event_tbl_admins'), 'show_admins');
     $admin->setOptionTitle($lng->txt('event_inc_admins'));
     $admin->setValue(1);
     $form->addItem($admin);
     // Tutors
     $tutor = new ilCheckboxInputGUI($lng->txt('event_tbl_tutors'), 'show_tutors');
     $tutor->setOptionTitle($lng->txt('event_inc_tutors'));
     $tutor->setValue(1);
     $form->addItem($tutor);
     // Members
     $member = new ilCheckboxInputGUI($lng->txt('event_tbl_members'), 'show_members');
     $member->setOptionTitle($lng->txt('event_inc_members'));
     $member->setValue(1);
     $member->setChecked(true);
     $form->addItem($member);
     $form->addCommandButton($a_cmd, $lng->txt('sess_print_attendance_list'));
     if ($this->id && $a_cmd) {
         include_once "Services/User/classes/class.ilUserFormSettings.php";
         $settings = new ilUserFormSettings($this->id);
         $settings->exportToForm($form);
     }
     return $form;
 }
 function linkChecker()
 {
     global $ilias, $ilUser, $tpl;
     $this->__initLinkChecker();
     $this->setTabs();
     $this->setContentSubTabs("link_check");
     require_once './Services/LinkChecker/classes/class.ilLinkCheckerTableGUI.php';
     $toolbar = new ilToolbarGUI();
     if ((bool) $ilias->getSetting('cron_web_resource_check')) {
         include_once './Services/LinkChecker/classes/class.ilLinkCheckNotify.php';
         include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
         $chb = new ilCheckboxInputGUI($this->lng->txt('link_check_message_a'), 'link_check_message');
         $chb->setValue(1);
         $chb->setChecked((bool) ilLinkCheckNotify::_getNotifyStatus($ilUser->getId(), $this->object->getId()));
         $chb->setOptionTitle($this->lng->txt('link_check_message_b'));
         $toolbar->addInputItem($chb);
         $toolbar->addFormButton($this->lng->txt('save'), 'saveLinkCheck');
         $toolbar->setFormAction($this->ctrl->getLinkTarget($this, 'saveLinkCheck'));
     }
     $tgui = new ilLinkCheckerTableGUI($this, 'linkChecker');
     $tgui->setLinkChecker($this->link_checker_obj)->setRowHandler($this)->setRefreshButton($this->lng->txt('refresh'), 'refreshLinkCheck');
     return $tpl->setContent($tgui->prepareHTML()->getHTML() . $toolbar->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());
 }
示例#29
0
 /**
  * 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"));
     }
 }
 public function populateQuestionSpecificFormPart(\ilPropertyFormGUI $form)
 {
     // shuffle
     $shuffle = new ilCheckboxInputGUI($this->lng->txt("shuffle_answers"), "shuffle");
     $shuffle->setValue(1);
     $shuffle->setChecked($this->object->getShuffle());
     $shuffle->setRequired(FALSE);
     $form->addItem($shuffle);
     if ($this->object->getId()) {
         $hidden = new ilHiddenInputGUI("", "ID");
         $hidden->setValue($this->object->getId());
         $form->addItem($hidden);
     }
     if (!$this->object->getSelfAssessmentEditingMode()) {
         $isSingleline = $this->object->lastChange == 0 && !array_key_exists('types', $_POST) ? $this->object->getMultilineAnswerSetting() ? false : true : $this->object->isSingleline;
         // Answer types
         $types = new ilSelectInputGUI($this->lng->txt("answer_types"), "types");
         $types->setRequired(false);
         $types->setValue($isSingleline ? 0 : 1);
         $types->setOptions(array(0 => $this->lng->txt('answers_singleline'), 1 => $this->lng->txt('answers_multiline')));
         $form->addItem($types);
     }
     if ($isSingleline) {
         // thumb size
         $thumb_size = new ilNumberInputGUI($this->lng->txt("thumb_size"), "thumb_size");
         $thumb_size->setMinValue(20);
         $thumb_size->setDecimals(0);
         $thumb_size->setSize(6);
         $thumb_size->setInfo($this->lng->txt('thumb_size_info'));
         $thumb_size->setValue($this->object->getThumbSize());
         $thumb_size->setRequired(false);
         $form->addItem($thumb_size);
         return $isSingleline;
     }
     return $isSingleline;
 }