protected function initForm()
 {
     $this->setFormAction($this->ctrl->getFormActionByClass('certCheckSignatureGUI', 'decryptSignature'));
     $te = new ilFormSectionHeaderGUI();
     $te->setTitle($this->pl->txt('signature_check'));
     $this->addItem($te);
     // signature
     $signature = new ilTextInputGUI($this->pl->txt('signature'), 'signature');
     $this->addItem($signature);
     $this->addCommandButton('decryptSignature', $this->lng->txt('send'));
 }
 /**
  * completes a given form object with the specific form properties
  * required by this question type
  * 
  * @access public
  * @param ilPropertyFormGUI $form
  */
 public function completeSpecificFormProperties(ilPropertyFormGUI $form)
 {
     $header = new ilFormSectionHeaderGUI();
     $header->setTitle($this->lng->txt('feedback_answers'));
     $form->addItem($header);
     if (!$this->questionOBJ->getSelfAssessmentEditingMode()) {
         foreach ($this->getAnswerOptionsByAnswerIndex() as $index => $answer) {
             $propertyLabel = $this->questionOBJ->prepareTextareaOutput($this->buildAnswerOptionLabel($index, $answer), true);
             $propertyPostVar = "feedback_answer_{$index}";
             $form->addItem($this->buildFeedbackContentFormProperty($propertyLabel, $propertyPostVar, $this->questionOBJ->isAdditionalContentEditingModePageObject()));
         }
     }
 }
 public function addToForm()
 {
     if ($this->getTitle()) {
         $section = new ilFormSectionHeaderGUI();
         $section->setTitle($this->getTitle());
         if ($this->getInfo()) {
             $section->setInfo($this->getInfo());
         }
         $this->getForm()->addItem($section);
     }
     $this->prepareElements();
     foreach ($this->elements as $element) {
         $element->addToForm();
     }
 }
 /**
  * completes a given form object with the specific form properties
  * required by this question type
  * 
  * (overwrites the method from ilAssMultiOptionQuestionFeedback, because of individual setting)
  * 
  * @access public
  * @param ilPropertyFormGUI $form
  */
 public function completeSpecificFormProperties(ilPropertyFormGUI $form)
 {
     $header = new ilFormSectionHeaderGUI();
     $header->setTitle($this->lng->txt('feedback_answers'));
     $form->addItem($header);
     if (!$this->questionOBJ->getSelfAssessmentEditingMode()) {
         require_once './Services/Form/classes/class.ilRadioGroupInputGUI.php';
         require_once './Services/Form/classes/class.ilRadioOption.php';
         $feedback = new ilRadioGroupInputGUI($this->lng->txt('feedback_setting'), 'feedback_setting');
         $feedback->addOption(new ilRadioOption($this->lng->txt('feedback_all'), 1), true);
         $feedback->addOption(new ilRadioOption($this->lng->txt('feedback_checked'), 2));
         $feedback->addOption(new ilRadioOption($this->lng->txt('feedback_correct'), 3));
         $form->addItem($feedback);
         foreach ($this->getAnswerOptionsByAnswerIndex() as $index => $answer) {
             $propertyLabel = $this->questionOBJ->prepareTextareaOutput($this->buildAnswerOptionLabel($index, $answer), true);
             $propertyPostVar = "feedback_answer_{$index}";
             $form->addItem($this->buildFeedbackContentFormProperty($propertyLabel, $propertyPostVar, $this->questionOBJ->isAdditionalContentEditingModePageObject()));
         }
     }
 }
示例#5
0
 /**
  * Init properties form.
  */
 protected function initEditCustomForm(ilPropertyFormGUI $a_form)
 {
     $a_form->setTitle($this->lng->txt("exc_edit_exercise"));
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('exc_passing_exc'));
     $a_form->addItem($section);
     // pass mode
     $radg = new ilRadioGroupInputGUI($this->lng->txt("exc_pass_mode"), "pass_mode");
     $op1 = new ilRadioOption($this->lng->txt("exc_pass_all"), "all", $this->lng->txt("exc_pass_all_info"));
     $radg->addOption($op1);
     $op2 = new ilRadioOption($this->lng->txt("exc_pass_minimum_nr"), "nr", $this->lng->txt("exc_pass_minimum_nr_info"));
     $radg->addOption($op2);
     // minimum number of assignments to pass
     $ni = new ilNumberInputGUI($this->lng->txt("exc_min_nr"), "pass_nr");
     $ni->setSize(4);
     $ni->setMaxLength(4);
     $ni->setRequired(true);
     include_once "./Modules/Exercise/classes/class.ilExAssignment.php";
     $mand = ilExAssignment::countMandatory($this->object->getId());
     $min = max($mand, 1);
     $ni->setMinValue($min, true);
     $ni->setInfo($this->lng->txt("exc_min_nr_info"));
     $op2->addSubItem($ni);
     $a_form->addItem($radg);
     // completion by submission
     $subcompl = new ilRadioGroupInputGUI($this->lng->txt("exc_passed_status_determination"), "completion_by_submission");
     $op1 = new ilRadioOption($this->lng->txt("exc_completion_by_tutor"), 0, "");
     $subcompl->addOption($op1);
     $op2 = new ilRadioOption($this->lng->txt("exc_completion_by_submission"), 1, $this->lng->txt("exc_completion_by_submission_info"));
     $subcompl->addOption($op2);
     $a_form->addItem($subcompl);
     /*$subcompl = new ilCheckboxInputGUI($this->lng->txt('exc_completion_by_submission'), 'completion_by_submission');
     		$subcompl->setInfo($this->lng->txt('exc_completion_by_submission_info'));
     		$subcompl->setValue(1);
     		$a_form->addItem($subcompl);*/
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('exc_publishing'));
     $a_form->addItem($section);
     // show submissions
     $cb = new ilCheckboxInputGUI($this->lng->txt("exc_show_submissions"), "show_submissions");
     $cb->setInfo($this->lng->txt("exc_show_submissions_info"));
     $a_form->addItem($cb);
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('exc_notification'));
     $a_form->addItem($section);
     // submission notifications
     $cbox = new ilCheckboxInputGUI($this->lng->txt("exc_submission_notification"), "notification");
     $cbox->setInfo($this->lng->txt("exc_submission_notification_info"));
     $a_form->addItem($cbox);
 }
