/**
  * Init service settings form
  * @param ilPropertyFormGUI $form
  * @param type $services
  */
 public static function initServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services)
 {
     global $ilSetting;
     if (in_array(self::CALENDAR_VISIBILITY, $services)) {
         include_once './Services/Calendar/classes/class.ilObjCalendarSettings.php';
         if (ilCalendarSettings::_getInstance()->isEnabled()) {
             // Container tools (calendar, news, ... activation)
             $cal = new ilCheckboxInputGUI('', self::CALENDAR_VISIBILITY);
             $cal->setValue(1);
             include_once './Services/Calendar/classes/class.ilObjCalendarSettings.php';
             $cal->setChecked(ilCalendarSettings::lookupCalendarActivated($a_obj_id));
             $cal->setOptionTitle($GLOBALS['lng']->txt('obj_tool_setting_calendar'));
             $form->addItem($cal);
         }
     }
     if (in_array(self::NEWS_VISIBILITY, $services)) {
         if ($ilSetting->get('block_activated_news')) {
             // Container tools (calendar, news, ... activation)
             $news = new ilCheckboxInputGUI('', self::NEWS_VISIBILITY);
             $news->setValue(1);
             $news->setChecked(ilContainer::_lookupContainerSetting($a_obj_id, self::NEWS_VISIBILITY, $ilSetting->get('block_activated_news', true)));
             $news->setOptionTitle($GLOBALS['lng']->txt('obj_tool_setting_news'));
             $form->addItem($news);
         }
     }
     return $form;
 }
 protected function addFieldsToEditForm(ilPropertyFormGUI $a_form)
 {
     // orientation
     $orientation = new ilRadioGroupInputGUI($this->lng->txt("orientation"), "orientation");
     $orientation->setRequired(false);
     $orientation->addOption(new ilRadioOption($this->lng->txt('vertical'), 0));
     $orientation->addOption(new ilRadioOption($this->lng->txt('horizontal'), 1));
     $a_form->addItem($orientation);
     // minimum answers
     $minanswers = new ilCheckboxInputGUI($this->lng->txt("use_min_answers"), "use_min_answers");
     $minanswers->setValue(1);
     $minanswers->setOptionTitle($this->lng->txt("use_min_answers_option"));
     $minanswers->setRequired(FALSE);
     $nranswers = new ilNumberInputGUI($this->lng->txt("nr_min_answers"), "nr_min_answers");
     $nranswers->setSize(5);
     $nranswers->setDecimals(0);
     $nranswers->setRequired(false);
     $nranswers->setMinValue(1);
     $minanswers->addSubItem($nranswers);
     $nrmaxanswers = new ilNumberInputGUI($this->lng->txt("nr_max_answers"), "nr_max_answers");
     $nrmaxanswers->setSize(5);
     $nrmaxanswers->setDecimals(0);
     $nrmaxanswers->setRequired(false);
     $nrmaxanswers->setMinValue(1);
     $minanswers->addSubItem($nrmaxanswers);
     $a_form->addItem($minanswers);
     // Answers
     include_once "./Modules/SurveyQuestionPool/classes/class.ilCategoryWizardInputGUI.php";
     $answers = new ilCategoryWizardInputGUI($this->lng->txt("answers"), "answers");
     $answers->setRequired(false);
     $answers->setAllowMove(true);
     $answers->setShowWizard(false);
     $answers->setShowSavePhrase(false);
     $answers->setUseOtherAnswer(true);
     $answers->setShowNeutralCategory(true);
     $answers->setNeutralCategoryTitle($this->lng->txt('svy_neutral_answer'));
     $answers->setDisabledScale(false);
     $a_form->addItem($answers);
     // values
     $orientation->setValue($this->object->getOrientation());
     $minanswers->setChecked($this->object->use_min_answers);
     $nranswers->setValue($this->object->nr_min_answers);
     $nrmaxanswers->setValue($this->object->nr_max_answers);
     if (!$this->object->getCategories()->getCategoryCount()) {
         $this->object->getCategories()->addCategory("");
     }
     $answers->setValues($this->object->getCategories());
 }
 /**
  * @return ilPropertyFormGUI
  */
 protected function getLogSettingsForm()
 {
     /**
      * @var $ilAccess ilAccessHandler
      */
     global $ilAccess;
     require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this, 'saveLogSettings'));
     $form->setTitle($this->lng->txt('assessment_log_logging'));
     $logging = new ilCheckboxInputGUI('', 'chb_assessment_logging');
     $logging->setValue(1);
     $logging->setOptionTitle($this->lng->txt('activate_assessment_logging'));
     $form->addItem($logging);
     $reporting = new ilSelectInputGUI($this->lng->txt('assessment_settings_reporting_language'), 'reporting_language');
     $languages = $this->lng->getInstalledLanguages();
     $this->lng->loadLanguageModule('meta');
     $options = array();
     foreach ($languages as $lang) {
         $options[$lang] = $this->lng->txt('meta_l_' . $lang);
     }
     $reporting->setOptions($options);
     $form->addItem($reporting);
     if ($ilAccess->checkAccess('write', '', $this->object->getRefId())) {
         $form->addCommandButton('saveLogSettings', $this->lng->txt('save'));
     }
     return $form;
 }
 /**
  * init create/edit form
  *
  * @access protected
  * @param string edit or create
  * @return
  */
 protected function initForm($a_mode = 'edit')
 {
     global $ilUser, $tpl, $tree;
     if (is_object($this->form)) {
         return true;
     }
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form = new ilPropertyFormGUI();
     switch ($a_mode) {
         case 'edit':
             $this->form->setFormAction($this->ctrl->getFormAction($this, 'update'));
             break;
         default:
             $this->form->setTableWidth('600px');
             $this->form->setFormAction($this->ctrl->getFormAction($this, 'save'));
             break;
     }
     // title
     $title = new ilTextInputGUI($this->lng->txt('title'), 'title');
     $title->setSubmitFormOnEnter(true);
     $title->setValue($this->object->getTitle());
     $title->setSize(40);
     $title->setMaxLength(128);
     $title->setRequired(true);
     $this->form->addItem($title);
     // desc
     $desc = new ilTextAreaInputGUI($this->lng->txt('description'), 'desc');
     $desc->setValue($this->object->getLongDescription());
     $desc->setRows(2);
     $desc->setCols(40);
     $this->form->addItem($desc);
     // Group type
     $grp_type = new ilRadioGroupInputGUI($this->lng->txt('grp_typ'), 'grp_type');
     if ($a_mode == 'edit') {
         $type = $this->object->getGroupType() ? $this->object->getGroupType() : $this->object->readGroupStatus();
     } else {
         $type = $this->object->getGroupType() ? $this->object->getGroupType() : GRP_TYPE_PUBLIC;
     }
     $grp_type->setValue($type);
     $grp_type->setRequired(true);
     // PUBLIC GROUP
     $opt_public = new ilRadioOption($this->lng->txt('grp_public'), GRP_TYPE_PUBLIC, $this->lng->txt('grp_public_info'));
     $grp_type->addOption($opt_public);
     // CLOSED GROUP
     $opt_closed = new ilRadioOption($this->lng->txt('grp_closed'), GRP_TYPE_CLOSED, $this->lng->txt('grp_closed_info'));
     $grp_type->addOption($opt_closed);
     if ($a_mode == 'update_group_type') {
         $grp_type->setAlert($this->lng->txt('grp_type_changed_info'));
     }
     $this->form->addItem($grp_type);
     if ($a_mode == 'edit') {
         // Group registration ############################################################
         $pres = new ilFormSectionHeaderGUI();
         $pres->setTitle($this->lng->txt('grp_setting_header_registration'));
         $this->form->addItem($pres);
         // Registration type
         $reg_type = new ilRadioGroupInputGUI($this->lng->txt('group_registration_mode'), 'registration_type');
         $reg_type->setValue($this->object->getRegistrationType());
         $opt_dir = new ilRadioOption($this->lng->txt('grp_reg_direct'), GRP_REGISTRATION_DIRECT);
         #$this->lng->txt('grp_reg_direct_info'));
         $reg_type->addOption($opt_dir);
         $opt_pass = new ilRadioOption($this->lng->txt('grp_pass_request'), GRP_REGISTRATION_PASSWORD);
         $pass = new ilTextInputGUI('', 'password');
         $pass->setInfo($this->lng->txt('grp_reg_password_info'));
         $pass->setValue($this->object->getPassword());
         $pass->setSize(10);
         $pass->setMaxLength(32);
         $opt_pass->addSubItem($pass);
         $reg_type->addOption($opt_pass);
         $opt_req = new ilRadioOption($this->lng->txt('grp_reg_request'), GRP_REGISTRATION_REQUEST, $this->lng->txt('grp_reg_request_info'));
         $reg_type->addOption($opt_req);
         $opt_deact = new ilRadioOption($this->lng->txt('grp_reg_disabled'), GRP_REGISTRATION_DEACTIVATED, $this->lng->txt('grp_reg_disabled_info'));
         $reg_type->addOption($opt_deact);
         // Registration codes
         $reg_code = new ilCheckboxInputGUI($this->lng->txt('grp_reg_code'), 'reg_code_enabled');
         $reg_code->setChecked($this->object->isRegistrationAccessCodeEnabled());
         $reg_code->setValue(1);
         $reg_code->setInfo($this->lng->txt('grp_reg_code_enabled_info'));
         $this->form->addItem($reg_type);
         // time limit
         $time_limit = new ilCheckboxInputGUI($this->lng->txt('grp_reg_limited'), 'reg_limit_time');
         $time_limit->setOptionTitle($this->lng->txt('grp_reg_limit_time'));
         $time_limit->setChecked($this->object->isRegistrationUnlimited() ? false : true);
         $this->lng->loadLanguageModule('dateplaner');
         include_once './Services/Form/classes/class.ilDateDurationInputGUI.php';
         $tpl->addJavaScript('./Services/Form/js/date_duration.js');
         $dur = new ilDateDurationInputGUI($this->lng->txt('grp_reg_period'), 'reg');
         $dur->setStartText($this->lng->txt('cal_start'));
         $dur->setEndText($this->lng->txt('cal_end'));
         $dur->setMinuteStepSize(5);
         $dur->setShowDate(true);
         $dur->setShowTime(true);
         $dur->setStart($this->object->getRegistrationStart());
         $dur->setEnd($this->object->getRegistrationEnd());
         $time_limit->addSubItem($dur);
         $this->form->addItem($time_limit);
         // max member
         $lim = new ilCheckboxInputGUI($this->lng->txt('reg_grp_max_members_short'), 'registration_membership_limited');
         $lim->setValue(1);
         $lim->setOptionTitle($this->lng->txt('reg_grp_max_members'));
         $lim->setChecked($this->object->isMembershipLimited());
         $max = new ilTextInputGUI('', 'registration_max_members');
         $max->setValue($this->object->getMaxMembers() ? $this->object->getMaxMembers() : '');
         $max->setTitle($this->lng->txt('members') . ':');
         $max->setSize(3);
         $max->setMaxLength(4);
         $max->setInfo($this->lng->txt('grp_reg_max_members_info'));
         $lim->addSubItem($max);
         $wait = new ilCheckboxInputGUI('', 'waiting_list');
         $wait->setValue(1);
         $wait->setOptionTitle($this->lng->txt('grp_waiting_list'));
         $wait->setInfo($this->lng->txt('grp_waiting_list_info'));
         $wait->setChecked($this->object->isWaitingListEnabled() ? true : false);
         $lim->addSubItem($wait);
         $this->form->addItem($lim);
         // Registration codes
         if (!$this->object->getRegistrationAccessCode()) {
             include_once './Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
             $this->object->setRegistrationAccessCode(ilMembershipRegistrationCodeUtils::generateCode());
         }
         $reg_link = new ilHiddenInputGUI('reg_code');
         $reg_link->setValue($this->object->getRegistrationAccessCode());
         $this->form->addItem($reg_link);
         $link = new ilCustomInputGUI($this->lng->txt('grp_reg_code_link'));
         include_once './Services/Link/classes/class.ilLink.php';
         $val = ilLink::_getLink($this->object->getRefId(), $this->object->getType(), array(), '_rcode' . $this->object->getRegistrationAccessCode());
         $link->setHTML('<font class="small">' . $val . '</font>');
         $reg_code->addSubItem($link);
         $this->form->addItem($reg_code);
         // Group presentation
         $hasParentCourse = $tree->checkForParentType($this->object->getRefId(), 'crs');
         $pres = new ilFormSectionHeaderGUI();
         $pres->setTitle($this->lng->txt('grp_setting_header_presentation'));
         $this->form->addItem($pres);
         // presentation type
         $view_type = new ilRadioGroupInputGUI($this->lng->txt('grp_presentation_type'), 'view_mode');
         if ($hasParentCourse) {
             switch ($this->object->getViewMode()) {
                 case ilContainer::VIEW_SESSIONS:
                     $course_view_mode = ' (' . $this->lng->txt('cntr_view_sessions') . ')';
                     break;
                 case ilContainer::VIEW_SIMPLE:
                     $course_view_mode = ' (' . $this->lng->txt('cntr_view_simple') . ')';
                     break;
                 case ilContainer::VIEW_BY_TYPE:
                     $course_view_mode = ' (' . $this->lng->txt('cntr_view_by_type') . ')';
                     break;
             }
             $opt = new ilRadioOption($this->lng->txt('grp_view_inherit') . $course_view_mode, ilContainer::VIEW_INHERIT);
             $opt->setInfo($this->lng->txt('grp_view_inherit_info'));
             $view_type->addOption($opt);
         }
         if ($hasParentCourse && $this->object->getViewMode(false) == ilContainer::VIEW_INHERIT) {
             $view_type->setValue(ilContainer::VIEW_INHERIT);
         } else {
             $view_type->setValue($this->object->getViewMode(true));
         }
         $opt = new ilRadioOption($this->lng->txt('cntr_view_simple'), ilContainer::VIEW_SIMPLE);
         $opt->setInfo($this->lng->txt('grp_view_info_simple'));
         $view_type->addOption($opt);
         $opt = new ilRadioOption($this->lng->txt('cntr_view_by_type'), ilContainer::VIEW_BY_TYPE);
         $opt->setInfo($this->lng->txt('grp_view_info_by_type'));
         $view_type->addOption($opt);
         $this->form->addItem($view_type);
         $sog = new ilRadioGroupInputGUI($this->lng->txt('sorting_header'), 'sor');
         $sog->setRequired(true);
         if ($a_mode == 'edit') {
             $sog->setValue(ilContainerSortingSettings::_readSortMode(ilObject::_lookupObjId($this->object->getRefId())));
         } elseif ($hasParentCourse) {
             $sog->setValue(ilContainer::SORT_INHERIT);
         } else {
             $sog->setValue(ilContainer::SORT_TITLE);
         }
         if ($hasParentCourse) {
             $sde = new ilRadioOption();
             $sde->setValue(ilContainer::SORT_INHERIT);
             $title = $this->lng->txt('sort_inherit_prefix');
             $title .= ' (' . ilContainerSortingSettings::sortModeToString(ilContainerSortingSettings::lookupSortModeFromParentContainer(ilObject::_lookupObjectId($ref_id))) . ') ';
             $sde->setTitle($title);
             $sde->setInfo($this->lng->txt('sorting_info_inherit'));
             $sog->addOption($sde);
         }
         $sma = new ilRadioOption();
         $sma->setValue(ilContainer::SORT_TITLE);
         $sma->setTitle($this->lng->txt('sorting_title_header'));
         $sma->setInfo($this->lng->txt('sorting_info_title'));
         $sog->addOption($sma);
         $sti = new ilRadioOption();
         $sti->setValue(ilContainer::SORT_MANUAL);
         $sti->setTitle($this->lng->txt('sorting_manual_header'));
         $sti->setInfo($this->lng->txt('sorting_info_manual'));
         $sog->addOption($sti);
         $this->form->addItem($sog);
         include_once './Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
         ilObjectServiceSettingsGUI::initServiceSettingsForm($this->object->getId(), $this->form, array(ilObjectServiceSettingsGUI::CALENDAR_VISIBILITY, ilObjectServiceSettingsGUI::NEWS_VISIBILITY));
     }
     switch ($a_mode) {
         case 'create':
             $this->form->setTitle($this->lng->txt('grp_new'));
             $this->form->setTitleIcon(ilUtil::getImagePath('icon_grp.png'));
             $this->form->addCommandButton('save', $this->lng->txt('grp_new'));
             $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
             return true;
         case 'edit':
             $this->form->setTitle($this->lng->txt('grp_edit'));
             $this->form->setTitleIcon(ilUtil::getImagePath('icon_grp.png'));
             // Edit ecs export settings
             include_once 'Modules/Group/classes/class.ilECSGroupSettings.php';
             $ecs = new ilECSGroupSettings($this->object);
             $ecs->addSettingsToForm($this->form, 'grp');
             $this->form->addCommandButton('update', $this->lng->txt('save'));
             $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
             return true;
         case 'update_group_type':
             $grp_type->setValue($type == GRP_TYPE_PUBLIC ? GRP_TYPE_CLOSED : GRP_TYPE_PUBLIC);
             $this->form->setTitle($this->lng->txt('grp_edit'));
             $this->form->setTitleIcon(ilUtil::getImagePath('icon_grp.png'));
             return true;
     }
     return true;
 }
 /**
  * Creates an output of the edit form for the question
  *
  * @access public
  */
 public function editQuestion($checkonly = FALSE)
 {
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->setTitle($this->lng->txt($this->getQuestionType()));
     $form->setMultipart(FALSE);
     $form->setTableWidth("100%");
     $form->setId("multiplechoice");
     // title
     $title = new ilTextInputGUI($this->lng->txt("title"), "title");
     $title->setValue($this->object->getTitle());
     $title->setRequired(TRUE);
     $form->addItem($title);
     // label
     $label = new ilTextInputGUI($this->lng->txt("label"), "label");
     $label->setValue($this->object->label);
     $label->setInfo($this->lng->txt("label_info"));
     $label->setRequired(false);
     $form->addItem($label);
     // author
     $author = new ilTextInputGUI($this->lng->txt("author"), "author");
     $author->setValue($this->object->getAuthor());
     $author->setRequired(TRUE);
     $form->addItem($author);
     // description
     $description = new ilTextInputGUI($this->lng->txt("description"), "description");
     $description->setValue($this->object->getDescription());
     $description->setRequired(FALSE);
     $form->addItem($description);
     // questiontext
     $question = new ilTextAreaInputGUI($this->lng->txt("question"), "question");
     $question->setValue($this->object->prepareTextareaOutput($this->object->getQuestiontext()));
     $question->setRequired(TRUE);
     $question->setRows(10);
     $question->setCols(80);
     $question->setUseRte(TRUE);
     include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
     $question->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("survey"));
     $question->addPlugin("latex");
     $question->addButton("latex");
     $question->addButton("pastelatex");
     $question->setRTESupport($this->object->getId(), "spl", "survey", null, false, "3.4.7");
     $form->addItem($question);
     // obligatory
     $shuffle = new ilCheckboxInputGUI($this->lng->txt("obligatory"), "obligatory");
     $shuffle->setValue(1);
     $shuffle->setChecked($this->object->getObligatory());
     $shuffle->setRequired(FALSE);
     $form->addItem($shuffle);
     // orientation
     $orientation = new ilRadioGroupInputGUI($this->lng->txt("orientation"), "orientation");
     $orientation->setRequired(false);
     $orientation->setValue($this->object->getOrientation());
     $orientation->addOption(new ilRadioOption($this->lng->txt('vertical'), 0));
     $orientation->addOption(new ilRadioOption($this->lng->txt('horizontal'), 1));
     $form->addItem($orientation);
     // minimum answers
     $minanswers = new ilCheckboxInputGUI($this->lng->txt("use_min_answers"), "use_min_answers");
     $minanswers->setValue(1);
     $minanswers->setOptionTitle($this->lng->txt("use_min_answers_option"));
     $minanswers->setChecked($this->object->use_min_answers);
     $minanswers->setRequired(FALSE);
     $nranswers = new ilNumberInputGUI($this->lng->txt("nr_min_answers"), "nr_min_answers");
     $nranswers->setSize(5);
     $nranswers->setDecimals(0);
     $nranswers->setRequired(false);
     $nranswers->setMinValue(1);
     $nranswers->setValue($this->object->nr_min_answers);
     $minanswers->addSubItem($nranswers);
     $nrmaxanswers = new ilNumberInputGUI($this->lng->txt("nr_max_answers"), "nr_max_answers");
     $nrmaxanswers->setSize(5);
     $nrmaxanswers->setDecimals(0);
     $nrmaxanswers->setRequired(false);
     $nrmaxanswers->setMinValue(1);
     $nrmaxanswers->setValue($this->object->nr_max_answers);
     $minanswers->addSubItem($nrmaxanswers);
     $form->addItem($minanswers);
     // Answers
     include_once "./Modules/SurveyQuestionPool/classes/class.ilCategoryWizardInputGUI.php";
     $answers = new ilCategoryWizardInputGUI($this->lng->txt("answers"), "answers");
     $answers->setRequired(false);
     $answers->setAllowMove(true);
     $answers->setShowWizard(false);
     $answers->setShowSavePhrase(false);
     $answers->setUseOtherAnswer(true);
     $answers->setShowNeutralCategory(true);
     $answers->setNeutralCategoryTitle($this->lng->txt('svy_neutral_answer'));
     if (!$this->object->getCategories()->getCategoryCount()) {
         $this->object->getCategories()->addCategory("");
     }
     $answers->setValues($this->object->getCategories());
     $answers->setDisabledScale(false);
     $form->addItem($answers);
     $this->addCommandButtons($form);
     $errors = false;
     if ($this->isSaveCommand()) {
         $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 ($nranswers->getValue() > $answers->getCategoryCount()) {
             $nrmaxanswers->setAlert($this->lng->txt('err_minvalueganswers'));
             if (!$errors) {
                 ilUtil::sendFailure($this->lng->txt('form_input_not_valid'));
             }
             $errors = true;
         }
         if ($nrmaxanswers->getValue() > 0 && ($nrmaxanswers->getValue() > $answers->getCategoryCount() || $nrmaxanswers->getValue() < $nranswers->getValue())) {
             $nrmaxanswers->setAlert($this->lng->txt('err_maxvaluegeminvalue'));
             if (!$errors) {
                 ilUtil::sendFailure($this->lng->txt('form_input_not_valid'));
             }
             $errors = true;
         }
         if ($errors) {
             $checkonly = false;
         }
     }
     if (!$checkonly) {
         $this->tpl->setVariable("ADM_CONTENT", $form->getHTML());
     }
     return $errors;
 }
 /**
  * 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;
 }
 /**
  * @param ilPropertyFormGUI $form
  */
 private function addTestFinishProperties(ilPropertyFormGUI $form)
 {
     $testFinishHeader = new ilFormSectionHeaderGUI();
     $testFinishHeader->setTitle($this->lng->txt("tst_final_information"));
     $form->addItem($testFinishHeader);
     // 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"));
     $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"));
     $enable_examview->addSubItem($show_examview_pdf);
     $form->addItem($enable_examview);
     // show final statement
     $showfinal = new ilCheckboxInputGUI($this->lng->txt("final_statement"), "showfinalstatement");
     $showfinal->setChecked($this->testOBJ->getShowFinalStatement());
     $showfinal->setInfo($this->lng->txt("final_statement_show_desc"));
     $form->addItem($showfinal);
     // final statement
     $finalstatement = new ilTextAreaInputGUI($this->lng->txt("final_statement"), "finalstatement");
     $finalstatement->setRequired(true);
     $finalstatement->setValue($this->testOBJ->prepareTextareaOutput($this->testOBJ->getFinalStatement(), false, true));
     $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');
     $showfinal->addSubItem($finalstatement);
     $redirection_mode = $this->testOBJ->getRedirectionMode();
     $rm_enabled = new ilCheckboxInputGUI($this->lng->txt('redirect_after_finishing_tst'), 'redirection_enabled');
     $rm_enabled->setInfo($this->lng->txt('redirect_after_finishing_tst_desc'));
     $rm_enabled->setChecked($redirection_mode == '0' ? false : true);
     $radio_rm = new ilRadioGroupInputGUI($this->lng->txt('redirect_after_finishing_rule'), 'redirection_mode');
     $always = new ilRadioOption($this->lng->txt('redirect_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);
     // mail notification
     $mailnotification = new ilCheckboxInputGUI($this->lng->txt("tst_finish_notification"), "mailnotification");
     $mailnotification->setInfo($this->lng->txt("tst_finish_notification_desc"));
     $mailnotification->setChecked($this->testOBJ->getMailNotification() > 0);
     $form->addItem($mailnotification);
     $mailnotificationContent = new ilRadioGroupInputGUI($this->lng->txt("tst_finish_notification_content"), "mailnotification_content");
     $mailnotificationContent->addOption(new ilRadioOption($this->lng->txt("tst_finish_notification_simple"), 1, ''));
     $mailnotificationContent->addOption(new ilRadioOption($this->lng->txt("tst_finish_notification_advanced"), 2, ''));
     $mailnotificationContent->setValue($this->testOBJ->getMailNotification() ? $this->testOBJ->getMailNotification() : 1);
     $mailnotificationContent->setRequired(true);
     $mailnotification->addSubItem($mailnotificationContent);
     $mailnottype = new ilCheckboxInputGUI('', "mailnottype");
     $mailnottype->setValue(1);
     $mailnottype->setOptionTitle($this->lng->txt("mailnottype"));
     $mailnottype->setChecked($this->testOBJ->getMailNotificationType());
     $mailnotification->addSubItem($mailnottype);
 }
 /**
  * init propertyformgui for Assignment of LDAP Attributes to ILIAS User Profile
  * @param string $command command methode
  * @return \ilPropertyFormGUI 
  */
 private function initRoleMappingForm($command)
 {
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->setSubTabs();
     $this->tabs_gui->setSubTabActive('ldap_role_mapping');
     if (isset($_GET["mapping_id"])) {
         $this->ctrl->setParameter($this, 'mapping_id', $_GET["mapping_id"]);
     }
     $propertie_form = new ilPropertyFormGUI();
     $propertie_form->setFormAction($this->ctrl->getFormAction($this, $command));
     $propertie_form->addCommandButton($command, $this->lng->txt('save'));
     $propertie_form->addCommandButton("roleMapping", $this->lng->txt('cancel'));
     $url = new ilTextInputGUI($this->lng->txt('ldap_server'));
     $url->setPostVar("url");
     $url->setSize(50);
     $url->setMaxLength(255);
     $url->setRequired(true);
     $group_dn = new ilTextInputGUI($this->lng->txt('ldap_group_dn'));
     $group_dn->setPostVar("dn");
     $group_dn->setSize(50);
     $group_dn->setMaxLength(255);
     $group_dn->setInfo($this->lng->txt('ldap_dn_info'));
     $group_dn->setRequired(true);
     $member = new ilTextInputGUI($this->lng->txt('ldap_group_member'));
     $member->setPostVar("member");
     $member->setSize(32);
     $member->setMaxLength(255);
     $member->setInfo($this->lng->txt('ldap_member_info'));
     $member->setRequired(true);
     $member_isdn = new ilCheckboxInputGUI("");
     $member_isdn->setPostVar("memberisdn");
     $member_isdn->setOptionTitle($this->lng->txt('ldap_memberisdn'));
     $role = new ilTextInputGUI($this->lng->txt('ldap_ilias_role'));
     $role->setPostVar("role");
     $role->setSize(32);
     $role->setMaxLength(255);
     $role->setInfo($this->lng->txt('ldap_role_info'));
     $role->setRequired(true);
     $info = new ilTextAreaInputGUI($this->lng->txt('ldap_info_text'));
     $info->setPostVar("info");
     $info->setCols(50);
     $info->setRows(3);
     $info->setInfo($this->lng->txt('ldap_info_text_info'));
     $info_type = new ilCheckboxInputGUI("");
     $info_type->setPostVar("info_type");
     $info_type->setOptionTitle($this->lng->txt('ldap_mapping_info_type'));
     $propertie_form->addItem($url);
     $propertie_form->addItem($group_dn);
     $propertie_form->addItem($member);
     $propertie_form->addItem($member_isdn);
     $propertie_form->addItem($role);
     $propertie_form->addItem($info);
     $propertie_form->addItem($info_type);
     return $propertie_form;
 }
 /**
  * Generate and always set the user agreement checkbox.
  *
  * @return \ilCheckboxInputGUI
  */
 private function createUserAgreementCheckBox()
 {
     $agreement_id = $this->book->getRoomAgreementFileId();
     $link = $this->getFileLinkForUserAgreementId($agreement_id);
     $title = $this->lng->txt("rep_robj_xrs_rooms_user_agreement_accept");
     $checkbox_agreement = new ilCheckboxInputGUI($title, "accept_room_rules");
     $checkbox_agreement->setRequired(true);
     $checkbox_agreement->setOptionTitle($link);
     $checkbox_agreement->setChecked(true);
     $checkbox_agreement->setValue(1);
     $checkbox_agreement->setDisabled(true);
     return $checkbox_agreement;
 }
 /**
  * @return ilPropertyFormGUI
  */
 private function getChatSettingsForm()
 {
     /**
      * @var $ilSetting ilSetting
      * @var $lng       ilLanguage
      */
     global $lng;
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this, 'saveChatOptions'));
     $form->setTitle($lng->txt("chat_settings"));
     $chb = new ilCheckboxInputGUI('', 'play_invitation_sound');
     $chb->setOptionTitle($this->lng->txt('play_invitation_sound'));
     $form->addItem($chb);
     $form->addCommandButton("saveChatOptions", $lng->txt("save"));
     return $form;
 }
 /**
  * Show Privacy settings
  *
  * @access public
  */
 public function showSecurity()
 {
     global $ilSetting, $ilUser, $rbacreview;
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $security = ilSecuritySettings::_getInstance();
     $this->tabs_gui->setTabActive('show_security');
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->setTitle($this->lng->txt('ps_security_protection'));
     // Form checkbox
     $check = new ilCheckboxInputGUI($this->lng->txt('ps_auto_https'), 'auto_https_detect_enabled');
     $check->setOptionTitle($this->lng->txt('ps_auto_https_description'));
     $check->setChecked($security->isAutomaticHTTPSEnabled() ? 1 : 0);
     $check->setValue(1);
     $text = new ilTextInputGUI($this->lng->txt('ps_auto_https_header_name'), 'auto_https_detect_header_name');
     $text->setValue($security->getAutomaticHTTPSHeaderName());
     $text->setSize(24);
     $text->setMaxLength(64);
     $check->addSubItem($text);
     $text = new ilTextInputGUI($this->lng->txt('ps_auto_https_header_value'), 'auto_https_detect_header_value');
     $text->setValue($security->getAutomaticHTTPSHeaderValue());
     $text->setSize(24);
     $text->setMaxLength(64);
     $check->addSubItem($text);
     $form->addItem($check);
     $check2 = new ilCheckboxInputGUI($this->lng->txt('activate_https'), 'https_enabled');
     $check2->setChecked($security->isHTTPSEnabled() ? 1 : 0);
     $check2->setValue(1);
     $form->addItem($check2);
     $radio_group = new ilRadioGroupInputGUI($this->lng->txt('ps_account_security_mode'), 'account_security_mode');
     $radio_group->setValue($security->getAccountSecurityMode());
     $radio_opt = new ilRadioOption($this->lng->txt('ps_account_security_mode_default'), ilSecuritySettings::ACCOUNT_SECURITY_MODE_DEFAULT);
     $radio_group->addOption($radio_opt);
     $radio_opt = new ilRadioOption($this->lng->txt('ps_account_security_mode_customized'), ilSecuritySettings::ACCOUNT_SECURITY_MODE_CUSTOMIZED);
     $check = new ilCheckboxInputGUI($this->lng->txt('ps_password_chars_and_numbers_enabled'), 'password_chars_and_numbers_enabled');
     $check->setChecked($security->isPasswordCharsAndNumbersEnabled() ? 1 : 0);
     //$check->setOptionTitle($this->lng->txt('ps_password_chars_and_numbers_enabled'));
     $check->setInfo($this->lng->txt('ps_password_chars_and_numbers_enabled_info'));
     $radio_opt->addSubItem($check);
     $check = new ilCheckboxInputGUI($this->lng->txt('ps_password_special_chars_enabled'), 'password_special_chars_enabled');
     $check->setChecked($security->isPasswordSpecialCharsEnabled() ? 1 : 0);
     //$check->setOptionTitle($this->lng->txt('ps_password_special_chars_enabled'));
     $check->setInfo($this->lng->txt('ps_password_special_chars_enabled_info'));
     $radio_opt->addSubItem($check);
     $text = new ilTextInputGUI($this->lng->txt('ps_password_min_length'), 'password_min_length');
     $text->setInfo($this->lng->txt('ps_password_min_length_info'));
     $text->setValue($security->getPasswordMinLength());
     $text->setSize(1);
     $text->setMaxLength(2);
     $radio_opt->addSubItem($text);
     $text = new ilTextInputGUI($this->lng->txt('ps_password_max_length'), 'password_max_length');
     $text->setInfo($this->lng->txt('ps_password_max_length_info'));
     $text->setValue($security->getPasswordMaxLength());
     $text->setSize(2);
     $text->setMaxLength(3);
     $radio_opt->addSubItem($text);
     $text = new ilTextInputGUI($this->lng->txt('ps_password_max_age'), 'password_max_age');
     $text->setInfo($this->lng->txt('ps_password_max_age_info'));
     $text->setValue($security->getPasswordMaxAge());
     $text->setSize(2);
     $text->setMaxLength(3);
     $radio_opt->addSubItem($text);
     $text = new ilTextInputGUI($this->lng->txt('ps_login_max_attempts'), 'login_max_attempts');
     $text->setInfo($this->lng->txt('ps_login_max_attempts_info'));
     $text->setValue($security->getLoginMaxAttempts());
     $text->setSize(1);
     $text->setMaxLength(2);
     $radio_opt->addSubItem($text);
     $radio_group->addOption($radio_opt);
     $form->addItem($radio_group);
     $check = new ilCheckboxInputGUI($this->lng->txt('ps_password_change_on_first_login_enabled'), 'password_change_on_first_login_enabled');
     $check->setInfo($this->lng->txt('ps_password_change_on_first_login_enabled_info'));
     $check->setChecked($security->isPasswordChangeOnFirstLoginEnabled() ? 1 : 0);
     $form->addItem($check);
     // file suffix replacement
     $ti = new ilTextInputGUI($this->lng->txt("file_suffix_repl"), "suffix_repl_additional");
     $ti->setMaxLength(200);
     $ti->setSize(40);
     $ti->setInfo($this->lng->txt("file_suffix_repl_info") . " " . SUFFIX_REPL_DEFAULT);
     $ti->setValue($ilSetting->get("suffix_repl_additional"));
     $form->addItem($ti);
     // prevent login from multiple pcs at the same time
     $objCb = new ilCheckboxInputGUI($this->lng->txt('ps_prevent_simultaneous_logins'), 'ps_prevent_simultaneous_logins');
     $objCb->setChecked((int) $security->isPreventionOfSimultaneousLoginsEnabled());
     $objCb->setValue(1);
     $objCb->setOptionTitle($this->lng->txt('ps_prevent_simultaneous_logins_info'));
     $form->addItem($objCb);
     // protected admin
     $admin = new ilCheckboxInputGUI($GLOBALS['lng']->txt('adm_adm_role_protect'), 'admin_role');
     $admin->setDisabled(!$rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID));
     $admin->setInfo($GLOBALS['lng']->txt('adm_adm_role_protect_info'));
     $admin->setChecked((int) $security->isAdminRoleProtected());
     $admin->setValue(1);
     $form->addItem($admin);
     $form->addCommandButton('save_security', $this->lng->txt('save'));
     $this->tpl->setContent($form->getHTML());
 }
 /**
  * init form table 'substitutions'
  *
  * @access protected
  */
 protected function initFormSubstitutions()
 {
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     if (!($visible_records = ilAdvancedMDRecord::_getAllRecordsByObjectType())) {
         return;
     }
     $this->form = new ilPropertyFormGUI();
     $this->form->setFormAction($this->ctrl->getFormAction($this));
     #$this->form->setTableWidth('100%');
     // substitution
     foreach ($visible_records as $obj_type => $records) {
         $perm = null;
         // :TODO: hardwird ?
         if (in_array($obj_type, array("crs", "cat"))) {
             $perm = $this->getPermissions()->hasPermissions(ilAdvancedMDPermissionHelper::CONTEXT_SUBSTITUTION, $obj_type, array(ilAdvancedMDPermissionHelper::ACTION_SUBSTITUTION_SHOW_DESCRIPTION, ilAdvancedMDPermissionHelper::ACTION_SUBSTITUTION_SHOW_FIELDNAMES, ilAdvancedMDPermissionHelper::ACTION_SUBSTITUTION_FIELD_POSITIONS));
         }
         include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDSubstitution.php';
         $sub = ilAdvancedMDSubstitution::_getInstanceByObjectType($obj_type);
         // Show section
         $section = new ilFormSectionHeaderGUI();
         $section->setTitle($this->lng->txt('objs_' . $obj_type));
         $this->form->addItem($section);
         $check = new ilCheckboxInputGUI($this->lng->txt('description'), 'enabled_desc_' . $obj_type);
         $check->setValue(1);
         $check->setOptionTitle($this->lng->txt('md_adv_desc_show'));
         $check->setChecked($sub->isDescriptionEnabled() ? true : false);
         $this->form->addItem($check);
         if ($perm && !$perm[ilAdvancedMDPermissionHelper::ACTION_SUBSTITUTION_SHOW_DESCRIPTION]) {
             $check->setDisabled(true);
         }
         $check = new ilCheckboxInputGUI($this->lng->txt('md_adv_field_names'), 'enabled_field_names_' . $obj_type);
         $check->setValue(1);
         $check->setOptionTitle($this->lng->txt('md_adv_fields_show'));
         $check->setChecked($sub->enabledFieldNames() ? true : false);
         $this->form->addItem($check);
         if ($perm && !$perm[ilAdvancedMDPermissionHelper::ACTION_SUBSTITUTION_SHOW_FIELDNAMES]) {
             $check->setDisabled(true);
         }
         #$area = new ilTextAreaInputGUI($this->lng->txt('md_adv_substitution'),'substitution_'.$obj_type);
         #$area->setUseRte(true);
         #$area->setRteTagSet('standard');
         #$area->setValue(ilUtil::prepareFormOutput($sub->getSubstitutionString()));
         #$area->setRows(5);
         #$area->setCols(80);
         #$this->form->addItem($area);
         if ($perm) {
             $perm_pos = $perm[ilAdvancedMDPermissionHelper::ACTION_SUBSTITUTION_FIELD_POSITIONS];
         }
         $definitions = ilAdvancedMDFieldDefinition::getInstancesByObjType($obj_type);
         $definitions = $sub->sortDefinitions($definitions);
         $counter = 1;
         foreach ($definitions as $def) {
             $definition_id = $def->getFieldId();
             $perm = $this->getSubstitutionFieldPermissions($obj_type, $definition_id);
             $title = ilAdvancedMDRecord::_lookupTitle($def->getRecordId());
             $title = $def->getTitle() . ' (' . $title . ')';
             $check = new ilCheckboxInputGUI($title, 'show[' . $obj_type . '][' . $definition_id . ']');
             $check->setValue(1);
             $check->setOptionTitle($this->lng->txt('md_adv_show'));
             $check->setChecked($sub->isSubstituted($definition_id));
             if ($perm && !$perm["show"]) {
                 $check->setDisabled(true);
             }
             $pos = new ilNumberInputGUI($this->lng->txt('position'), 'position[' . $obj_type . '][' . $definition_id . ']');
             $pos->setSize(3);
             $pos->setMaxLength(4);
             $pos->allowDecimals(true);
             $pos->setValue(sprintf('%.1f', $counter++));
             $check->addSubItem($pos);
             if ($perm && !$perm_pos) {
                 $pos->setDisabled(true);
             }
             $bold = new ilCheckboxInputGUI($this->lng->txt('bold'), 'bold[' . $obj_type . '][' . $definition_id . ']');
             $bold->setValue(1);
             $bold->setChecked($sub->isBold($definition_id));
             $check->addSubItem($bold);
             if ($perm && !$perm["bold"]) {
                 $bold->setDisabled(true);
             }
             $bold = new ilCheckboxInputGUI($this->lng->txt('newline'), 'newline[' . $obj_type . '][' . $definition_id . ']');
             $bold->setValue(1);
             $bold->setChecked($sub->hasNewline($definition_id));
             $check->addSubItem($bold);
             if ($perm && !$perm["newline"]) {
                 $bold->setDisabled(true);
             }
             $this->form->addItem($check);
         }
         // placeholder
         /*
         $custom = new ilCustomInputGUI($this->lng->txt('md_adv_placeholders'));
         $tpl = new ilTemplate('tpl.placeholder_info.html',true,true,'Services/AdvancedMetaData');
         foreach($records as $record)
         {
         	foreach(ilAdvancedMDFieldDefinition::_getDefinitionsByRecordId($record->getRecordId()) as $definition)
         	{
         		$tpl->setCurrentBlock('field');
         		$tpl->setVariable('FIELD_NAME',$definition->getTitle());
         		$tpl->setVariable('MODULE_VARS','[IF_F_'.$definition->getFieldId().']...[F_'.$definition->getFieldId().']'.
         			'[/IF_F_'.$definition->getFieldId().']');
         		$tpl->parseCurrentBlock();
         	}
         	
         	$tpl->setCurrentBlock('record');
         	$tpl->setVariable('PLACEHOLDER_FOR',$this->lng->txt('md_adv_placeholder_for'));
         	$tpl->setVariable('TITLE',$record->getTitle());
         	$tpl->parseCurrentBlock();
         }
         $custom->setHTML($tpl->get());
         $this->form->addItem($custom);
         */
     }
     $this->form->setTitle($this->lng->txt('md_adv_substitution_table'));
     $this->form->addCommandButton('updateSubstitutions', $this->lng->txt('save'));
     return true;
 }
 private function initHTTPSForm()
 {
     global $ilCtrl, $lng;
     $this->setServerInfoSubTabs('adm_https');
     $lng->loadLanguageModule('ps');
     include_once './Services/PrivacySecurity/classes/class.ilSecuritySettings.php';
     $security = ilSecuritySettings::_getInstance();
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setTitle($lng->txt("adm_https"));
     $form->setFormAction($ilCtrl->getFormAction($this, 'saveHTTPS'));
     $check = new ilCheckboxInputGUI($lng->txt('ps_auto_https'), 'auto_https_detect_enabled');
     $check->setOptionTitle($lng->txt('ps_auto_https_description'));
     $check->setChecked($security->isAutomaticHTTPSEnabled() ? 1 : 0);
     $check->setValue(1);
     $text = new ilTextInputGUI($lng->txt('ps_auto_https_header_name'), 'auto_https_detect_header_name');
     $text->setValue($security->getAutomaticHTTPSHeaderName());
     $text->setSize(24);
     $text->setMaxLength(64);
     $text->setRequired(true);
     $check->addSubItem($text);
     $text = new ilTextInputGUI($lng->txt('ps_auto_https_header_value'), 'auto_https_detect_header_value');
     $text->setValue($security->getAutomaticHTTPSHeaderValue());
     $text->setSize(24);
     $text->setMaxLength(64);
     $text->setRequired(true);
     $check->addSubItem($text);
     $form->addItem($check);
     $check2 = new ilCheckboxInputGUI($lng->txt('activate_https'), 'https_enabled');
     $check2->setChecked($security->isHTTPSEnabled() ? 1 : 0);
     $check2->setValue(1);
     $form->addItem($check2);
     // save and cancel commands
     $form->addCommandButton('saveHTTPS', $lng->txt('save'));
     return $form;
 }
Пример #14
0
 /**
  * Init basic settings form.
  */
 public function initBasicSettingsForm($a_install = false)
 {
     global $lng, $ilCtrl;
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form = new ilPropertyFormGUI();
     // webspace dir
     $ne = new ilNonEditableValueGUI($lng->txt("data_directory_in_ws"), "webspace_dir");
     if ($a_install) {
         $ne->setInfo($this->lng->txt("data_directory_in_ws_info"));
     }
     $cwd = ilUtil::isWindows() ? str_replace("\\", "/", getcwd()) : getcwd();
     $ne->setValue($cwd . "/data");
     $this->form->addItem($ne);
     // data dir
     if ($a_install) {
         $ti = new ilTextInputGUI($lng->txt("data_directory_outside_ws"), "datadir_path");
         $ti->setInfo($lng->txt("data_directory_info"));
         $ti->setRequired(true);
         $this->form->addItem($ti);
     } else {
         $ne = new ilNonEditableValueGUI($lng->txt("data_directory_outside_ws"), "data_dir");
         $this->form->addItem($ne);
     }
     $lvext = ilUtil::isWindows() ? "_win" : "";
     // logging
     $sh = new ilFormSectionHeaderGUI();
     $sh->setTitle($lng->txt("logging"));
     $this->form->addItem($sh);
     // path to log file
     $ti = new ilTextInputGUI($lng->txt("log_path"), "log_path");
     $ti->setInfo($lng->txt("log_path_comment" . $lvext));
     $this->form->addItem($ti);
     // disable logging
     $cb = new ilCheckboxInputGUI($lng->txt("disable_logging"), "chk_log_status");
     $this->form->addItem($cb);
     // server settings
     $sh = new ilFormSectionHeaderGUI();
     $sh->setTitle($lng->txt("server_settings"));
     $this->form->addItem($sh);
     // time zone
     include_once "./Services/Calendar/classes/class.ilCalendarUtil.php";
     $si = new ilSelectInputGUI($lng->txt("time_zone"), "time_zone");
     $si->setOptions(array_merge(array("" => "-- " . $lng->txt("please_select") . " --"), ilCalendarUtil::_getShortTimeZoneList()));
     $si->setRequired(true);
     $this->form->addItem($si);
     // https settings
     $sh = new ilFormSectionHeaderGUI();
     $sh->setTitle($lng->txt("https_settings"));
     $this->form->addItem($sh);
     $check = new ilCheckboxInputGUI($lng->txt('ps_auto_https'), 'auto_https_detect_enabled');
     $check->setOptionTitle($lng->txt('ps_auto_https_description'));
     $check->setValue(1);
     $text = new ilTextInputGUI($lng->txt('ps_auto_https_header_name'), 'auto_https_detect_header_name');
     $text->setSize(24);
     $text->setMaxLength(64);
     $text->setRequired(true);
     $check->addSubItem($text);
     $text = new ilTextInputGUI($lng->txt('ps_auto_https_header_value'), 'auto_https_detect_header_value');
     $text->setSize(24);
     $text->setMaxLength(64);
     $text->setRequired(true);
     $check->addSubItem($text);
     $this->form->addItem($check);
     // required 3rd party tools
     $sh = new ilFormSectionHeaderGUI();
     $sh->setTitle($lng->txt("3rd_party_software_req"));
     $this->form->addItem($sh);
     // convert path
     $ti = new ilTextInputGUI($lng->txt("convert_path"), "convert_path");
     $ti->setInfo($lng->txt("convert_path_comment" . $lvext));
     $ti->setRequired(true);
     $this->form->addItem($ti);
     // zip path
     $ti = new ilTextInputGUI($lng->txt("zip_path"), "zip_path");
     $ti->setInfo($lng->txt("zip_path_comment" . $lvext));
     $ti->setRequired(true);
     $this->form->addItem($ti);
     // unzip path
     $ti = new ilTextInputGUI($lng->txt("unzip_path"), "unzip_path");
     $ti->setInfo($lng->txt("unzip_path_comment" . $lvext));
     $ti->setRequired(true);
     $this->form->addItem($ti);
     // optional 3rd party tools
     $sh = new ilFormSectionHeaderGUI();
     $sh->setTitle($lng->txt("3rd_party_software_opt"));
     $this->form->addItem($sh);
     // ghostscript path
     $ti = new ilTextInputGUI($lng->txt("ghostscript_path"), "ghostscript_path");
     $ti->setInfo($lng->txt("ghostscript_path_comment" . $lvext));
     $this->form->addItem($ti);
     // java path
     $ti = new ilTextInputGUI($lng->txt("java_path"), "java_path");
     $ti->setInfo($lng->txt("java_path_comment" . $lvext));
     $this->form->addItem($ti);
     // htmldoc path
     $ti = new ilTextInputGUI($lng->txt("htmldoc_path"), "htmldoc_path");
     $ti->setInfo($lng->txt("htmldoc_path_comment" . $lvext));
     $this->form->addItem($ti);
     // ffmpeg path
     $ti = new ilTextInputGUI($lng->txt("ffmpeg_path"), "ffmpeg_path");
     $ti->setInfo($lng->txt("ffmpeg_path_comment"));
     $this->form->addItem($ti);
     // latex
     $ti = new ilTextInputGUI($lng->txt("url_to_latex"), "latex_url");
     $ti->setInfo($lng->txt("latex_url_comment"));
     $this->form->addItem($ti);
     // virus scanner
     $options = array("none" => $lng->txt("none"), "sophos" => $lng->txt("sophos"), "antivir" => $lng->txt("antivir"), "clamav" => $lng->txt("clamav"));
     $si = new ilSelectInputGUI($lng->txt("virus_scanner"), "vscanner_type");
     $si->setOptions($options);
     $this->form->addItem($si);
     // scan command
     $ti = new ilTextInputGUI($lng->txt("scan_command"), "scan_command");
     $this->form->addItem($ti);
     // clean command
     $ti = new ilTextInputGUI($lng->txt("clean_command"), "clean_command");
     $this->form->addItem($ti);
     if ($a_install) {
         $sh = new ilFormSectionHeaderGUI();
         $sh->setTitle($lng->txt("master_password"));
         $this->form->addItem($sh);
         // password
         $pi = new ilPasswordInputGUI($lng->txt("password"), "password");
         $pi->setRequired(true);
         $pi->setSkipSyntaxCheck(true);
         $pi->setInfo($lng->txt("password_info"));
         $this->form->addItem($pi);
     }
     if ($a_install) {
         $this->form->addCommandButton("saveBasicSettings", $lng->txt("save"));
     } else {
         $this->form->addCommandButton("updateBasicSettings", $lng->txt("save"));
         $this->form->addCommandButton("determineToolsPath", $lng->txt("determine_tools_paths"));
     }
     $this->form->setTitle($lng->txt("data_directories"));
     $this->form->setFormAction("setup.php?cmd=gateway");
     if ($a_install) {
         $det = $this->determineTools();
         $this->form->setValuesByArray($det);
     }
 }
 /**
  * Add agreement to form
  * @param type $form
  * @param type $a_obj_id
  * @param type $a_type
  */
 public static function addAgreement($form, $a_obj_id, $a_type)
 {
     global $lng;
     $agreement = new ilCheckboxInputGUI($lng->txt($a_type . '_agree'), 'agreement');
     $agreement->setRequired(true);
     $agreement->setOptionTitle($lng->txt($a_type . '_info_agree'));
     $agreement->setValue(1);
     $form->addItem($agreement);
     return $form;
 }
 /**
  * display assessment folder settings form
  */
 public function settingsObject()
 {
     global $ilAccess;
     global $ilTabs;
     $ilTabs->setTabActive('settings');
     include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->setTableWidth("100%");
     $form->setId("settings");
     // general properties
     $header = new ilFormSectionHeaderGUI();
     $header->setTitle($this->lng->txt("assessment_log_logging"));
     $form->addItem($header);
     // assessment logging
     $logging = new ilCheckboxInputGUI('', "chb_assessment_logging");
     $logging->setValue(1);
     $logging->setChecked($this->object->_enabledAssessmentLogging());
     $logging->setOptionTitle($this->lng->txt("activate_assessment_logging"));
     $form->addItem($logging);
     // reporting language
     $reporting = new ilSelectInputGUI($this->lng->txt('assessment_settings_reporting_language'), "reporting_language");
     $languages = $this->lng->getInstalledLanguages();
     $this->lng->loadLanguageModule("meta");
     $options = array();
     foreach ($languages as $lang) {
         $options[$lang] = $this->lng->txt("meta_l_" . $lang);
     }
     $reporting->setOptions($options);
     $reporting->setValue($this->object->_getLogLanguage());
     $form->addItem($reporting);
     // question settings
     $header = new ilFormSectionHeaderGUI();
     $header->setTitle($this->lng->txt("assf_questiontypes"));
     $form->addItem($header);
     // available question types
     $allowed = new ilCheckboxGroupInputGUI($this->lng->txt('assf_allowed_questiontypes'), "chb_allowed_questiontypes");
     $questiontypes =& ilObjQuestionPool::_getQuestionTypes(TRUE);
     $forbidden_types = $this->object->_getForbiddenQuestionTypes();
     $allowedtypes = array();
     foreach ($questiontypes as $qt) {
         if (!in_array($qt['question_type_id'], $forbidden_types)) {
             array_push($allowedtypes, $qt['question_type_id']);
         }
     }
     $allowed->setValue($allowedtypes);
     foreach ($questiontypes as $type_name => $qtype) {
         $allowed->addOption(new ilCheckboxOption($type_name, $qtype["question_type_id"]));
     }
     $allowed->setInfo($this->lng->txt('assf_allowed_questiontypes_desc'));
     $form->addItem($allowed);
     // manual scoring
     $manual = new ilCheckboxGroupInputGUI($this->lng->txt('assessment_log_manual_scoring_activate'), "chb_manual_scoring");
     $manscoring = $this->object->_getManualScoring();
     $manual->setValue($manscoring);
     foreach ($questiontypes as $type_name => $qtype) {
         $manual->addOption(new ilCheckboxOption($type_name, $qtype["question_type_id"]));
     }
     $manual->setInfo($this->lng->txt('assessment_log_manual_scoring_desc'));
     $form->addItem($manual);
     if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
         $form->addCommandButton("saveSettings", $this->lng->txt("save"));
     }
     $this->tpl->setVariable("ADM_CONTENT", $form->getHTML());
 }
 /**
  * Show lucene settings form 
  * @param
  * @return
  */
 protected function initFormLuceneSettings()
 {
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     include_once './Services/Search/classes/class.ilSearchSettings.php';
     $this->settings = ilSearchSettings::getInstance();
     $this->form = new ilPropertyFormGUI();
     $this->form->setFormAction($this->ctrl->getFormAction($this, 'cancel'));
     $this->form->setTitle($this->lng->txt('lucene_settings_title'));
     $this->form->addCommandButton('saveLuceneSettings', $this->lng->txt('save'));
     $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
     // Offline filter
     /*
     		$offline = new ilCheckboxInputGUI($this->lng->txt('lucene_offline_filter_setting'),'offline_filter');
     		$offline->setInfo($this->lng->txt('lucene_offline_filter_setting_info'));
     		$offline->setValue(1);
     		$offline->setChecked($this->settings->isLuceneOfflineFilterEnabled());
     		$this->form->addItem($offline);
     */
     // user search
     $us = new ilCheckboxInputGUI($this->lng->txt('search_user_search_form'), 'user_search_enabled');
     $us->setInfo($this->lng->txt('search_user_search_info_form'));
     $us->setValue(1);
     $us->setChecked($this->settings->isLuceneUserSearchEnabled());
     $this->form->addItem($us);
     // Item filter
     $if = new ilCheckboxInputGUI($this->lng->txt('search_mime_filter_form'), 'mime_enabled');
     $if->setValue(1);
     $if->setChecked($this->settings->isLuceneMimeFilterEnabled());
     $if->setInfo($this->lng->txt('search_item_filter_form_info'));
     $this->form->addItem($if);
     $mimes = $this->settings->getLuceneMimeFilter();
     foreach (ilSearchSettings::getLuceneMimeFilterDefinitions() as $mime => $def) {
         $ch = new ilCheckboxInputGUI($this->lng->txt($def['trans']), 'mime[' . $mime . ']');
         if (isset($mimes[$mime]) and $mimes[$mime]) {
             $ch->setChecked(true);
         }
         $ch->setValue(1);
         $if->addSubItem($ch);
     }
     $prefix = new ilCheckboxInputGUI($this->lng->txt('lucene_prefix_wildcard'), 'prefix');
     $prefix->setValue(1);
     $prefix->setInfo($this->lng->txt('lucene_prefix_wildcard_info'));
     $prefix->setChecked($this->settings->isPrefixWildcardQueryEnabled());
     $this->form->addItem($prefix);
     $numFrag = new ilNumberInputGUI($this->lng->txt('lucene_num_fragments'), 'fragmentCount');
     $numFrag->setRequired(true);
     $numFrag->setSize(2);
     $numFrag->setMaxLength(2);
     $numFrag->setMinValue(1);
     $numFrag->setMaxValue(10);
     $numFrag->setInfo($this->lng->txt('lucene_num_frag_info'));
     $numFrag->setValue($this->settings->getFragmentCount());
     $this->form->addItem($numFrag);
     $sizeFrag = new ilNumberInputGUI($this->lng->txt('lucene_size_fragments'), 'fragmentSize');
     $sizeFrag->setRequired(true);
     $sizeFrag->setSize(2);
     $sizeFrag->setMaxLength(4);
     $sizeFrag->setMinValue(10);
     $sizeFrag->setMaxValue(1000);
     $sizeFrag->setInfo($this->lng->txt('lucene_size_frag_info'));
     $sizeFrag->setValue($this->settings->getFragmentSize());
     $this->form->addItem($sizeFrag);
     $maxSub = new ilNumberInputGUI($this->lng->txt('lucene_max_sub'), 'maxSubitems');
     $maxSub->setRequired(true);
     $maxSub->setSize(2);
     $maxSub->setMaxLength(2);
     $maxSub->setMinValue(1);
     $maxSub->setMaxValue(10);
     $maxSub->setInfo($this->lng->txt('lucene_max_sub_info'));
     $maxSub->setValue($this->settings->getMaxSubitems());
     $this->form->addItem($maxSub);
     $relevance = new ilCheckboxInputGUI($this->lng->txt('lucene_relevance'), 'relevance');
     $relevance->setOptionTitle($this->lng->txt('lucene_show_relevance'));
     $relevance->setInfo($this->lng->txt('lucene_show_relevance_info'));
     $relevance->setValue(1);
     $relevance->setChecked($this->settings->isRelevanceVisible());
     $this->form->addItem($relevance);
     // begin-patch mime_filter
     $subrel = new ilCheckboxInputGUI('', 'subrelevance');
     $subrel->setOptionTitle($this->lng->txt('lucene_show_sub_relevance'));
     $subrel->setValue(1);
     $subrel->setChecked($this->settings->isSubRelevanceVisible());
     $relevance->addSubItem($subrel);
     // end-patch mime_filter
     $last_index = new ilDateTimeInputGUI($this->lng->txt('lucene_last_index_time'), 'last_index');
     $last_index->setShowTime(true);
     $last_index->setDate($this->settings->getLastIndexTime());
     $last_index->setInfo($this->lng->txt('lucene_last_index_time_info'));
     $this->form->addItem($last_index);
     return true;
 }
 /**
  * Add fields to form
  *
  * @param ilPropertyformGUI $form
  * @param array $prefs
  * @param object $parent
  * @param bool $a_anonymized
  */
 public function showPublicProfileFields(ilPropertyformGUI $form, array $prefs, $parent = null, $anonymized = false)
 {
     global $ilUser;
     $birthday = $ilUser->getBirthday();
     if ($birthday) {
         $birthday = ilDatePresentation::formatDate(new ilDate($birthday, IL_CAL_DATE));
     }
     $gender = $ilUser->getGender();
     if ($gender) {
         $gender = $this->lng->txt("gender_" . $gender);
     }
     if ($ilUser->getSelectedCountry() != "") {
         $this->lng->loadLanguageModule("meta");
         $txt_sel_country = $this->lng->txt("meta_c_" . $ilUser->getSelectedCountry());
     }
     // profile picture
     $pic = ilObjUser::_getPersonalPicturePath($ilUser->getId(), "xsmall", true, true);
     if ($pic) {
         $pic = "<img src=\"" . $pic . "\" />";
     }
     // personal data
     $val_array = array("title" => $ilUser->getUTitle(), "birthday" => $birthday, "gender" => $gender, "upload" => $pic, "interests_general" => $ilUser->getGeneralInterestsAsText(), "interests_help_offered" => $ilUser->getOfferingHelpAsText(), "interests_help_looking" => $ilUser->getLookingForHelpAsText(), "institution" => $ilUser->getInstitution(), "department" => $ilUser->getDepartment(), "street" => $ilUser->getStreet(), "zipcode" => $ilUser->getZipcode(), "city" => $ilUser->getCity(), "country" => $ilUser->getCountry(), "sel_country" => $txt_sel_country, "phone_office" => $ilUser->getPhoneOffice(), "phone_home" => $ilUser->getPhoneHome(), "phone_mobile" => $ilUser->getPhoneMobile(), "fax" => $ilUser->getFax(), "email" => $ilUser->getEmail(), "hobby" => $ilUser->getHobby(), "matriculation" => $ilUser->getMatriculation(), "delicious" => $ilUser->getDelicious());
     // location
     include_once "./Services/Maps/classes/class.ilMapUtil.php";
     if (ilMapUtil::isActivated()) {
         $val_array["location"] = "";
     }
     foreach ($val_array as $key => $value) {
         if ($anonymized) {
             $value = null;
         }
         if ($this->userSettingVisible($key)) {
             // public setting
             if ($key == "upload") {
                 $cb = new ilCheckboxInputGUI($this->lng->txt("personal_picture"), "chk_" . $key);
             } else {
                 $cb = new ilCheckboxInputGUI($this->lng->txt($key), "chk_" . $key);
             }
             if ($prefs["public_" . $key] == "y") {
                 $cb->setChecked(true);
             }
             //$cb->setInfo($value);
             $cb->setOptionTitle($value);
             if (!$parent) {
                 $form->addItem($cb);
             } else {
                 $parent->addSubItem($cb);
             }
         }
     }
     $im_arr = array("icq", "yahoo", "msn", "aim", "skype", "jabber", "voip");
     if ($this->userSettingVisible("instant_messengers")) {
         foreach ($im_arr as $im) {
             // public setting
             $cb = new ilCheckboxInputGUI($this->lng->txt("im_" . $im), "chk_im_" . $im);
             //$cb->setInfo($ilUser->getInstantMessengerId($im));
             $cb->setOptionTitle($ilUser->getInstantMessengerId($im));
             if ($prefs["public_im_" . $im] != "n") {
                 $cb->setChecked(true);
             }
             if (!$parent) {
                 $form->addItem($cb);
             } else {
                 $parent->addSubItem($cb);
             }
         }
     }
     // additional defined user data fields
     $user_defined_data = array();
     if (!$anonymized) {
         $user_defined_data = $ilUser->getUserDefinedData();
     }
     foreach ($this->user_defined_fields->getVisibleDefinitions() as $field_id => $definition) {
         // public setting
         $cb = new ilCheckboxInputGUI($definition["field_name"], "chk_udf_" . $definition["field_id"]);
         $cb->setOptionTitle($user_defined_data["f_" . $definition["field_id"]]);
         if ($prefs["public_udf_" . $definition["field_id"]] == "y") {
             $cb->setChecked(true);
         }
         if (!$parent) {
             $form->addItem($cb);
         } else {
             $parent->addSubItem($cb);
         }
     }
 }
 /**
  * Init settings form.
  */
 public function initSettingsForm()
 {
     global $lng, $ilCtrl;
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form = new ilPropertyFormGUI();
     // title
     $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
     $ti->setMaxLength(128);
     $ti->setSize(40);
     $ti->setRequired(true);
     $this->form->addItem($ti);
     // description
     $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
     $ta->setCols(40);
     $ta->setRows(2);
     $this->form->addItem($ta);
     // online
     $cb = new ilCheckboxInputGUI($lng->txt("cont_online"), "cobj_online");
     $cb->setOptionTitle($lng->txt(""));
     $cb->setValue("y");
     $this->form->addItem($cb);
     // startfile
     require_once "./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php";
     $startfile = ilObjFileBasedLMAccess::_determineStartUrl($this->object->getId());
     $ne = new ilNonEditableValueGUI($lng->txt("cont_startfile"), "");
     if ($startfile != "") {
         $ne->setValue(basename($startfile));
     } else {
         $ne->setValue(basename($this->lng->txt("no_start_file")));
     }
     $this->form->addItem($ne);
     $this->form->addCommandButton("saveProperties", $lng->txt("save"));
     $this->form->addCommandButton("toFilesystem", $lng->txt("cont_set_start_file"));
     $this->form->setTitle($lng->txt("cont_lm_properties"));
     $this->form->setFormAction($ilCtrl->getFormAction($this, "saveProperties"));
 }