示例#6
0
 /**
  * @param ilPropertyFormGUI $form
  * @return \ilPropertyFormGUI|void
  */
 public function populateAnswerSpecificFormPart(ilPropertyFormGUI $form)
 {
     $header = new ilFormSectionHeaderGUI();
     $header->setTitle($this->lng->txt("errors_section"));
     $form->addItem($header);
     include_once "./Modules/TestQuestionPool/classes/class.ilErrorTextWizardInputGUI.php";
     $errordata = new ilErrorTextWizardInputGUI($this->lng->txt("errors"), "errordata");
     $errordata->setKeyName($this->lng->txt('text_wrong'));
     $errordata->setValueName($this->lng->txt('text_correct'));
     $errordata->setValues($this->object->getErrorData());
     $form->addItem($errordata);
     // points for wrong selection
     $points_wrong = new ilNumberInputGUI($this->lng->txt("points_wrong"), "points_wrong");
     $points_wrong->allowDecimals(true);
     $points_wrong->setValue($this->object->getPointsWrong());
     $points_wrong->setInfo($this->lng->txt("points_wrong_info"));
     $points_wrong->setSize(6);
     $points_wrong->setRequired(true);
     $form->addItem($points_wrong);
     return $form;
 }
 protected function initSettingsForm($a_mode = 'create')
 {
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $this->form_gui = new ilPropertyFormGUI();
     $this->form_gui->setTableWidth('600');
     if ($a_mode == 'create') {
         $this->form_gui->setTitle($this->lng->txt('icrs_new'));
     } else {
         $this->form_gui->setTitle($this->lng->txt('icrs_edit'));
     }
     $this->form_gui->setTitleIcon(ilUtil::getTypeIconPath('icrs', 0));
     // Title
     $text_input = new ilTextInputGUI($this->lng->txt('title'), 'title');
     $text_input->setRequired(true);
     $this->form_gui->addItem($text_input);
     // Description
     $text_area = new ilTextAreaInputGUI($this->lng->txt('desc'), 'desc');
     $this->form_gui->addItem($text_area);
     // Access
     $text_area = new ilCheckboxInputGUI($this->lng->txt('online'), 'activated');
     $this->form_gui->addItem($text_area);
     // AKClassValues
     if ($this->ilias->getSetting('ilinc_akclassvalues_active')) {
         $section_header = new ilFormSectionHeaderGUI();
         $section_header->setTitle($this->lng->txt('akclassvalues'));
         $this->form_gui->addItem($section_header);
         $text_input = new ilTextInputGUI($this->lng->txt('akclassvalue1'), 'akclassvalue1');
         if ($this->ilias->getSetting('ilinc_akclassvalues_required')) {
             $text_input->setRequired(true);
         }
         $this->form_gui->addItem($text_input);
         $text_input = new ilTextInputGUI($this->lng->txt('akclassvalue2'), 'akclassvalue2');
         $this->form_gui->addItem($text_input);
     }
     if ($this->call_by_reference) {
         $this->ctrl->setParameter($this, 'obj_id', $this->obj_id);
     }
     // save and cancel commands
     if ($a_mode == 'create') {
         $this->ctrl->setParameter($this, 'mode', 'create');
         $this->ctrl->setParameter($this, 'new_type', 'icrs');
         $this->form_gui->addCommandButton('save', $this->lng->txt('icrs_add'));
         $this->form_gui->addCommandButton('cancel', $this->lng->txt('cancel'));
         $this->form_gui->setFormAction($this->ctrl->getFormAction($this, 'save'));
     } else {
         $this->form_gui->addCommandButton('update', $this->lng->txt('save'));
         $this->form_gui->addCommandButton('cancel', $this->lng->txt('cancel'));
         $this->form_gui->setFormAction($this->ctrl->getFormAction($this, 'update'));
     }
 }
 protected function initSettingsForm()
 {
     global $ilSetting;
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setTitle($this->lng->txt("settings"));
     $form->setFormAction($this->ctrl->getFormAction($this, 'saveSettings'));
     // default repository view
     $options = array("flat" => $this->lng->txt("flatview"), "tree" => $this->lng->txt("treeview"));
     $si = new ilSelectInputGUI($this->lng->txt("def_repository_view"), "default_rep_view");
     $si->setOptions($options);
     $si->setInfo($this->lng->txt(""));
     if ($ilSetting->get("default_repository_view") == "tree") {
         $si->setValue("tree");
     } else {
         $si->setValue("flat");
     }
     $form->addItem($si);
     //
     $options = array("" => $this->lng->txt("adm_rep_tree_only_container"), "tree" => $this->lng->txt("adm_all_resource_types"));
     // repository tree
     $radg = new ilRadioGroupInputGUI($this->lng->txt("adm_rep_tree_presentation"), "tree_pres");
     $radg->setValue($ilSetting->get("repository_tree_pres"));
     $op1 = new ilRadioOption($this->lng->txt("adm_rep_tree_only_cntr"), "", $this->lng->txt("adm_rep_tree_only_cntr_info"));
     $radg->addOption($op1);
     $op2 = new ilRadioOption($this->lng->txt("adm_rep_tree_all_types"), "all_types", $this->lng->txt("adm_rep_tree_all_types_info"));
     // limit tree in courses and groups
     $cb = new ilCheckboxInputGUI($this->lng->txt("adm_rep_tree_limit_grp_crs"), "rep_tree_limit_grp_crs");
     $cb->setChecked($ilSetting->get("rep_tree_limit_grp_crs"));
     $cb->setInfo($this->lng->txt("adm_rep_tree_limit_grp_crs_info"));
     $op2->addSubItem($cb);
     $radg->addOption($op2);
     $form->addItem($radg);
     /* OBSOLETE
     		// synchronize repository tree with main view
     		$cb = new ilCheckboxInputGUI($this->lng->txt("adm_synchronize_rep_tree"), "rep_tree_synchronize");
     		$cb->setInfo($this->lng->txt("adm_synchronize_rep_tree_info"));
     		$cb->setChecked($ilSetting->get("rep_tree_synchronize"));
     		$form->addItem($cb);
     		*/
     /* DISABLED
     		// repository access check
     		$options = array(
     			0 => "0",
     			10 => "10",
     			30 => "30",
     			60 => "60",
     			120 => "120"
     			);
     		$si = new ilSelectInputGUI($this->lng->txt("adm_repository_cache_time"), "rep_cache");
     		$si->setOptions($options);
     		$si->setValue($ilSetting->get("rep_cache"));
     		$si->setInfo($this->lng->txt("adm_repository_cache_time_info")." ".
     			$this->lng->txt("adm_repository_cache_time_info2"));
     		$form->addItem($si);
     		*/
     // trash
     $cb = new ilCheckboxInputGUI($this->lng->txt("enable_trash"), "enable_trash");
     $cb->setInfo($this->lng->txt("enable_trash_info"));
     if ($ilSetting->get("enable_trash")) {
         $cb->setChecked(true);
     }
     $form->addItem($cb);
     // change event
     require_once 'Services/Tracking/classes/class.ilChangeEvent.php';
     $this->lng->loadLanguageModule("trac");
     $event = new ilCheckboxInputGUI($this->lng->txt('trac_repository_changes'), 'change_event_tracking');
     $event->setChecked(ilChangeEvent::_isActive());
     $form->addItem($event);
     include_once "Services/Administration/classes/class.ilAdministrationSettingsFormHandler.php";
     ilAdministrationSettingsFormHandler::addFieldsToForm(ilAdministrationSettingsFormHandler::FORM_REPOSITORY, $form, $this);
     // object lists
     $lists = new ilFormSectionHeaderGUI();
     $lists->setTitle($this->lng->txt("rep_object_lists"));
     $form->addItem($lists);
     $sdesc = new ilCheckboxInputGUI($this->lng->txt("adm_rep_shorten_description"), "rep_shorten_description");
     $sdesc->setInfo($this->lng->txt("adm_rep_shorten_description_info"));
     $sdesc->setChecked($ilSetting->get("rep_shorten_description"));
     $form->addItem($sdesc);
     $sdesclen = new ilNumberInputGUI($this->lng->txt("adm_rep_shorten_description_length"), "rep_shorten_description_length");
     $sdesclen->setValue($ilSetting->get("rep_shorten_description_length"));
     $sdesclen->setSize(3);
     $sdesc->addSubItem($sdesclen);
     // load action commands asynchronously
     $cb = new ilCheckboxInputGUI($this->lng->txt("adm_item_cmd_asynch"), "item_cmd_asynch");
     $cb->setInfo($this->lng->txt("adm_item_cmd_asynch_info"));
     $cb->setChecked($ilSetting->get("item_cmd_asynch"));
     $form->addItem($cb);
     // notes/comments/tagging
     $pl = new ilCheckboxInputGUI($this->lng->txt('adm_show_comments_tagging_in_lists'), 'comments_tagging_in_lists');
     $pl->setValue(1);
     $pl->setChecked($ilSetting->get('comments_tagging_in_lists'));
     $form->addItem($pl);
     $pltags = new ilCheckboxInputGUI($this->lng->txt('adm_show_comments_tagging_in_lists_tags'), 'comments_tagging_in_lists_tags');
     $pltags->setValue(1);
     $pltags->setChecked($ilSetting->get('comments_tagging_in_lists_tags'));
     $pl->addSubItem($pltags);
     $form->addCommandButton('saveSettings', $this->lng->txt('save'));
     return $form;
 }
 /**
  * init 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'));
 }
 public function getApacheAuthSettingsForm()
 {
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->setTitle($this->lng->txt('apache_settings'));
     $chb_enabled = new ilCheckboxInputGUI($this->lng->txt('apache_enable_auth'), 'apache_enable_auth');
     $form->addItem($chb_enabled);
     $chb_local_create_account = new ilCheckboxInputGUI($this->lng->txt('apache_autocreate'), 'apache_local_autocreate');
     $chb_enabled->addSubitem($chb_local_create_account);
     global $rbacreview;
     $roles = $rbacreview->getGlobalRolesArray();
     $select = new ilSelectInputGUI($this->lng->txt('apache_default_role'), 'apache_default_role');
     $roleOptions = array();
     foreach ($roles as $role) {
         $roleOptions[$role['obj_id']] = ilObject::_lookupTitle($role['obj_id']);
     }
     $select->setOptions($roleOptions);
     $select->setValue(4);
     $chb_local_create_account->addSubitem($select);
     $chb_local = new ilCheckboxInputGUI($this->lng->txt('apache_enable_local'), 'apache_enable_local');
     $form->addItem($chb_local);
     $chb_ldap = new ilCheckboxInputGUI($this->lng->txt('apache_enable_ldap'), 'apache_enable_ldap');
     $chb_ldap->setInfo($this->lng->txt('apache_ldap_hint_ldap_must_be_configured'));
     $form->addItem($chb_ldap);
     $txt = new ilTextInputGUI($this->lng->txt('apache_auth_indicator_name'), 'apache_auth_indicator_name');
     $txt->setRequired(true);
     $form->addItem($txt);
     $txt = new ilTextInputGUI($this->lng->txt('apache_auth_indicator_value'), 'apache_auth_indicator_value');
     $txt->setRequired(true);
     $form->addItem($txt);
     $chb = new ilCheckboxInputGUI($this->lng->txt('apache_auth_enable_override_login'), 'apache_auth_enable_override_login_page');
     $form->addItem($chb);
     $txt = new ilTextInputGUI($this->lng->txt('apache_auth_target_override_login'), 'apache_auth_target_override_login_page');
     $txt->setRequired(true);
     $chb->addSubItem($txt);
     $chb = new ilCheckboxInputGUI($this->lng->txt('apache_auth_authenticate_on_login_page'), 'apache_auth_authenticate_on_login_page');
     $form->addItem($chb);
     $sec = new ilFormSectionHeaderGUI();
     $sec->setTitle($this->lng->txt('apache_auth_username_config'));
     $form->addItem($sec);
     $rag = new ilRadioGroupInputGUI($this->lng->txt('apache_auth_username_config_type'), 'apache_auth_username_config_type');
     $form->addItem($rag);
     $rao = new ilRadioOption($this->lng->txt('apache_auth_username_direct_mapping'), 1);
     $rag->addOption($rao);
     $txt = new ilTextInputGUI($this->lng->txt('apache_auth_username_direct_mapping_fieldname'), 'apache_auth_username_direct_mapping_fieldname');
     //$txt->setRequired(true);
     $rao->addSubItem($txt);
     $rao = new ilRadioOption($this->lng->txt('apache_auth_username_extended_mapping'), 2);
     $rao->setDisabled(true);
     $rag->addOption($rao);
     $rao = new ilRadioOption($this->lng->txt('apache_auth_username_by_function'), 3);
     $rag->addOption($rao);
     /*		$txt = new ilTextInputGUI($this->lng->txt('apache_auth_username_by_function_functionname'), 'apache_auth_username_by_function_functionname');
     		$rao->addSubItem($txt);*/
     $sec = new ilFormSectionHeaderGUI();
     $sec->setTitle($this->lng->txt('apache_auth_security'));
     $form->addItem($sec);
     $txt = new ilTextAreaInputGUI($this->lng->txt('apache_auth_domains'), 'apache_auth_domains');
     $txt->setInfo($this->lng->txt('apache_auth_domains_description'));
     $form->addItem($txt);
     $form->addCommandButton('saveApacheSettings', $this->lng->txt('save'));
     $form->addCommandButton('cancel', $this->lng->txt('cancel'));
     return $form;
 }
 private function createParticipantsSection()
 {
     $participant_section = new ilFormSectionHeaderGUI();
     $participant_section->setTitle($this->lng->txt("rep_robj_xrs_participants"));
     return $participant_section;
 }
 private function initForm()
 {
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $this->form_gui = new ilPropertyFormGUI();
     $this->form_gui->setFormAction($this->ctrl->getFormAction($this, 'save'));
     $this->form_gui->setTitle($this->lng->txt('ldap_configure'));
     $active = new ilCheckboxInputGUI($this->lng->txt('auth_ldap_enable'), 'active');
     $active->setValue(1);
     $this->form_gui->addItem($active);
     $ds = new ilCheckboxInputGUI($this->lng->txt('ldap_as_ds'), 'ds');
     $ds->setValue(1);
     $ds->setInfo($this->lng->txt('ldap_as_ds_info'));
     $this->form_gui->addItem($ds);
     $servername = new ilTextInputGUI($this->lng->txt('ldap_server_name'), 'server_name');
     $servername->setRequired(true);
     $servername->setInfo($this->lng->txt('ldap_server_name_info'));
     $servername->setSize(32);
     $servername->setMaxLength(32);
     $this->form_gui->addItem($servername);
     $serverurl = new ilTextInputGUI($this->lng->txt('ldap_server'), 'server_url');
     $serverurl->setRequired(true);
     $serverurl->setInfo($this->lng->txt('ldap_server_url_info'));
     $serverurl->setSize(64);
     $serverurl->setMaxLength(255);
     $this->form_gui->addItem($serverurl);
     $version = new ilSelectInputGUI($this->lng->txt('ldap_version'), 'version');
     $version->setOptions(array(2 => 2, 3 => 3));
     $version->setInfo($this->lng->txt('ldap_server_version_info'));
     $this->form_gui->addItem($version);
     $basedsn = new ilTextInputGUI($this->lng->txt('basedn'), 'base_dn');
     $basedsn->setRequired(true);
     $basedsn->setSize(64);
     $basedsn->setMaxLength(255);
     $this->form_gui->addItem($basedsn);
     $referrals = new ilCheckboxInputGUI($this->lng->txt('ldap_referrals'), 'referrals');
     $referrals->setValue(1);
     $referrals->setInfo($this->lng->txt('ldap_referrals_info'));
     $this->form_gui->addItem($referrals);
     $section_security = new ilFormSectionHeaderGUI();
     $section_security->setTitle($this->lng->txt('ldap_server_security_settings'));
     $this->form_gui->addItem($section_security);
     $tls = new ilCheckboxInputGUI($this->lng->txt('ldap_tls'), 'tls');
     $tls->setValue(1);
     $this->form_gui->addItem($tls);
     $binding = new ilRadioGroupInputGUI($this->lng->txt('ldap_server_binding'), 'binding_type');
     $anonymous = new ilRadioOption($this->lng->txt('ldap_bind_anonymous'), IL_LDAP_BIND_ANONYMOUS);
     $binding->addOption($anonymous);
     $user = new ilRadioOption($this->lng->txt('ldap_bind_user'), IL_LDAP_BIND_USER);
     $dn = new ilTextInputGUI($this->lng->txt('ldap_server_bind_dn'), 'bind_dn');
     $dn->setSize(64);
     $dn->setMaxLength(255);
     $user->addSubItem($dn);
     $pass = new ilPasswordInputGUI($this->lng->txt('ldap_server_bind_pass'), 'bind_pass');
     $pass->setSkipSyntaxCheck(true);
     $pass->setSize(12);
     $pass->setMaxLength(36);
     $user->addSubItem($pass);
     $binding->addOption($user);
     $this->form_gui->addItem($binding);
     $section_auth = new ilFormSectionHeaderGUI();
     $section_auth->setTitle($this->lng->txt('ldap_authentication_settings'));
     $this->form_gui->addItem($section_auth);
     $search_base = new ilTextInputGUI($this->lng->txt('ldap_user_dn'), 'search_base');
     $search_base->setInfo($this->lng->txt('ldap_search_base_info'));
     $search_base->setSize(64);
     $search_base->setMaxLength(255);
     $this->form_gui->addItem($search_base);
     $user_scope = new ilSelectInputGUI($this->lng->txt('ldap_user_scope'), 'user_scope');
     $user_scope->setOptions(array(IL_LDAP_SCOPE_ONE => $this->lng->txt('ldap_scope_one'), IL_LDAP_SCOPE_SUB => $this->lng->txt('ldap_scope_sub')));
     $user_scope->setInfo($this->lng->txt('ldap_user_scope_info'));
     $this->form_gui->addItem($user_scope);
     $user_attribute = new ilTextInputGUI($this->lng->txt('ldap_user_attribute'), 'user_attribute');
     $user_attribute->setSize(16);
     $user_attribute->setMaxLength(64);
     $user_attribute->setRequired(true);
     $this->form_gui->addItem($user_attribute);
     $filter = new ilTextInputGUI($this->lng->txt('ldap_search_filter'), 'filter');
     $filter->setInfo($this->lng->txt('ldap_filter_info'));
     $filter->setSize(64);
     $filter->setMaxLength(512);
     $this->form_gui->addItem($filter);
     $section_restrictions = new ilFormSectionHeaderGUI();
     $section_restrictions->setTitle($this->lng->txt('ldap_group_restrictions'));
     $this->form_gui->addItem($section_restrictions);
     $group_dn = new ilTextInputGUI($this->lng->txt('ldap_group_search_base'), 'group_dn');
     $group_dn->setInfo($this->lng->txt('ldap_group_dn_info'));
     $group_dn->setSize(64);
     $group_dn->setMaxLength(255);
     $this->form_gui->addItem($group_dn);
     $group_scope = new ilSelectInputGUI($this->lng->txt('ldap_group_scope'), 'group_scope');
     $group_scope->setOptions(array(IL_LDAP_SCOPE_ONE => $this->lng->txt('ldap_scope_one'), IL_LDAP_SCOPE_SUB => $this->lng->txt('ldap_scope_sub')));
     $group_scope->setInfo($this->lng->txt('ldap_group_scope_info'));
     $this->form_gui->addItem($group_scope);
     $group_filter = new ilTextInputGUI($this->lng->txt('ldap_group_filter'), 'group_filter');
     $group_filter->setInfo($this->lng->txt('ldap_group_filter_info'));
     $group_filter->setSize(64);
     $group_filter->setMaxLength(255);
     $this->form_gui->addItem($group_filter);
     $group_member = new ilTextInputGUI($this->lng->txt('ldap_group_member'), 'group_member');
     $group_member->setInfo($this->lng->txt('ldap_group_member_info'));
     $group_member->setSize(32);
     $group_member->setMaxLength(255);
     $this->form_gui->addItem($group_member);
     $group_member_isdn = new ilCheckboxInputGUI($this->lng->txt('ldap_memberisdn'), 'memberisdn');
     #$group_member_isdn->setInfo($this->lng->txt('ldap_group_member_info'));
     $this->form_gui->addItem($group_member_isdn);
     #$group_member->addSubItem($group_member_isdn);
     $group = new ilTextInputGUI($this->lng->txt('ldap_group_name'), 'group');
     $group->setInfo($this->lng->txt('ldap_group_name_info'));
     $group->setSize(32);
     $group->setMaxLength(255);
     $this->form_gui->addItem($group);
     $group_atrr = new ilTextInputGUI($this->lng->txt('ldap_group_attribute'), 'group_attribute');
     $group_atrr->setInfo($this->lng->txt('ldap_group_attribute_info'));
     $group_atrr->setSize(16);
     $group_atrr->setMaxLength(64);
     $this->form_gui->addItem($group_atrr);
     $group_optional = new ilCheckboxInputGUI($this->lng->txt('ldap_group_membership'), 'group_optional');
     $group_optional->setOptionTitle($this->lng->txt('ldap_group_member_optional'));
     $group_optional->setInfo($this->lng->txt('ldap_group_optional_info'));
     $group_optional->setValue(1);
     $group_user_filter = new ilTextInputGUI($this->lng->txt('ldap_group_user_filter'), 'group_user_filter');
     $group_user_filter->setSize(64);
     $group_user_filter->setMaxLength(255);
     $group_optional->addSubItem($group_user_filter);
     $this->form_gui->addItem($group_optional);
     $section_sync = new ilFormSectionHeaderGUI();
     $section_sync->setTitle($this->lng->txt('ldap_user_sync'));
     $this->form_gui->addItem($section_sync);
     $ci_gui = new ilCustomInputGUI($this->lng->txt('ldap_moment_sync'));
     $sync_on_login = new ilCheckboxInputGUI($this->lng->txt('ldap_sync_login'), 'sync_on_login');
     $sync_on_login->setValue(1);
     $ci_gui->addSubItem($sync_on_login);
     $sync_per_cron = new ilCheckboxInputGUI($this->lng->txt('ldap_sync_cron'), 'sync_per_cron');
     $sync_per_cron->setValue(1);
     $ci_gui->addSubItem($sync_per_cron);
     $ci_gui->setInfo($this->lng->txt('ldap_user_sync_info'));
     $this->form_gui->addItem($ci_gui);
     $global_role = new ilSelectInputGUI($this->lng->txt('ldap_global_role_assignment'), 'global_role');
     $global_role->setOptions($this->prepareRoleSelect(false));
     $global_role->setInfo($this->lng->txt('ldap_global_role_info'));
     $this->form_gui->addItem($global_role);
     $migr = new ilCheckboxInputGUI($this->lng->txt('auth_ldap_migration'), 'migration');
     $migr->setInfo($this->lng->txt('auth_ldap_migration_info'));
     $migr->setValue(1);
     $this->form_gui->addItem($migr);
     include_once "Services/Administration/classes/class.ilAdministrationSettingsFormHandler.php";
     ilAdministrationSettingsFormHandler::addFieldsToForm(ilAdministrationSettingsFormHandler::FORM_LDAP, $this->form_gui, ilAdministrationSettingsFormHandler::getSettingsGUIInstance("auth"));
     $this->form_gui->addCommandButton('save', $this->lng->txt('save'));
 }
 /**
  * Init settings template form.
  *
  * @param        int        $a_mode        Edit Mode
  */
 public function initSettingsTemplateForm($a_mode = "edit")
 {
     global $lng, $ilCtrl;
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form = new ilPropertyFormGUI();
     // title
     $ti = new ilTextInputGUI($lng->txt("title"), "title");
     $ti->setMaxLength(200);
     $ti->setRequired(true);
     // begin-patch lok
     if ($this->settings_template->getAutoGenerated()) {
         $ti->setDisabled(true);
     }
     // end-patch lok
     $this->form->addItem($ti);
     // description
     $ti = new ilTextAreaInputGUI($lng->txt("description"), "description");
     // begin-patch lok
     if ($this->settings_template->getAutoGenerated()) {
         $ti->setDisabled(true);
     }
     $this->form->addItem($ti);
     // hidable tabs
     $tabs = $this->getConfig()->getHidableTabs();
     if (is_array($tabs) && count($tabs) > 0) {
         $sec = new ilFormSectionHeaderGUI();
         $sec->setTitle($lng->txt("adm_hide_tabs"));
         $this->form->addItem($sec);
         foreach ($tabs as $t) {
             // hide tab $t?
             $cb = new ilCheckboxInputGUI($t["text"], "tab_" . $t["id"]);
             $this->form->addItem($cb);
         }
     }
     // settings
     $settings = $this->getConfig()->getSettings();
     if (is_array($settings) && count($settings) > 0) {
         $sec = new ilFormSectionHeaderGUI();
         $sec->setTitle($lng->txt("adm_predefined_settings"));
         $this->form->addItem($sec);
         foreach ($settings as $s) {
             // setting
             $cb = new ilCheckboxInputGUI($s["text"], "set_" . $s["id"]);
             $this->form->addItem($cb);
             switch ($s["type"]) {
                 case ilSettingsTemplateConfig::TEXT:
                     $ti = new ilTextInputGUI($lng->txt("adm_value"), "value_" . $s["id"]);
                     //$ti->setMaxLength();
                     //$ti->setSize();
                     $cb->addSubItem($ti);
                     break;
                 case ilSettingsTemplateConfig::BOOL:
                     $cb2 = new ilCheckboxInputGUI($lng->txt("adm_value"), "value_" . $s["id"]);
                     $cb->addSubItem($cb2);
                     break;
                 case ilSettingsTemplateConfig::SELECT:
                     $si = new ilSelectInputGUI($lng->txt("adm_value"), "value_" . $s["id"]);
                     $si->setOptions($s["options"]);
                     $cb->addSubItem($si);
                     break;
                 case ilSettingsTemplateConfig::CHECKBOX:
                     $chbs = new ilCheckboxGroupInputGUI($lng->txt("adm_value"), "value_" . $s["id"]);
                     foreach ($s['options'] as $key => $value) {
                         $chbs->addOption($c = new ilCheckboxInputGUI($value, $key));
                         $c->setValue($key);
                     }
                     $cb->addSubItem($chbs);
                     break;
             }
             if ($s['hidable']) {
                 // hide setting
                 $cb_hide = new ilCheckboxInputGUI($lng->txt("adm_hide"), "hide_" . $s["id"]);
                 $cb->addSubItem($cb_hide);
             }
         }
     }
     // save and cancel commands
     if ($a_mode == "create") {
         $this->form->addCommandButton("saveSettingsTemplate", $lng->txt("save"));
         $this->form->addCommandButton("listSettingsTemplates", $lng->txt("cancel"));
         $this->form->setTitle($lng->txt("adm_add_settings_template"));
     } else {
         $this->form->addCommandButton("updateSettingsTemplate", $lng->txt("save"));
         $this->form->addCommandButton("listSettingsTemplates", $lng->txt("cancel"));
         $this->form->setTitle($lng->txt("adm_edit_settings_template"));
     }
     $this->form->setFormAction($ilCtrl->getFormAction($this));
 }
 /**
  * Init tag style editing form
  *
  * @param        int        $a_mode        Form Edit Mode (IL_FORM_EDIT | IL_FORM_CREATE)
  */
 public function initTagStyleForm($a_mode, $a_cur_tag)
 {
     global $lng, $ilCtrl;
     $ilCtrl->saveParameter($this, array("mq_id"));
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form_gui = new ilPropertyFormGUI();
     $avail_pars = $this->object->getAvailableParameters();
     $groups = $this->object->getStyleParameterGroups();
     // output select lists
     foreach ($groups as $k => $group) {
         // filter groups of properties that should only be
         // displayed with matching tag
         $filtered_groups = ilObjStyleSheet::_getFilteredGroups();
         if (is_array($filtered_groups[$k]) && !in_array($a_cur_tag, $filtered_groups[$k])) {
             continue;
         }
         $sh = new ilFormSectionHeaderGUI();
         $sh->setTitle($lng->txt("sty_" . $k));
         $this->form_gui->addItem($sh);
         foreach ($group as $par) {
             $basepar = explode(".", $par);
             $basepar = $basepar[0];
             $var = str_replace("-", "_", $basepar);
             $up_par = strtoupper($var);
             switch (ilObjStyleSheet::_getStyleParameterInputType($par)) {
                 case "select":
                     $sel_input = new ilSelectInputGUI($lng->txt("sty_" . $var), $basepar);
                     $options = array("" => "");
                     foreach ($avail_pars[$par] as $p) {
                         $options[$p] = $p;
                     }
                     $sel_input->setOptions($options);
                     $this->form_gui->addItem($sel_input);
                     break;
                 case "text":
                     $text_input = new ilTextInputGUI($lng->txt("sty_" . $var), $basepar);
                     $text_input->setMaxLength(200);
                     $text_input->setSize(20);
                     $this->form_gui->addItem($text_input);
                     break;
                 case "fontsize":
                     include_once "./Services/Style/classes/class.ilFontSizeInputGUI.php";
                     $fs_input = new ilFontSizeInputGUI($lng->txt("sty_" . $var), $basepar);
                     $this->form_gui->addItem($fs_input);
                     break;
                 case "numeric_no_perc":
                 case "numeric":
                     include_once "./Services/Style/classes/class.ilNumericStyleValueInputGUI.php";
                     $num_input = new ilNumericStyleValueInputGUI($lng->txt("sty_" . $var), $basepar);
                     if (ilObjStyleSheet::_getStyleParameterInputType($par) == "numeric_no_perc") {
                         $num_input->setAllowPercentage(false);
                     }
                     $this->form_gui->addItem($num_input);
                     break;
                 case "percentage":
                     $per_input = new ilNumberInputGUI($lng->txt("sty_" . $var), $basepar);
                     $per_input->setMinValue(0);
                     $per_input->setMaxValue(100);
                     $per_input->setMaxLength(3);
                     $per_input->setSize(3);
                     $this->form_gui->addItem($per_input);
                     break;
                 case "color":
                     //include_once("./Services/Style/classes/class.ilNumericStyleValueInputGUI.php");
                     $col_input = new ilColorPickerInputGUI($lng->txt("sty_" . $var), $basepar);
                     $col_input->setDefaultColor("");
                     $col_input->setAcceptNamedColors(true);
                     $this->form_gui->addItem($col_input);
                     break;
                 case "trbl_numeric":
                     include_once "./Services/Style/classes/class.ilTRBLNumericStyleValueInputGUI.php";
                     $num_input = new ilTRBLNumericStyleValueInputGUI($lng->txt("sty_" . $var), $basepar);
                     if (ilObjStyleSheet::_getStyleParameterInputType($par) == "trbl_numeric_no_perc") {
                         $num_input->setAllowPercentage(false);
                     }
                     $this->form_gui->addItem($num_input);
                     break;
                 case "border_width":
                     include_once "./Services/Style/classes/class.ilTRBLBorderWidthInputGUI.php";
                     $bw_input = new ilTRBLBorderWidthInputGUI($lng->txt("sty_" . $var), $basepar);
                     $this->form_gui->addItem($bw_input);
                     break;
                 case "border_style":
                     include_once "./Services/Style/classes/class.ilTRBLBorderStyleInputGUI.php";
                     $bw_input = new ilTRBLBorderStyleInputGUI($lng->txt("sty_" . $var), $basepar);
                     $this->form_gui->addItem($bw_input);
                     break;
                 case "trbl_color":
                     include_once "./Services/Style/classes/class.ilTRBLColorPickerInputGUI.php";
                     $col_input = new ilTRBLColorPickerInputGUI($lng->txt("sty_" . $var), $basepar);
                     $col_input->setAcceptNamedColors(true);
                     $this->form_gui->addItem($col_input);
                     break;
                 case "background_image":
                     include_once "./Services/Style/classes/class.ilBackgroundImageInputGUI.php";
                     $im_input = new ilBackgroundImageInputGUI($lng->txt("sty_" . $var), $basepar);
                     $imgs = array();
                     foreach ($this->object->getImages() as $entry) {
                         $imgs[] = $entry["entry"];
                     }
                     $im_input->setImages($imgs);
                     $this->form_gui->addItem($im_input);
                     break;
                 case "background_position":
                     include_once "./Services/Style/classes/class.ilBackgroundPositionInputGUI.php";
                     $im_input = new ilBackgroundPositionInputGUI($lng->txt("sty_" . $var), $basepar);
                     $this->form_gui->addItem($im_input);
                     break;
             }
         }
     }
     // custom parameters
     $sh = new ilFormSectionHeaderGUI();
     $sh->setTitle($lng->txt("sty_custom"));
     $this->form_gui->addItem($sh);
     // custom parameters
     $ti = new ilTextInputGUI($this->lng->txt("sty_custom_par"), "custom_par");
     $ti->setMaxLength(300);
     $ti->setSize(80);
     $ti->setMulti(true);
     $ti->setInfo($this->lng->txt("sty_custom_par_info"));
     $this->form_gui->addItem($ti);
     // save and cancel commands
     $this->form_gui->addCommandButton("updateTagStyle", $lng->txt("save_return"));
     $this->form_gui->addCommandButton("refreshTagStyle", $lng->txt("save_refresh"));
     //		$this->form_gui->setTitle($lng->txt("edit"));
     $this->form_gui->setFormAction($this->ctrl->getFormAction($this));
 }
 protected function initEditCustomForm(ilPropertyFormGUI $a_form)
 {
     // activation/availability
     include_once "Services/Object/classes/class.ilObjectActivation.php";
     $this->lng->loadLanguageModule('rep');
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('rep_activation_availability'));
     $a_form->addItem($section);
     // additional info only with multiple references
     $act_obj_info = $act_ref_info = "";
     if (sizeof(ilObject::_getAllReferences($this->object->getId())) > 1) {
         $act_obj_info = ' ' . $this->lng->txt('rep_activation_online_object_info');
         $act_ref_info = $this->lng->txt('rep_activation_access_ref_info');
     }
     $online = new ilCheckboxInputGUI($this->lng->txt('rep_activation_online'), 'online');
     $online->setInfo($this->lng->txt('prtt_activation_online_info') . $act_obj_info);
     $a_form->addItem($online);
     $act_type = new ilRadioGroupInputGUI($this->lng->txt('rep_activation_access'), 'access_type');
     $act_type->setInfo($act_ref_info);
     $opt = new ilRadioOption($this->lng->txt('rep_visibility_limitless'), ilObjectActivation::TIMINGS_DEACTIVATED);
     $opt->setInfo($this->lng->txt('prtt_availability_limitless_info'));
     $act_type->addOption($opt);
     $opt = new ilRadioOption($this->lng->txt('rep_visibility_until'), ilObjectActivation::TIMINGS_ACTIVATION);
     $opt->setInfo($this->lng->txt('prtt_availability_until_info'));
     $this->tpl->addJavaScript('./Services/Form/js/date_duration.js');
     include_once "Services/Form/classes/class.ilDateDurationInputGUI.php";
     $dur = new ilDateDurationInputGUI("", "access_period");
     $dur->setShowTime(true);
     $date = $this->object->getActivationStartDate();
     $dur->setStart(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
     $dur->setStartText($this->lng->txt('rep_activation_limited_start'));
     $date = $this->object->getActivationEndDate();
     $dur->setEnd(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
     $dur->setEndText($this->lng->txt('rep_activation_limited_end'));
     $opt->addSubItem($dur);
     $visible = new ilCheckboxInputGUI($this->lng->txt('rep_activation_limited_visibility'), 'access_visiblity');
     $visible->setInfo($this->lng->txt('prtt_activation_limited_visibility_info'));
     $opt->addSubItem($visible);
     $act_type->addOption($opt);
     $a_form->addItem($act_type);
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('properties'));
     $a_form->addItem($section);
     parent::initEditCustomForm($a_form);
 }
 /**
  * initEditCustomForm
  *
  * @param string $a_mode
  */
 public function initForm($a_mode = "create")
 {
     global $ilCtrl, $ilErr, $lng;
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form = new ilPropertyFormGUI();
     $item = new ilTextInputGUI($lng->txt('title'), 'title');
     $item->setRequired(true);
     $this->form->addItem($item);
     $item = new ilCheckboxInputGUI($lng->txt('dcl_visible'), 'is_visible');
     $this->form->addItem($item);
     $item = new ilTextAreaInputGUI($lng->txt('additional_info'), 'description');
     $item->setUseRte(true);
     //        $item->setRTESupport($this->table->getId(), 'dcl', 'table_settings');
     $item->setRteTagSet('mini');
     $this->form->addItem($item);
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($lng->txt('dcl_permissions_form'));
     $this->form->addItem($section);
     $item = new ilCustomInputGUI();
     $item->setHtml($lng->txt('dcl_table_info'));
     $item->setTitle($lng->txt('dcl_table_info_title'));
     $this->form->addItem($item);
     $item = new ilCheckboxInputGUI($lng->txt('dcl_add_perm'), 'add_perm');
     //		$item->setInfo($lng->txt("dcl_add_perm_info"));
     $this->form->addItem($item);
     $item = new ilCheckboxInputGUI($lng->txt('dcl_edit_perm'), 'edit_perm');
     //		$item->setInfo($lng->txt("dcl_edit_perm_info"));
     $this->form->addItem($item);
     $item = new ilCheckboxInputGUI($lng->txt('dcl_delete_perm'), 'delete_perm');
     //		$item->setInfo($lng->txt("dcl_delete_perm_info"));
     $this->form->addItem($item);
     $item = new ilCheckboxInputGUI($lng->txt('dcl_edit_by_owner'), 'edit_by_owner');
     //		$item->setInfo($lng->txt("dcl_edit_by_owner_info"));
     $this->form->addItem($item);
     $item = new ilCheckboxInputGUI($lng->txt('dcl_export_enabled'), 'export_enabled');
     $this->form->addItem($item);
     $item = new ilCheckboxInputGUI($lng->txt('dcl_limited'), 'limited');
     $sitem1 = new ilDateTimeInputGUI($lng->txt('dcl_limit_start'), 'limit_start');
     $sitem2 = new ilDateTimeInputGUI($lng->txt('dcl_limit_end'), 'limit_end');
     //		$item->setInfo($lng->txt("dcl_limited_info"));
     $item->addSubItem($sitem1);
     $item->addSubItem($sitem2);
     $this->form->addItem($item);
     if ($a_mode == "edit") {
         $this->form->addCommandButton('update', $lng->txt('dcl_table_' . $a_mode));
     } else {
         $this->form->addCommandButton('save', $lng->txt('dcl_table_' . $a_mode));
     }
     $this->form->addCommandButton('cancel', $lng->txt('cancel'));
     $this->form->setFormAction($ilCtrl->getFormAction($this, $a_mode));
     if ($a_mode == "edit") {
         $this->form->setTitle($lng->txt('dcl_edit_table'));
     } else {
         $this->form->setTitle($lng->txt('dcl_new_table'));
     }
 }