Пример #20
0
 public function showForm()
 {
     global $rbacsystem, $ilUser, $ilCtrl, $lng, $ilTabs;
     $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.mail_new.html", "Services/Mail");
     $this->tpl->setTitle($this->lng->txt("mail"));
     $this->lng->loadLanguageModule("crs");
     if (ilMailFormCall::isRefererStored()) {
         $ilTabs->setBackTarget($lng->txt('back'), $ilCtrl->getLinkTarget($this, 'cancelMail'));
     }
     switch ($_GET["type"]) {
         case 'reply':
             if ($_SESSION['mail_id']) {
                 $_GET['mail_id'] = $_SESSION['mail_id'];
             }
             $mailData = $this->umail->getMail($_GET["mail_id"]);
             $mailData["m_subject"] = $this->umail->formatReplySubject();
             $mailData["m_message"] = $this->umail->formatReplyMessage();
             $mailData["m_message"] = $this->umail->prependSignature();
             // NO ATTACHMENTS FOR REPLIES
             $mailData["attachments"] = array();
             //$mailData["rcp_cc"] = $this->umail->formatReplyRecipientsForCC();
             $mailData["rcp_cc"] = '';
             $mailData["rcp_to"] = $this->umail->formatReplyRecipient();
             $_SESSION["mail_id"] = "";
             break;
         case 'search_res':
             $mailData = $this->umail->getSavedData();
             /*if($_SESSION["mail_search_results"])
             		{
             			$mailData = $this->umail->appendSearchResult($_SESSION["mail_search_results"],$_SESSION["mail_search"]);
             		}
             		unset($_SESSION["mail_search"]);
             		unset($_SESSION["mail_search_results"]);*/
             if ($_SESSION["mail_search_results_to"]) {
                 $mailData = $this->umail->appendSearchResult($_SESSION["mail_search_results_to"], 'to');
             }
             if ($_SESSION["mail_search_results_cc"]) {
                 $mailData = $this->umail->appendSearchResult($_SESSION["mail_search_results_cc"], 'cc');
             }
             if ($_SESSION["mail_search_results_bcc"]) {
                 $mailData = $this->umail->appendSearchResult($_SESSION["mail_search_results_bcc"], 'bc');
             }
             unset($_SESSION["mail_search_results_to"]);
             unset($_SESSION["mail_search_results_cc"]);
             unset($_SESSION["mail_search_results_bcc"]);
             break;
         case 'attach':
             $mailData = $this->umail->getSavedData();
             break;
         case 'draft':
             $_SESSION["draft"] = $_GET["mail_id"];
             $mailData = $this->umail->getMail($_GET["mail_id"]);
             break;
         case 'forward':
             $mailData = $this->umail->getMail($_GET["mail_id"]);
             $mailData["rcp_to"] = $mailData["rcp_cc"] = $mailData["rcp_bcc"] = '';
             $mailData["m_subject"] = $this->umail->formatForwardSubject();
             $mailData["m_message"] = $this->umail->prependSignature();
             if (count($mailData["attachments"])) {
                 if ($error = $this->mfile->adoptAttachments($mailData["attachments"], $_GET["mail_id"])) {
                     ilUtil::sendInfo($error);
                 }
             }
             break;
         case 'new':
             if ($_GET['rcp_to']) {
                 // Note: For security reasons, ILIAS only allows Plain text strings in E-Mails.
                 $mailData["rcp_to"] = ilUtil::securePlainString($_GET['rcp_to']);
             } else {
                 if ($_SESSION['rcp_to']) {
                     $mailData["rcp_to"] = $_SESSION['rcp_to'];
                 }
             }
             if ($_GET['rcp_cc']) {
                 // Note: For security reasons, ILIAS only allows Plain text strings in E-Mails.
                 $mailData["rcp_cc"] = ilUtil::securePlainString($_GET['rcp_cc']);
             } else {
                 if ($_SESSION['rcp_cc']) {
                     $mailData["rcp_cc"] = $_SESSION['rcp_cc'];
                 }
             }
             if ($_GET['rcp_bcc']) {
                 // Note: For security reasons, ILIAS only allows Plain text strings in E-Mails.
                 $mailData["rcp_bcc"] = ilUtil::securePlainString($_GET['rcp_bcc']);
             } else {
                 if ($_SESSION['rcp_bcc']) {
                     $mailData["rcp_bcc"] = $_SESSION['rcp_bcc'];
                 }
             }
             $mailData['m_message'] = '';
             if (strlen($sig = ilMailFormCall::getSignature())) {
                 $mailData['m_message'] = $sig;
                 $mailData['m_message'] .= chr(13) . chr(10) . chr(13) . chr(10);
             }
             $mailData['m_message'] .= $this->umail->appendSignature();
             $_SESSION['rcp_to'] = '';
             $_SESSION['rcp_cc'] = '';
             $_SESSION['rcp_bcc'] = '';
             break;
         case 'role':
             if (is_array($_POST['roles'])) {
                 // Note: For security reasons, ILIAS only allows Plain text strings in E-Mails.
                 $mailData['rcp_to'] = ilUtil::securePlainString(implode(',', $_POST['roles']));
             } elseif (is_array($_SESSION['mail_roles'])) {
                 $mailData['rcp_to'] = ilUtil::securePlainString(implode(',', $_SESSION['mail_roles']));
             }
             $mailData['m_message'] = '';
             if (strlen($sig = ilMailFormCall::getSignature())) {
                 $mailData['m_message'] = $sig;
                 $mailData['m_message'] .= chr(13) . chr(10) . chr(13) . chr(10);
             }
             $mailData['m_message'] .= $_POST["additional_message_text"] . chr(13) . chr(10) . $this->umail->appendSignature();
             $_POST["additional_message_text"] = "";
             $_SESSION['mail_roles'] = "";
             break;
         case 'address':
             $mailData["rcp_to"] = urldecode($_GET["rcp"]);
             break;
         default:
             // GET DATA FROM POST
             $mailData = $_POST;
             // strip slashes
             foreach ($mailData as $key => $value) {
                 if (is_string($value)) {
                     // Note: For security reasons, ILIAS only allows Plain text strings in E-Mails.
                     $mailData[$key] = ilUtil::securePlainString($value);
                 }
             }
             break;
     }
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $form_gui = new ilPropertyFormGUI();
     $form_gui->setTitle($this->lng->txt('compose'));
     $form_gui->setOpenTag(false);
     $this->tpl->setVariable('FORM_ACTION', $this->ctrl->getFormAction($this, 'sendMessage'));
     $this->tpl->setVariable('BUTTON_TO', $lng->txt("search_recipients"));
     $this->tpl->setVariable('BUTTON_COURSES_TO', $lng->txt("mail_my_courses"));
     $this->tpl->setVariable('BUTTON_GROUPS_TO', $lng->txt("mail_my_groups"));
     $this->tpl->setVariable('BUTTON_MAILING_LISTS_TO', $lng->txt("mail_my_mailing_lists"));
     $dsDataLink = $ilCtrl->getLinkTarget($this, 'lookupRecipientAsync', '', true);
     // RECIPIENT
     $inp = new ilTextInputGUI($this->lng->txt('mail_to'), 'rcp_to');
     $inp->setRequired(true);
     $inp->setSize(50);
     $inp->setValue($mailData["rcp_to"]);
     $inp->setDataSource($dsDataLink, ",");
     $inp->setMaxLength(null);
     $form_gui->addItem($inp);
     // CC
     $inp = new ilTextInputGUI($this->lng->txt('cc'), 'rcp_cc');
     $inp->setSize(50);
     $inp->setValue($mailData["rcp_cc"]);
     $inp->setDataSource($dsDataLink, ",");
     $inp->setMaxLength(null);
     $form_gui->addItem($inp);
     // BCC
     $inp = new ilTextInputGUI($this->lng->txt('bc'), 'rcp_bcc');
     $inp->setSize(50);
     $inp->setValue($mailData["rcp_bcc"]);
     $inp->setDataSource($dsDataLink, ",");
     $inp->setMaxLength(null);
     $form_gui->addItem($inp);
     // SUBJECT
     $inp = new ilTextInputGUI($this->lng->txt('subject'), 'm_subject');
     $inp->setSize(50);
     $inp->setRequired(true);
     $inp->setValue($mailData["m_subject"]);
     $form_gui->addItem($inp);
     // Attachments
     include_once 'Services/Mail/classes/class.ilMailFormAttachmentFormPropertyGUI.php';
     $att = new ilMailFormAttachmentPropertyGUI($this->lng->txt($mailData["attachments"] ? 'edit' : 'add'));
     if (is_array($mailData["attachments"]) && count($mailData["attachments"])) {
         foreach ($mailData["attachments"] as $data) {
             if (is_file($this->mfile->getMailPath() . '/' . $ilUser->getId() . "_" . $data)) {
                 $hidden = new ilHiddenInputGUI('attachments[]');
                 $form_gui->addItem($hidden);
                 $size = filesize($this->mfile->getMailPath() . '/' . $ilUser->getId() . "_" . $data);
                 $label = $data . " [" . ilFormat::formatSize($size) . "]";
                 $att->addItem($label);
                 $hidden->setValue(urlencode($data));
             }
         }
     }
     $form_gui->addItem($att);
     // ONLY IF SYSTEM MAILS ARE ALLOWED
     if ($rbacsystem->checkAccess("system_message", $this->umail->getMailObjectReferenceId())) {
         $chb = new ilCheckboxInputGUI($this->lng->txt('type'), 'm_type[]');
         $chb->setOptionTitle($this->lng->txt('system_message'));
         $chb->setValue('system');
         $chb->setChecked(false);
         if (is_array($mailData["m_type"]) and in_array('system', $mailData["m_type"])) {
             $chb->setChecked(true);
         }
         $form_gui->addItem($chb);
     }
     // MESSAGE
     $inp = new ilTextAreaInputGUI($this->lng->txt('message_content'), 'm_message');
     //$inp->setValue(htmlspecialchars($mailData["m_message"], false));
     $inp->setValue($mailData["m_message"]);
     $inp->setRequired(false);
     $inp->setCols(60);
     $inp->setRows(10);
     // PLACEHOLDERS
     $chb = new ilCheckboxInputGUI($this->lng->txt('activate_serial_letter_placeholders'), 'use_placeholders');
     $chb->setOptionTitle($this->lng->txt('activate_serial_letter_placeholders'));
     $chb->setValue(1);
     $chb->setChecked(false);
     $form_gui->addItem($inp);
     include_once 'Services/Mail/classes/class.ilMailFormPlaceholdersPropertyGUI.php';
     $prop = new ilMailFormPlaceholdersPropertyGUI();
     $chb->addSubItem($prop);
     if ($mailData['use_placeholders']) {
         $chb->setChecked(true);
     }
     $form_gui->addItem($chb);
     $form_gui->addCommandButton('sendMessage', $this->lng->txt('send_mail'));
     $form_gui->addCommandButton('saveDraft', $this->lng->txt('save_message'));
     if (ilMailFormCall::isRefererStored()) {
         $form_gui->addCommandButton('cancelMail', $this->lng->txt('cancel'));
     }
     $this->tpl->parseCurrentBlock();
     $this->tpl->setVariable('FORM', $form_gui->getHTML());
     $this->tpl->addJavaScript('Services/Mail/js/ilMailComposeFunctions.js');
     $this->tpl->show();
 }
 public function initFilter()
 {
     $this->filter = array();
     include_once 'Services/Mail/classes/Form/class.ilMailQuickFilterInputGUI.php';
     $ti = new ilMailQuickFilterInputGUI($this->lng->txt('mail_filter'), 'mail_filter');
     $ti->setSubmitFormOnEnter(false);
     $this->addFilterItem($ti);
     $ti->readFromSession();
     $this->filter['mail_filter'] = $ti->getValue();
     include_once 'Services/Form/classes/class.ilCheckboxInputGUI.php';
     if ($this->isDraftFolder() || $this->isSentFolder()) {
         $this->sub_filter[] = $ci = new ilCheckboxInputGUI($this->lng->txt('mail_filter_recipients'), 'mail_filter_recipients');
         $ci->setOptionTitle($this->lng->txt('mail_filter_recipients'));
         $ci->setValue(1);
         $ti->addSubItem($ci);
         $ci->setParent($this);
         $ci->readFromSession();
         $this->filter['mail_filter_recipients'] = (int) $ci->getChecked();
     } else {
         $this->sub_filter[] = $ci = new ilCheckboxInputGUI($this->lng->txt('mail_filter_sender'), 'mail_filter_sender');
         $ci->setOptionTitle($this->lng->txt('mail_filter_sender'));
         $ci->setValue(1);
         $ti->addSubItem($ci);
         $ci->setParent($this);
         $ci->readFromSession();
         $this->filter['mail_filter_sender'] = (int) $ci->getChecked();
     }
     $this->sub_filter[] = $ci = new ilCheckboxInputGUI($this->lng->txt('mail_filter_subject'), 'mail_filter_subject');
     $ci->setOptionTitle($this->lng->txt('mail_filter_subject'));
     $ci->setValue(1);
     $ti->addSubItem($ci);
     $ci->setParent($this);
     $ci->readFromSession();
     $this->filter['mail_filter_subject'] = (int) $ci->getChecked();
     $this->sub_filter[] = $ci = new ilCheckboxInputGUI($this->lng->txt('mail_filter_body'), 'mail_filter_body');
     $ci->setOptionTitle($this->lng->txt('mail_filter_body'));
     $ci->setValue(1);
     $ti->addSubItem($ci);
     $ci->setParent($this);
     $ci->readFromSession();
     $this->filter['mail_filter_body'] = (int) $ci->getChecked();
     $this->sub_filter[] = $ci = new ilCheckboxInputGUI($this->lng->txt('mail_filter_attach'), 'mail_filter_attach');
     $ci->setOptionTitle($this->lng->txt('mail_filter_attach'));
     $ci->setValue(1);
     $ti->addSubItem($ci);
     $ci->setParent($this);
     $ci->readFromSession();
     $this->filter['mail_filter_attach'] = (int) $ci->getChecked();
 }
 /**
  * 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);
 }
 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;
 }
 public function BillingMailObject()
 {
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment');
     $this->tpl->addJavaScript('Services/Mail/js/ilMailComposeFunctions.js');
     $form_gui = new ilPropertyFormGUI();
     $form_gui->setFormAction($this->ctrl->getFormAction($this, 'savebillingmail'));
     $form_gui->setTitle($this->lng->txt('billing_mail'));
     // MESSAGE
     $inp = new ilTextAreaInputGUI($this->lng->txt('message_content'), 'm_message');
     $inp->setValue(ilPaymentSettings::getMailBillingText());
     $inp->setRequired(false);
     $inp->setCols(60);
     $inp->setRows(10);
     // PLACEHOLDERS
     $chb = new ilCheckboxInputGUI($this->lng->txt('activate_placeholders'), 'use_placeholders');
     $chb->setOptionTitle($this->lng->txt('activate_placeholders'));
     $chb->setValue(1);
     $chb->setChecked(ilPaymentSettings::getMailUsePlaceholders());
     $form_gui->addItem($inp);
     include_once 'Services/Payment/classes/class.ilBillingMailPlaceholdersPropertyGUI.php';
     $prop = new ilBillingMailPlaceholdersPropertyGUI();
     $chb->addSubItem($prop);
     $chb->setChecked(true);
     $form_gui->addItem($chb);
     $form_gui->addCommandButton('saveBillingMail', $this->lng->txt('save'));
     $this->tpl->setVariable('FORM', $form_gui->getHTML());
     return true;
 }
Пример #25
0
 /**
  * Allows to add suggested solutions for questions
  *
  * @access public
  */
 public function suggestedsolution()
 {
     global $ilUser;
     global $ilAccess;
     if ($_POST["deleteSuggestedSolution"] == 1) {
         $this->object->deleteSuggestedSolutions();
         ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
         $this->ctrl->redirect($this, "suggestedsolution");
     }
     $save = is_array($_POST["cmd"]) && array_key_exists("suggestedsolution", $_POST["cmd"]) ? TRUE : FALSE;
     $output = "";
     $solution_array = $this->object->getSuggestedSolution(0);
     $options = array("lm" => $this->lng->txt("obj_lm"), "st" => $this->lng->txt("obj_st"), "pg" => $this->lng->txt("obj_pg"), "git" => $this->lng->txt("glossary_term"), "file" => $this->lng->txt("fileDownload"), "text" => $this->lng->txt("solutionText"));
     if (strcmp($_POST["solutiontype"], "file") == 0 && strcmp($solution_array["type"], "file") != 0) {
         $solution_array = array("type" => "file");
     } elseif (strcmp($_POST["solutiontype"], "text") == 0 && strcmp($solution_array["type"], "text") != 0) {
         $solution_array = array("type" => "text", "value" => $this->getSolutionOutput(0, NULL, FALSE, FALSE, TRUE, FALSE, TRUE));
     }
     if ($save && strlen($_POST["filename"])) {
         $solution_array["value"]["filename"] = $_POST["filename"];
     }
     if ($save && strlen($_POST["solutiontext"])) {
         $solution_array["value"] = $_POST["solutiontext"];
     }
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     if (count($solution_array)) {
         $form = new ilPropertyFormGUI();
         $form->setFormAction($this->ctrl->getFormAction($this));
         $form->setTitle($this->lng->txt("solution_hint"));
         $form->setMultipart(TRUE);
         $form->setTableWidth("100%");
         $form->setId("suggestedsolutiondisplay");
         // suggested solution output
         include_once "./Modules/TestQuestionPool/classes/class.ilSolutionTitleInputGUI.php";
         $title = new ilSolutionTitleInputGUI($this->lng->txt("showSuggestedSolution"), "solutiontype");
         $template = new ilTemplate("tpl.il_as_qpl_suggested_solution_input_presentation.html", TRUE, TRUE, "Modules/TestQuestionPool");
         if (strlen($solution_array["internal_link"])) {
             $href = assQuestion::_getInternalLinkHref($solution_array["internal_link"]);
             $template->setCurrentBlock("preview");
             $template->setVariable("TEXT_SOLUTION", $this->lng->txt("suggested_solution"));
             $template->setVariable("VALUE_SOLUTION", " <a href=\"{$href}\" target=\"content\">" . $this->lng->txt("view") . "</a> ");
             $template->parseCurrentBlock();
         } elseif (strcmp($solution_array["type"], "file") == 0 && is_array($solution_array["value"])) {
             $href = $this->object->getSuggestedSolutionPathWeb() . $solution_array["value"]["name"];
             $template->setCurrentBlock("preview");
             $template->setVariable("TEXT_SOLUTION", $this->lng->txt("suggested_solution"));
             $template->setVariable("VALUE_SOLUTION", " <a href=\"{$href}\" target=\"content\">" . ilUtil::prepareFormOutput(strlen($solution_array["value"]["filename"]) ? $solution_array["value"]["filename"] : $solution_array["value"]["name"]) . "</a> ");
             $template->parseCurrentBlock();
         }
         $template->setVariable("TEXT_TYPE", $this->lng->txt("type"));
         $template->setVariable("VALUE_TYPE", $options[$solution_array["type"]]);
         $title->setHtml($template->get());
         $deletesolution = new ilCheckboxInputGUI("", "deleteSuggestedSolution");
         $deletesolution->setOptionTitle($this->lng->txt("deleteSuggestedSolution"));
         $title->addSubItem($deletesolution);
         $form->addItem($title);
         if (strcmp($solution_array["type"], "file") == 0) {
             // file
             $file = new ilFileInputGUI($this->lng->txt("fileDownload"), "file");
             $file->setRequired(TRUE);
             $file->enableFileNameSelection("filename");
             //$file->setSuffixes(array("doc","xls","png","jpg","gif","pdf"));
             if ($_FILES["file"]["tmp_name"] && $file->checkInput()) {
                 if (!file_exists($this->object->getSuggestedSolutionPath())) {
                     ilUtil::makeDirParents($this->object->getSuggestedSolutionPath());
                 }
                 $res = ilUtil::moveUploadedFile($_FILES["file"]["tmp_name"], $_FILES["file"]["name"], $this->object->getSuggestedSolutionPath() . $_FILES["file"]["name"]);
                 if ($res) {
                     ilUtil::renameExecutables($this->object->getSuggestedSolutionPath());
                     // remove an old file download
                     if (is_array($solution_array["value"])) {
                         @unlink($this->object->getSuggestedSolutionPath() . $solution_array["value"]["name"]);
                     }
                     $file->setValue($_FILES["file"]["name"]);
                     $this->object->saveSuggestedSolution("file", "", 0, array("name" => $_FILES["file"]["name"], "type" => $_FILES["file"]["type"], "size" => $_FILES["file"]["size"], "filename" => $_POST["filename"]));
                     $originalexists = $this->object->_questionExistsInPool($this->object->original_id);
                     if (($_GET["calling_test"] || isset($_GET['calling_consumer']) && (int) $_GET['calling_consumer']) && $originalexists && assQuestion::_isWriteable($this->object->original_id, $ilUser->getId())) {
                         return $this->originalSyncForm("suggestedsolution");
                     } else {
                         ilUtil::sendSuccess($this->lng->txt("suggested_solution_added_successfully"), TRUE);
                         $this->ctrl->redirect($this, "suggestedsolution");
                     }
                 } else {
                     // BH: $res as info string? wtf? it holds a bool or something else!!?
                     ilUtil::sendInfo($res);
                 }
             } else {
                 if (is_array($solution_array["value"])) {
                     $file->setValue($solution_array["value"]["name"]);
                     $file->setFilename(strlen($solution_array["value"]["filename"]) ? $solution_array["value"]["filename"] : $solution_array["value"]["name"]);
                 }
             }
             $form->addItem($file);
             $hidden = new ilHiddenInputGUI("solutiontype");
             $hidden->setValue("file");
             $form->addItem($hidden);
         } else {
             if (strcmp($solution_array["type"], "text") == 0) {
                 $question = new ilTextAreaInputGUI($this->lng->txt("solutionText"), "solutiontext");
                 $question->setValue($this->object->prepareTextareaOutput($solution_array["value"]));
                 $question->setRequired(TRUE);
                 $question->setRows(10);
                 $question->setCols(80);
                 $question->setUseRte(TRUE);
                 $question->addPlugin("latex");
                 $question->addButton("latex");
                 $question->setRTESupport($this->object->getId(), "qpl", "assessment");
                 $hidden = new ilHiddenInputGUI("solutiontype");
                 $hidden->setValue("text");
                 $form->addItem($hidden);
                 $form->addItem($question);
             }
         }
         if ($ilAccess->checkAccess("write", "", $_GET['ref_id'])) {
             $form->addCommandButton("suggestedsolution", $this->lng->txt("save"));
         }
         if ($save) {
             if ($form->checkInput()) {
                 switch ($solution_array["type"]) {
                     case "file":
                         $this->object->saveSuggestedSolution("file", "", 0, array("name" => $solution_array["value"]["name"], "type" => $solution_array["value"]["type"], "size" => $solution_array["value"]["size"], "filename" => $_POST["filename"]));
                         break;
                     case "text":
                         $this->object->saveSuggestedSolution("text", "", 0, $solution_array["value"]);
                         break;
                 }
                 $originalexists = $this->object->_questionExistsInPool($this->object->original_id);
                 if (($_GET["calling_test"] || isset($_GET['calling_consumer']) && (int) $_GET['calling_consumer']) && $originalexists && assQuestion::_isWriteable($this->object->original_id, $ilUser->getId())) {
                     return $this->originalSyncForm("suggestedsolution");
                 } else {
                     ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
                     $this->ctrl->redirect($this, "suggestedsolution");
                 }
             }
         }
         $output = $form->getHTML();
     }
     $savechange = strcmp($this->ctrl->getCmd(), "saveSuggestedSolution") == 0 ? TRUE : FALSE;
     $changeoutput = "";
     if ($ilAccess->checkAccess("write", "", $_GET['ref_id'])) {
         $formchange = new ilPropertyFormGUI();
         $formchange->setFormAction($this->ctrl->getFormAction($this));
         $formchange->setTitle(count($solution_array) ? $this->lng->txt("changeSuggestedSolution") : $this->lng->txt("addSuggestedSolution"));
         $formchange->setMultipart(FALSE);
         $formchange->setTableWidth("100%");
         $formchange->setId("suggestedsolution");
         $solutiontype = new ilRadioGroupInputGUI($this->lng->txt("suggestedSolutionType"), "solutiontype");
         foreach ($options as $opt_value => $opt_caption) {
             $solutiontype->addOption(new ilRadioOption($opt_caption, $opt_value));
         }
         if (count($solution_array)) {
             $solutiontype->setValue($solution_array["type"]);
         }
         $solutiontype->setRequired(TRUE);
         $formchange->addItem($solutiontype);
         $formchange->addCommandButton("saveSuggestedSolution", $this->lng->txt("select"));
         if ($savechange) {
             $formchange->checkInput();
         }
         $changeoutput = $formchange->getHTML();
     }
     $this->tpl->setVariable("ADM_CONTENT", $changeoutput . $output);
 }
Пример #26
0
 /**
  * Init settings form
  */
 protected function initSettingsForm()
 {
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->setTitle($this->lng->txt('crs_loc_settings_tbl'));
     // initial test
     $type_selector = new ilRadioGroupInputGUI($this->lng->txt('crs_loc_settings_it_type'), 'ittype');
     $type_selector->setRequired(TRUE);
     $type_selector->setValue($this->getSettings()->getInitialTestType());
     $type_ipa = new ilRadioOption($this->lng->txt('crs_loc_settings_type_it_placement_all'), ilLOSettings::TYPE_INITIAL_PLACEMENT_ALL);
     $type_selector->addOption($type_ipa);
     $start_ip = new ilCheckboxInputGUI($this->lng->txt('crs_loc_settings_it_start_object'), 'start_ip');
     $start_ip->setValue(1);
     $start_ip->setChecked($this->getSettings()->isInitialTestStart());
     $type_ipa->addSubItem($start_ip);
     $type_ips = new ilRadioOption($this->lng->txt('crs_loc_settings_type_it_placement_sel'), ilLOSettings::TYPE_INITIAL_PLACEMENT_SELECTED);
     $type_selector->addOption($type_ips);
     $type_iqa = new ilRadioOption($this->lng->txt('crs_loc_settings_type_it_qualifying_all'), ilLOSettings::TYPE_INITIAL_QUALIFYING_ALL);
     $type_selector->addOption($type_iqa);
     $start_iq = new ilCheckboxInputGUI($this->lng->txt('crs_loc_settings_it_start_object'), 'start_iq');
     $start_iq->setValue(1);
     $start_iq->setChecked($this->getSettings()->isInitialTestStart());
     $type_iqa->addSubItem($start_iq);
     $type_iqs = new ilRadioOption($this->lng->txt('crs_loc_settings_type_it_qualifying_sel'), ilLOSettings::TYPE_INITIAL_QUALIFYING_SELECTED);
     $type_selector->addOption($type_iqs);
     $type_ino = new ilRadioOption($this->lng->txt('crs_loc_settings_type_it_none'), ilLOSettings::TYPE_INITIAL_NONE);
     $type_selector->addOption($type_ino);
     $form->addItem($type_selector);
     // qualifying test
     $qt_selector = new ilRadioGroupInputGUI($this->lng->txt('crs_loc_settings_qt_all'), 'qttype');
     $qt_selector->setRequired(TRUE);
     $qt_selector->setValue($this->getSettings()->getQualifyingTestType());
     $type_qa = new ilRadioOption($this->lng->txt('crs_loc_settings_type_q_all'), ilLOSettings::TYPE_QUALIFYING_ALL);
     $qt_selector->addOption($type_qa);
     $start_q = new ilCheckboxInputGUI($this->lng->txt('crs_loc_settings_qt_start_object'), 'start_q');
     $start_q->setValue(1);
     $start_q->setChecked($this->getSettings()->isQualifyingTestStart());
     $type_qa->addSubItem($start_q);
     $passed_mode = new ilRadioGroupInputGUI($this->lng->txt('crs_loc_settings_passed_mode'), 'passed_mode');
     $passed_mode->setValue($this->getSettings()->getPassedObjectiveMode());
     $passed_mode->addOption(new ilRadioOption($this->lng->txt('crs_loc_settings_passed_mode_hide'), ilLOSettings::HIDE_PASSED_OBJECTIVE_QST));
     $passed_mode->addOption(new ilRadioOption($this->lng->txt('crs_loc_settings_passed_mode_mark'), ilLOSettings::MARK_PASSED_OBJECTIVE_QST));
     $type_qa->addSubItem($passed_mode);
     $type_qs = new ilRadioOption($this->lng->txt('crs_loc_settings_type_q_selected'), ilLOSettings::TYPE_QUALIFYING_SELECTED);
     $qt_selector->addOption($type_qs);
     $form->addItem($qt_selector);
     // reset results
     $reset = new ilCheckboxInputGUI($this->lng->txt('crs_loc_settings_reset'), 'reset');
     $reset->setValue(1);
     $reset->setChecked($this->getSettings()->isResetResultsEnabled());
     $reset->setOptionTitle($this->lng->txt('crs_loc_settings_reset_enable'));
     $reset->setInfo($this->lng->txt('crs_loc_settings_reset_enable_info'));
     $form->addItem($reset);
     $form->addCommandButton('saveSettings', $this->lng->txt('save'));
     return $form;
 }
 function linkChecker()
 {
     global $ilias, $ilUser, $tpl;
     $this->__initLinkChecker();
     $this->setTabs();
     $this->setContentSubTabs("link_check");
     require_once './Services/LinkChecker/classes/class.ilLinkCheckerTableGUI.php';
     $toolbar = new ilToolbarGUI();
     if ((bool) $ilias->getSetting('cron_web_resource_check')) {
         include_once './Services/LinkChecker/classes/class.ilLinkCheckNotify.php';
         include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
         $chb = new ilCheckboxInputGUI($this->lng->txt('link_check_message_a'), 'link_check_message');
         $chb->setValue(1);
         $chb->setChecked((bool) ilLinkCheckNotify::_getNotifyStatus($ilUser->getId(), $this->object->getId()));
         $chb->setOptionTitle($this->lng->txt('link_check_message_b'));
         $toolbar->addInputItem($chb);
         $toolbar->addFormButton($this->lng->txt('save'), 'saveLinkCheck');
         $toolbar->setFormAction($this->ctrl->getLinkTarget($this, 'saveLinkCheck'));
     }
     $tgui = new ilLinkCheckerTableGUI($this, 'linkChecker');
     $tgui->setLinkChecker($this->link_checker_obj)->setRowHandler($this)->setRefreshButton($this->lng->txt('refresh'), 'refreshLinkCheck');
     return $tpl->setContent($tgui->prepareHTML()->getHTML() . $toolbar->getHTML());
 }