示例#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;
 }
 /**
  * Init java server form.
  */
 public function initJavaServerForm()
 {
     global $lng, $ilSetting;
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form = new ilPropertyFormGUI();
     // host
     $ti = new ilTextInputGUI($this->lng->txt("java_server_host"), "rpc_server_host");
     $ti->setMaxLength(64);
     $ti->setSize(32);
     $ti->setValue($ilSetting->get("rpc_server_host"));
     $this->form->addItem($ti);
     // port
     $ti = new ilNumberInputGUI($this->lng->txt("java_server_port"), "rpc_server_port");
     $ti->setMaxLength(5);
     $ti->setSize(5);
     $ti->setValue($ilSetting->get("rpc_server_port"));
     $this->form->addItem($ti);
     // pdf fonts
     $pdf = new ilFormSectionHeaderGUI();
     $pdf->setTitle($this->lng->txt('rpc_pdf_generation'));
     $this->form->addItem($pdf);
     $pdf_font = new ilTextInputGUI($this->lng->txt('rpc_pdf_font'), 'rpc_pdf_font');
     $pdf_font->setInfo($this->lng->txt('rpc_pdf_font_info'));
     $pdf_font->setSize(64);
     $pdf_font->setMaxLength(1024);
     $pdf_font->setRequired(true);
     $pdf_font->setValue($ilSetting->get('rpc_pdf_font', 'Helvetica, unifont'));
     $this->form->addItem($pdf_font);
     // save and cancel commands
     $this->form->addCommandButton("saveJavaServer", $lng->txt("save"));
     $this->form->setTitle($lng->txt("java_server"));
     $this->form->setDescription($lng->txt("java_server_info") . '<br /><a href="Services/WebServices/RPC/lib/README.txt" target="_blank">' . $lng->txt("java_server_readme") . '</a>');
     $this->form->setFormAction($this->ctrl->getFormAction($this));
 }
 /**
  * @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 settings form
  */
 protected function initFormCSettings()
 {
     include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingSettings.php';
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->setTitle($this->lng->txt('settings'));
     // individual course allocation
     $check = new ilCheckboxInputGUI($this->lng->txt('ecs_cmap_enable'), 'enabled');
     $check->setChecked(ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->isCourseAllocationEnabled());
     $form->addItem($check);
     // add default container
     $imp = new ilCustomInputGUI($this->lng->txt('ecs_cmap_def_cat'), 'default_cat');
     $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', 'default_cat');
     $default = ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->getDefaultCourseCategory();
     $tpl->setVariable('PROPERTY_VALUE', $default);
     if ($default) {
         include_once './Services/Tree/classes/class.ilPathGUI.php';
         $path = new ilPathGUI();
         $path->enableTextOnly(false);
         $path->enableHideLeaf(false);
         $tpl->setVariable('COMPLETE_PATH', $path->getPath(ROOT_FOLDER_ID, $default));
     }
     $imp->setHtml($tpl->get());
     $imp->setInfo($this->lng->txt('ecs_cmap_def_cat_info'));
     $form->addItem($imp);
     // all in one category
     $allinone = new ilCheckboxInputGUI($this->lng->txt('ecs_cmap_all_in_one'), 'allinone');
     $allinone->setChecked(ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->isAllInOneCategoryEnabled());
     $allinone->setInfo($this->lng->txt('ecs_cmap_all_in_one_info'));
     $allinone_cat = new ilCustomInputGUI($this->lng->txt('ecs_cmap_all_in_one_cat'), 'allinone_cat');
     $allinone_cat->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', 'allinone_cat');
     $cat = ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->getAllInOneCategory();
     $tpl->setVariable('PROPERTY_VALUE', $cat);
     if ($cat) {
         include_once './Services/Tree/classes/class.ilPathGUI.php';
         $path = new ilPathGUI();
         $path->enableTextOnly(false);
         $path->enableHideLeaf(false);
         $tpl->setVariable('COMPLETE_PATH', $path->getPath(ROOT_FOLDER_ID, $default));
     }
     $allinone_cat->setHtml($tpl->get());
     $allinone->addSubItem($allinone_cat);
     $form->addItem($allinone);
     // multiple attributes
     $multiple = new ilCheckboxInputGUI($this->lng->txt('ecs_cmap_multiple_atts'), 'multiple');
     $multiple->setChecked(ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->isAttributeMappingEnabled());
     // attribute selection
     include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSMappingUtils.php';
     include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseAttributes.php';
     $attributes = new ilSelectInputGUI($this->lng->txt('ecs_cmap_attributes'), 'atts');
     $attributes->setMulti(true);
     $attributes->setValue(ilECSCourseAttributes::getInstance($this->getServer()->getServerId(), $this->getMid())->getAttributeValues());
     $attributes->setRequired(true);
     $attributes->setOptions(ilECSMappingUtils::getCourseMappingFieldSelectOptions());
     $multiple->addSubItem($attributes);
     $form->addItem($multiple);
     // role mapping
     $rm = new ilFormSectionHeaderGUI();
     $rm->setTitle($this->lng->txt('ecs_role_mappings'));
     $form->addItem($rm);
     $mapping_defs = ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->getRoleMappings();
     include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSMappingUtils.php';
     foreach (ilECSMappingUtils::getRoleMappingInfo() as $name => $info) {
         $role_map = new ilTextInputGUI($this->lng->txt($info['lang']), $name);
         $role_map->setValue($mapping_defs[$name]);
         $role_map->setSize(32);
         $role_map->setMaxLength(64);
         $role_map->setRequired($info['required']);
         $form->addItem($role_map);
     }
     $form->addCommandButton('cUpdateSettings', $this->lng->txt('save'));
     $form->addCommandButton('cSettings', $this->lng->txt('cancel'));
     return $form;
 }