Пример #28
0
 /**
  * Init settings form.
  */
 public function initSettingsForm()
 {
     global $lng, $ilCtrl, $ilAccess;
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form = new ilPropertyFormGUI();
     // title
     $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
     $ti->setSize(min(40, ilObject::TITLE_LENGTH));
     $ti->setMaxLength(ilObject::TITLE_LENGTH);
     $ti->setRequired(true);
     $this->form->addItem($ti);
     // description
     $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
     $ta->setCols(40);
     $ta->setRows(2);
     $this->form->addItem($ta);
     // online
     $cb = new ilCheckboxInputGUI($lng->txt("cont_online"), "cobj_online");
     $cb->setOptionTitle($lng->txt(""));
     $cb->setValue("y");
     $this->form->addItem($cb);
     // startfile
     require_once "./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php";
     $startfile = ilObjFileBasedLMAccess::_determineStartUrl($this->object->getId());
     $ne = new ilNonEditableValueGUI($lng->txt("cont_startfile"), "");
     if ($startfile != "") {
         $ne->setValue(basename($startfile));
     } else {
         $ne->setValue(basename($this->lng->txt("no_start_file")));
     }
     $this->form->addItem($ne);
     include_once "Services/License/classes/class.ilLicenseAccess.php";
     if (ilLicenseAccess::_isEnabled()) {
         $lic = new ilCheckboxInputGUI($lng->txt("cont_license"), "lic");
         $lic->setInfo($lng->txt("cont_license_info"));
         $this->form->addItem($lic);
         if (!$ilAccess->checkAccess('edit_permission', '', $this->ref_id)) {
             $lic->setDisabled(true);
         }
     }
     $bib = new ilCheckboxInputGUI($lng->txt("cont_biblio"), "bib");
     $bib->setInfo($lng->txt("cont_biblio_info"));
     $this->form->addItem($bib);
     $this->form->addCommandButton("saveProperties", $lng->txt("save"));
     $this->form->addCommandButton("toFilesystem", $lng->txt("cont_set_start_file"));
     $this->form->setTitle($lng->txt("cont_lm_properties"));
     $this->form->setFormAction($ilCtrl->getFormAction($this, "saveProperties"));
 }
 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);
 }
Пример #30
0
 /**
  * Init Form 
  *
  * @access protected
  */
 protected function initForm($a_mode)
 {
     global $ilUser;
     if (is_object($this->form)) {
         return true;
     }
     $this->lng->loadLanguageModule('dateplaner');
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     include_once './Services/YUI/classes/class.ilYuiUtil.php';
     ilYuiUtil::initDomEvent();
     $this->form = new ilPropertyFormGUI();
     $this->form->setMultipart(true);
     $this->form->setTableWidth('600px');
     $this->form->setFormAction($this->ctrl->getFormAction($this));
     $this->form->setMultipart(true);
     /*
     $full = new ilCheckboxInputGUI('','fulltime');
     $full->setChecked($this->object->getFirstAppointment()->enabledFulltime() ? true : false);
     $full->setOptionTitle($this->lng->txt('event_fulltime_info'));
     $full->setAdditionalAttributes('onchange="ilToggleSessionTime(this);"');
     #$this->form->addItem($full);
     */
     $this->lng->loadLanguageModule('dateplaner');
     include_once './Services/Form/classes/class.ilDateDurationInputGUI.php';
     #$this->tpl->addJavaScript('./Modules/Session/js/toggle_session_time.js');
     $this->tpl->addJavaScript('./Services/Form/js/date_duration.js');
     $dur = new ilDateDurationInputGUI($this->lng->txt('cal_fullday'), 'event');
     $dur->setStartText($this->lng->txt('event_start_date'));
     $dur->setEndText($this->lng->txt('event_end_date'));
     $dur->enableToggleFullTime($this->lng->txt('event_fulltime_info'), $this->object->getFirstAppointment()->enabledFulltime() ? true : false);
     $dur->setMinuteStepSize(5);
     $dur->setShowTime(true);
     $dur->setShowDate(true);
     $dur->setStart($this->object->getFirstAppointment()->getStart());
     $dur->setEnd($this->object->getFirstAppointment()->getEnd());
     $this->form->addItem($dur);
     /*
     // start
     $start = new ilDateTimeInputGUI($this->lng->txt('event_start_date'),'start');
     $start->setMinuteStepSize(5);
     $start->setDate($this->object->getFirstAppointment()->getStart());
     $start->setShowTime(true);
     #$this->form->addItem($start);
     
     // end
     $end = new ilDateTimeInputGUI($this->lng->txt('event_end_date'),'end');
     $end->setMinuteStepSize(5);
     $end->setDate($this->object->getFirstAppointment()->getEnd());
     $end->setShowTime(true);
     #$this->form->addItem($end);
     */
     // Recurrence
     if ($a_mode == 'create') {
         if (!is_object($this->rec)) {
             include_once './Modules/Session/classes/class.ilEventRecurrence.php';
             $this->rec = new ilEventRecurrence();
         }
         include_once './Services/Calendar/classes/Form/class.ilRecurrenceInputGUI.php';
         $rec = new ilRecurrenceInputGUI($this->lng->txt('cal_recurrences'), 'frequence');
         $rec->allowUnlimitedRecurrences(false);
         $rec->setRecurrence($this->rec);
         $this->form->addItem($rec);
     }
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('event_section_information'));
     $this->form->addItem($section);
     // title
     $title = new ilTextInputGUI($this->lng->txt('event_title'), 'title');
     $title->setValue($this->object->getTitle());
     $title->setSize(50);
     $title->setMaxLength(70);
     $this->form->addItem($title);
     // desc
     $desc = new ilTextAreaInputGUI($this->lng->txt('event_desc'), 'desc');
     $desc->setValue($this->object->getLongDescription());
     $desc->setRows(4);
     $desc->setCols(50);
     $this->form->addItem($desc);
     // location
     $desc = new ilTextAreaInputGUI($this->lng->txt('event_location'), 'location');
     $desc->setValue($this->object->getLocation());
     $desc->setRows(4);
     $desc->setCols(50);
     $this->form->addItem($desc);
     // workflow
     $details = new ilTextAreaInputGUI($this->lng->txt('event_details_workflow'), 'details');
     $details->setValue($this->object->getDetails());
     $details->setCols(50);
     $details->setRows(4);
     $this->form->addItem($details);
     // section
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('event_tutor_data'));
     $this->form->addItem($section);
     // name
     $tutor_name = new ilTextInputGUI($this->lng->txt('tutor_name'), 'tutor_name');
     $tutor_name->setValue($this->object->getName());
     $tutor_name->setSize(20);
     $tutor_name->setMaxLength(70);
     $this->form->addItem($tutor_name);
     // email
     $tutor_email = new ilTextInputGUI($this->lng->txt('tutor_email'), 'tutor_email');
     $tutor_email->setValue($this->object->getEmail());
     $tutor_email->setSize(20);
     $tutor_email->setMaxLength(70);
     $this->form->addItem($tutor_email);
     // phone
     $tutor_phone = new ilTextInputGUI($this->lng->txt('tutor_phone'), 'tutor_phone');
     $tutor_phone->setValue($this->object->getPhone());
     $tutor_phone->setSize(20);
     $tutor_phone->setMaxLength(70);
     $this->form->addItem($tutor_phone);
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('crs_further_settings'));
     $this->form->addItem($section);
     // registration
     $reg = new ilCheckboxInputGUI($this->lng->txt('event_registration'), 'registration');
     $reg->setChecked($this->object->enabledRegistration() ? true : false);
     $reg->setOptionTitle($this->lng->txt('event_registration_info'));
     $this->form->addItem($reg);
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('event_assign_files'));
     $this->form->addItem($section);
     $files = new ilFileWizardInputGUI($this->lng->txt('objs_file'), 'files');
     $files->setFilenames(array(0 => ''));
     $this->form->addItem($files);
     switch ($a_mode) {
         case 'create':
             $this->form->setTitle($this->lng->txt('event_table_create'));
             $this->form->setTitleIcon(ilUtil::getImagePath('icon_event.png'));
             $this->form->addCommandButton('save', $this->lng->txt('event_btn_add'));
             $this->form->addCommandButton('saveAndAssignMaterials', $this->lng->txt('event_btn_add_edit'));
             $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
             return true;
         case 'edit':
             $this->form->setTitle($this->lng->txt('event_table_update'));
             $this->form->setTitleIcon(ilUtil::getImagePath('icon_event.png'));
             $this->form->addCommandButton('update', $this->lng->txt('save'));
             $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
             return true;
     }
     return true;
 }