示例#21
0
 protected function populateTaxonomyFormSection(ilPropertyFormGUI $form)
 {
     if (count($this->getTaxonomyIds())) {
         $sectHeader = new ilFormSectionHeaderGUI();
         $sectHeader->setTitle($this->lng->txt('qpl_qst_edit_form_taxonomy_section'));
         $form->addItem($sectHeader);
         require_once 'Services/Taxonomy/classes/class.ilTaxAssignInputGUI.php';
         foreach ($this->getTaxonomyIds() as $taxonomyId) {
             $taxonomy = new ilObjTaxonomy($taxonomyId);
             $label = sprintf($this->lng->txt('qpl_qst_edit_form_taxonomy'), $taxonomy->getTitle());
             $postvar = "tax_node_assign_{$taxonomyId}";
             $taxNodeAssign = new ilTaxAssignInputGUI($taxonomy->getId(), true, $label, $postvar);
             // TODO: determine tst/qpl when tax assigns become maintainable within tests
             $taxNodeAssign->setCurrentValues('qpl', $this->object->getObjId(), 'quest', $this->object->getId());
             $form->addItem($taxNodeAssign);
         }
     }
 }
示例#22
0
 protected function initEditCustomForm(ilPropertyFormGUI $a_form)
 {
     global $lng;
     // activation
     include_once "Services/Object/classes/class.ilObjectActivation.php";
     $this->lng->loadLanguageModule('rep');
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('rep_activation_availability'));
     $a_form->addItem($section);
     // additional info only with multiple references
     $act_obj_info = $act_ref_info = "";
     if (sizeof(ilObject::_getAllReferences($this->object->getId())) > 1) {
         $act_obj_info = ' ' . $this->lng->txt('rep_activation_online_object_info');
         $act_ref_info = $this->lng->txt('rep_activation_access_ref_info');
     }
     $online = new ilCheckboxInputGUI($this->lng->txt('rep_activation_online'), 'online');
     $online->setInfo($this->lng->txt('poll_activation_online_info') . $act_obj_info);
     $a_form->addItem($online);
     $act_type = new ilCheckboxInputGUI($this->lng->txt('rep_visibility_until'), 'access_type');
     // $act_type->setInfo($this->lng->txt('poll_availability_until_info'));
     $this->tpl->addJavaScript('./Services/Form/js/date_duration.js');
     include_once "Services/Form/classes/class.ilDateDurationInputGUI.php";
     $dur = new ilDateDurationInputGUI($this->lng->txt('rep_time_period'), "access_period");
     $dur->setShowTime(true);
     $date = $this->object->getAccessBegin();
     $dur->setStart(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
     $dur->setStartText($this->lng->txt('rep_activation_limited_start'));
     $date = $this->object->getAccessEnd();
     $dur->setEnd(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
     $dur->setEndText($this->lng->txt('rep_activation_limited_end'));
     $act_type->addSubItem($dur);
     $a_form->addItem($act_type);
     // period/results
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('poll_voting_period_and_results'));
     $a_form->addItem($section);
     $prd = new ilCheckboxInputGUI($this->lng->txt('poll_voting_period_limited'), 'period');
     $vdur = new ilDateDurationInputGUI($this->lng->txt('rep_time_period'), "voting_period");
     $vdur->setShowTime(true);
     $date = $this->object->getVotingPeriodBegin();
     $vdur->setStart(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
     $vdur->setStartText($this->lng->txt('poll_voting_period_start'));
     $date = $this->object->getVotingPeriodEnd();
     $vdur->setEnd(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
     $vdur->setEndText($this->lng->txt('poll_voting_period_end'));
     $prd->addSubItem($vdur);
     $a_form->addItem($prd);
     $results = new ilRadioGroupInputGUI($lng->txt("poll_view_results"), "results");
     $results->setRequired(true);
     $results->addOption(new ilRadioOption($lng->txt("poll_view_results_always"), ilObjPoll::VIEW_RESULTS_ALWAYS));
     $results->addOption(new ilRadioOption($lng->txt("poll_view_results_never"), ilObjPoll::VIEW_RESULTS_NEVER));
     $results->addOption(new ilRadioOption($lng->txt("poll_view_results_after_vote"), ilObjPoll::VIEW_RESULTS_AFTER_VOTE));
     $results->addOption(new ilRadioOption($lng->txt("poll_view_results_after_period"), ilObjPoll::VIEW_RESULTS_AFTER_PERIOD));
     $a_form->addItem($results);
     $show_result_as = new ilRadioGroupInputGUI($lng->txt("poll_show_results_as"), "show_results_as");
     $show_result_as->setRequired(true);
     $result_bar = new ilRadioOption($lng->txt("poll_barchart"), ilObjPoll::SHOW_RESULTS_AS_BARCHART);
     $show_result_as->addOption($result_bar);
     $show_result_as->addOption(new ilRadioOption($lng->txt("poll_piechart"), ilObjPoll::SHOW_RESULTS_AS_PIECHART));
     $a_form->addItem($show_result_as);
     $sort = new ilRadioGroupInputGUI($lng->txt("poll_result_sorting"), "sort");
     $sort->setRequired(true);
     $sort->addOption(new ilRadioOption($lng->txt("poll_result_sorting_answers"), 0));
     $sort->addOption(new ilRadioOption($lng->txt("poll_result_sorting_votes"), 1));
     $a_form->addItem($sort);
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('poll_comments'));
     $a_form->addItem($section);
     $comment = new ilCheckboxInputGUI($this->lng->txt('poll_comments'), 'comment');
     //$comment->setInfo($this->lng->txt('poll_comments_info'));
     $a_form->addItem($comment);
 }
 protected function initNewAccountMailForm()
 {
     global $lng, $ilCtrl;
     $lng->loadLanguageModule("meta");
     $lng->loadLanguageModule("mail");
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($ilCtrl->getFormAction($this));
     $form->setTitleIcon(ilUtil::getImagePath("icon_mail.png"));
     $form->setTitle($lng->txt("user_new_account_mail"));
     $form->setDescription($lng->txt("user_new_account_mail_desc"));
     $langs = $lng->getInstalledLanguages();
     foreach ($langs as $lang_key) {
         $amail = $this->object->_lookupNewAccountMail($lang_key);
         $title = $lng->txt("meta_l_" . $lang_key);
         if ($lang_key == $lng->getDefaultLanguage()) {
             $title .= " (" . $lng->txt("default") . ")";
         }
         $header = new ilFormSectionHeaderGUI();
         $header->setTitle($title);
         $form->addItem($header);
         $subj = new ilTextInputGUI($lng->txt("subject"), "subject_" . $lang_key);
         // $subj->setRequired(true);
         $subj->setValue($amail["subject"]);
         $form->addItem($subj);
         $salg = new ilTextInputGUI($lng->txt("mail_salutation_general"), "sal_g_" . $lang_key);
         // $salg->setRequired(true);
         $salg->setValue($amail["sal_g"]);
         $form->addItem($salg);
         $salf = new ilTextInputGUI($lng->txt("mail_salutation_female"), "sal_f_" . $lang_key);
         // $salf->setRequired(true);
         $salf->setValue($amail["sal_f"]);
         $form->addItem($salf);
         $salm = new ilTextInputGUI($lng->txt("mail_salutation_male"), "sal_m_" . $lang_key);
         // $salm->setRequired(true);
         $salm->setValue($amail["sal_m"]);
         $form->addItem($salm);
         $body = new ilTextAreaInputGUI($lng->txt("message_content"), "body_" . $lang_key);
         // $body->setRequired(true);
         $body->setValue($amail["body"]);
         $body->setRows(10);
         $body->setCols(100);
         $form->addItem($body);
         $att = new ilFileInputGUI($lng->txt("attachment"), "att_" . $lang_key);
         $att->setAllowDeletion(true);
         if ($amail["att_file"]) {
             $att->setValue($amail["att_file"]);
         }
         $form->addItem($att);
     }
     $form->addCommandButton("saveNewAccountMail", $lng->txt("save"));
     $form->addCommandButton("cancelNewAccountMail", $lng->txt("cancel"));
     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);
 }
示例#26
0
 private function initForm()
 {
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $this->form = new ilPropertyFormGUI();
     $this->form->setFormAction($this->ctrl->getFormAction($this, 'save'));
     $this->form->setTitle($this->lng->txt('general_settings'));
     // Subject prefix
     $pre = new ilTextInputGUI($this->lng->txt('mail_subject_prefix'), 'mail_subject_prefix');
     $pre->setSize(12);
     $pre->setMaxLength(32);
     $pre->setInfo($this->lng->txt('mail_subject_prefix_info'));
     $this->form->addItem($pre);
     // incoming type
     include_once 'Services/Mail/classes/class.ilMailOptions.php';
     $options = array(IL_MAIL_LOCAL => $this->lng->txt('mail_incoming_local'), IL_MAIL_EMAIL => $this->lng->txt('mail_incoming_smtp'), IL_MAIL_BOTH => $this->lng->txt('mail_incoming_both'));
     $si = new ilSelectInputGUI($this->lng->txt('mail_incoming'), 'mail_incoming_mail');
     $si->setOptions($options);
     $this->ctrl->setParameterByClass('ilobjuserfoldergui', 'ref_id', USER_FOLDER_ID);
     $si->setInfo(sprintf($this->lng->txt('mail_settings_incoming_type_see_also'), $this->ctrl->getLinkTargetByClass('ilobjuserfoldergui', 'settings')));
     $this->ctrl->clearParametersByClass('ilobjuserfoldergui');
     $this->form->addItem($si);
     // noreply address
     $ti = new ilTextInputGUI($this->lng->txt('mail_external_sender_noreply'), 'mail_external_sender_noreply');
     $ti->setInfo($this->lng->txt('info_mail_external_sender_noreply'));
     $ti->setMaxLength(255);
     $this->form->addItem($ti);
     $system_sender_name = new ilTextInputGUI($this->lng->txt('mail_system_sender_name'), 'mail_system_sender_name');
     $system_sender_name->setInfo($this->lng->txt('mail_system_sender_name_info'));
     $system_sender_name->setMaxLength(255);
     $this->form->addItem($system_sender_name);
     $cb = new ilCheckboxInputGUI($this->lng->txt('mail_use_pear_mail'), 'pear_mail_enable');
     $cb->setInfo($this->lng->txt('mail_use_pear_mail_info'));
     $cb->setValue(1);
     $this->form->addItem($cb);
     // prevent smtp mails
     $cb = new ilCheckboxInputGUI($this->lng->txt('mail_prevent_smtp_globally'), 'prevent_smtp_globally');
     $cb->setValue(1);
     $this->form->addItem($cb);
     $cron_mail = new ilSelectInputGUI($this->lng->txt('cron_mail_notification'), 'mail_notification');
     $cron_options = array(0 => $this->lng->txt('cron_mail_notification_never'), 1 => $this->lng->txt('cron_mail_notification_cron'));
     $cron_mail->setOptions($cron_options);
     $cron_mail->setInfo($this->lng->txt('cron_mail_notification_desc'));
     $this->form->addItem($cron_mail);
     // section header
     $sh = new ilFormSectionHeaderGUI();
     $sh->setTitle($this->lng->txt('mail') . ' (' . $this->lng->txt('internal_system') . ')');
     $this->form->addItem($sh);
     // max attachment size
     $ti = new ilNumberInputGUI($this->lng->txt('mail_maxsize_attach'), 'mail_maxsize_attach');
     $ti->setSuffix($this->lng->txt('kb'));
     $ti->setInfo($this->lng->txt('mail_max_size_attachments_total'));
     $ti->setMaxLength(10);
     $ti->setSize(10);
     $this->form->addItem($ti);
     // Course/Group member notification
     $mn = new ilFormSectionHeaderGUI();
     $mn->setTitle($this->lng->txt('mail_member_notification'));
     $this->form->addItem($mn);
     include_once "Services/Administration/classes/class.ilAdministrationSettingsFormHandler.php";
     ilAdministrationSettingsFormHandler::addFieldsToForm(ilAdministrationSettingsFormHandler::FORM_MAIL, $this->form, $this);
     $this->form->addCommandButton('save', $this->lng->txt('save'));
 }
 public function populateQuestionSpecificFormPart(\ilPropertyFormGUI $form)
 {
     // points
     $points = new ilNumberInputGUI($this->lng->txt("points"), "points");
     $points->setValue($this->object->getPoints());
     $points->setRequired(TRUE);
     $points->setSize(3);
     $points->setMinValue(0.0);
     $form->addItem($points);
     $header = new ilFormSectionHeaderGUI();
     $header->setTitle($this->lng->txt("applet_attributes"));
     $form->addItem($header);
     // java applet
     $javaapplet = $this->object->getJavaAppletFilename();
     $applet = new ilFileInputGUI($this->lng->txt('javaapplet'), 'javaappletName');
     $applet->setSuffixes(array('jar', 'class'));
     $applet->setRequired(false);
     if (strlen($javaapplet)) {
         $filename = new ilNonEditableValueGUI($this->lng->txt('filename'), 'uploaded_javaapplet');
         $filename->setValue($javaapplet);
         $applet->addSubItem($filename);
         $delete = new ilCheckboxInputGUI('', 'delete_applet');
         $delete->setOptionTitle($this->lng->txt('delete'));
         $delete->setValue(1);
         $applet->addSubItem($delete);
     }
     $form->addItem($applet);
     // Code
     $code = new ilTextInputGUI($this->lng->txt("code"), "java_code");
     $code->setValue($this->object->getJavaCode());
     $code->setRequired(TRUE);
     $form->addItem($code);
     if (!strlen($javaapplet)) {
         // Archive
         $archive = new ilTextInputGUI($this->lng->txt("archive"), "java_archive");
         $archive->setValue($this->object->getJavaArchive());
         $archive->setRequired(false);
         $form->addItem($archive);
         // Codebase
         $codebase = new ilTextInputGUI($this->lng->txt("codebase"), "java_codebase");
         $codebase->setValue($this->object->getJavaCodebase());
         $codebase->setRequired(false);
         $form->addItem($codebase);
     }
     // Width
     $width = new ilNumberInputGUI($this->lng->txt("width"), "java_width");
     $width->setDecimals(0);
     $width->setSize(6);
     $width->setMinValue(50);
     $width->setMaxLength(6);
     $width->setValue($this->object->getJavaWidth());
     $width->setRequired(TRUE);
     $form->addItem($width);
     // Height
     $height = new ilNumberInputGUI($this->lng->txt("height"), "java_height");
     $height->setDecimals(0);
     $height->setSize(6);
     $height->setMinValue(50);
     $height->setMaxLength(6);
     $height->setValue($this->object->getJavaHeight());
     $height->setRequired(TRUE);
     $form->addItem($height);
     $header = new ilFormSectionHeaderGUI();
     $header->setTitle($this->lng->txt("applet_parameters"));
     $form->addItem($header);
     include_once "./Modules/TestQuestionPool/classes/class.ilKVPWizardInputGUI.php";
     $kvp = new ilKVPWizardInputGUI($this->lng->txt("applet_parameters"), "kvp");
     $values = array();
     for ($i = 0; $i < $this->object->getParameterCount(); $i++) {
         $param = $this->object->getParameter($i);
         array_push($values, array($param['name'], $param['value']));
     }
     if (count($values) == 0) {
         array_push($values, array("", ""));
     }
     $kvp->setKeyName($this->lng->txt('name'));
     $kvp->setValueName($this->lng->txt('value'));
     $kvp->setValues($values);
     $form->addItem($kvp);
 }
 /**
  * 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;
 }
示例#29
0
 public function populateAnswerSpecificFormPart(\ilPropertyFormGUI $form)
 {
     // points
     $points = new ilNumberInputGUI($this->lng->txt("points"), "points");
     $points->allowDecimals(true);
     $points->setValue($this->object->getPoints() > 0 ? $this->object->getPoints() : '');
     $points->setRequired(TRUE);
     $points->setSize(3);
     $points->setMinValue(0.0);
     $points->setMinvalueShouldBeGreater(true);
     $form->addItem($points);
     $header = new ilFormSectionHeaderGUI();
     $header->setTitle($this->lng->txt("range"));
     $form->addItem($header);
     // lower bound
     $lower_limit = new ilFormulaInputGUI($this->lng->txt("range_lower_limit"), "lowerlimit");
     $lower_limit->setSize(25);
     $lower_limit->setMaxLength(20);
     $lower_limit->setRequired(true);
     $lower_limit->setValue($this->object->getLowerLimit());
     $form->addItem($lower_limit);
     // upper bound
     $upper_limit = new ilFormulaInputGUI($this->lng->txt("range_upper_limit"), "upperlimit");
     $upper_limit->setSize(25);
     $upper_limit->setMaxLength(20);
     $upper_limit->setRequired(true);
     $upper_limit->setValue($this->object->getUpperLimit());
     $form->addItem($upper_limit);
     // reset input length, if max chars are set
     if ($this->object->getMaxChars() > 0) {
         $lower_limit->setSize($this->object->getMaxChars());
         $lower_limit->setMaxLength($this->object->getMaxChars());
         $upper_limit->setSize($this->object->getMaxChars());
         $upper_limit->setMaxLength($this->object->getMaxChars());
     }
 }
 /**
  * Creates an output of the edit form for the question
  *
  * @access public
  */
 public function editQuestion($checkonly = FALSE)
 {
     $save = $this->isSaveCommand();
     $this->getQuestionTemplate();
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->setTitle($this->outQuestionType());
     $form->setMultipart(FALSE);
     $form->setTableWidth("100%");
     $form->setId("orderinghorizontal");
     $this->addBasicQuestionFormProperties($form);
     // errortext
     $errortext = new ilTextAreaInputGUI($this->lng->txt("errortext"), "errortext");
     $errortext->setValue(ilUtil::prepareFormOutput($this->object->getErrorText()));
     $errortext->setRequired(TRUE);
     $errortext->setInfo($this->lng->txt("errortext_info"));
     $errortext->setRows(10);
     $errortext->setCols(80);
     $form->addItem($errortext);
     if (!$this->getSelfAssessmentEditingMode()) {
         // textsize
         $textsize = new ilNumberInputGUI($this->lng->txt("textsize"), "textsize");
         $textsize->setValue(strlen($this->object->getTextSize()) ? $this->object->getTextSize() : 100.0);
         $textsize->setInfo($this->lng->txt("textsize_errortext_info"));
         $textsize->setSize(6);
         $textsize->setSuffix("%");
         $textsize->setMinValue(10);
         $textsize->setRequired(true);
         $form->addItem($textsize);
     }
     if (count($this->object->getErrorData()) || $checkonly) {
         $header = new ilFormSectionHeaderGUI();
         $header->setTitle($this->lng->txt("errors_section"));
         $form->addItem($header);
         include_once "./Modules/TestQuestionPool/classes/class.ilErrorTextWizardInputGUI.php";
         $errordata = new ilErrorTextWizardInputGUI($this->lng->txt("errors"), "errordata");
         $values = array();
         $errordata->setKeyName($this->lng->txt('text_wrong'));
         $errordata->setValueName($this->lng->txt('text_correct'));
         $errordata->setValues($this->object->getErrorData());
         $form->addItem($errordata);
         // points for wrong selection
         $points_wrong = new ilNumberInputGUI($this->lng->txt("points_wrong"), "points_wrong");
         $points_wrong->setValue($this->object->getPointsWrong());
         $points_wrong->setInfo($this->lng->txt("points_wrong_info"));
         $points_wrong->setSize(6);
         $points_wrong->setRequired(true);
         $form->addItem($points_wrong);
     }
     $form->addCommandButton("analyze", $this->lng->txt('analyze_errortext'));
     $this->addQuestionFormCommandButtons($form);
     $errors = false;
     if ($save) {
         $form->setValuesByPost();
         $errors = !$form->checkInput();
         $form->setValuesByPost();
         // again, because checkInput now performs the whole stripSlashes handling and we need this if we don't want to have duplication of backslashes
         if ($errors) {
             $checkonly = false;
         }
     }
     if (!$checkonly) {
         $this->tpl->setVariable("QUESTION_DATA", $form->getHTML());
     }
     return $errors;
 }