public function addToForm()
 {
     global $lng;
     $adt = $this->getADT();
     $default = false;
     if ($adt->isNull()) {
         // see ilPersonalProfileGUI::addLocationToForm()
         // use installation default
         include_once "./Services/Maps/classes/class.ilMapUtil.php";
         $def = ilMapUtil::getDefaultSettings();
         $adt->setLatitude($def["latitude"]);
         $adt->setLongitude($def["longitude"]);
         $adt->setZoom($def["zoom"]);
         $default = true;
     }
     $optional = new ilCheckboxInputGUI($this->getTitle(), $this->addToElementId("tgl"));
     if (!$default && !$adt->isNull()) {
         $optional->setChecked(true);
     }
     $loc = new ilLocationInputGUI($lng->txt("location"), $this->getElementId());
     $loc->setLongitude($adt->getLongitude());
     $loc->setLatitude($adt->getLatitude());
     $loc->setZoom($adt->getZoom());
     $optional->addSubItem($loc);
     $rad = new ilNumberInputGUI($lng->txt("form_location_radius"), $this->addToElementId("rad"));
     $rad->setSize(4);
     $rad->setSuffix($lng->txt("form_location_radius_km"));
     $rad->setValue($this->radius);
     $rad->setRequired(true);
     $optional->addSubItem($rad);
     $this->addToParentElement($optional);
 }
Exemplo n.º 2
0
 private function initForm()
 {
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $this->form = new ilPropertyFormGUI();
     $this->form->setFormAction($this->ctrl->getFormAction($this, 'save'));
     $this->form->setTitle($this->lng->txt('general_settings'));
     // Subject prefix
     $pre = new ilTextInputGUI($this->lng->txt('mail_subject_prefix'), 'mail_subject_prefix');
     $pre->setSize(12);
     $pre->setMaxLength(32);
     $pre->setInfo($this->lng->txt('mail_subject_prefix_info'));
     $this->form->addItem($pre);
     // incoming type
     include_once 'Services/Mail/classes/class.ilMailOptions.php';
     $options = array(IL_MAIL_LOCAL => $this->lng->txt('mail_incoming_local'), IL_MAIL_EMAIL => $this->lng->txt('mail_incoming_smtp'), IL_MAIL_BOTH => $this->lng->txt('mail_incoming_both'));
     $si = new ilSelectInputGUI($this->lng->txt('mail_incoming'), 'mail_incoming_mail');
     $si->setOptions($options);
     $this->ctrl->setParameterByClass('ilobjuserfoldergui', 'ref_id', USER_FOLDER_ID);
     $si->setInfo(sprintf($this->lng->txt('mail_settings_incoming_type_see_also'), $this->ctrl->getLinkTargetByClass('ilobjuserfoldergui', 'settings')));
     $this->ctrl->clearParametersByClass('ilobjuserfoldergui');
     $this->form->addItem($si);
     // noreply address
     $ti = new ilTextInputGUI($this->lng->txt('mail_external_sender_noreply'), 'mail_external_sender_noreply');
     $ti->setInfo($this->lng->txt('info_mail_external_sender_noreply'));
     $ti->setMaxLength(255);
     $this->form->addItem($ti);
     $system_sender_name = new ilTextInputGUI($this->lng->txt('mail_system_sender_name'), 'mail_system_sender_name');
     $system_sender_name->setInfo($this->lng->txt('mail_system_sender_name_info'));
     $system_sender_name->setMaxLength(255);
     $this->form->addItem($system_sender_name);
     $cb = new ilCheckboxInputGUI($this->lng->txt('mail_use_pear_mail'), 'pear_mail_enable');
     $cb->setInfo($this->lng->txt('mail_use_pear_mail_info'));
     $cb->setValue(1);
     $this->form->addItem($cb);
     // prevent smtp mails
     $cb = new ilCheckboxInputGUI($this->lng->txt('mail_prevent_smtp_globally'), 'prevent_smtp_globally');
     $cb->setValue(1);
     $this->form->addItem($cb);
     $cron_mail = new ilSelectInputGUI($this->lng->txt('cron_mail_notification'), 'mail_notification');
     $cron_options = array(0 => $this->lng->txt('cron_mail_notification_never'), 1 => $this->lng->txt('cron_mail_notification_cron'));
     $cron_mail->setOptions($cron_options);
     $cron_mail->setInfo($this->lng->txt('cron_mail_notification_desc'));
     $this->form->addItem($cron_mail);
     // section header
     $sh = new ilFormSectionHeaderGUI();
     $sh->setTitle($this->lng->txt('mail') . ' (' . $this->lng->txt('internal_system') . ')');
     $this->form->addItem($sh);
     // max attachment size
     $ti = new ilNumberInputGUI($this->lng->txt('mail_maxsize_attach'), 'mail_maxsize_attach');
     $ti->setSuffix($this->lng->txt('kb'));
     $ti->setInfo($this->lng->txt('mail_max_size_attachments_total'));
     $ti->setMaxLength(10);
     $ti->setSize(10);
     $this->form->addItem($ti);
     // Course/Group member notification
     $mn = new ilFormSectionHeaderGUI();
     $mn->setTitle($this->lng->txt('mail_member_notification'));
     $this->form->addItem($mn);
     include_once "Services/Administration/classes/class.ilAdministrationSettingsFormHandler.php";
     ilAdministrationSettingsFormHandler::addFieldsToForm(ilAdministrationSettingsFormHandler::FORM_MAIL, $this->form, $this);
     $this->form->addCommandButton('save', $this->lng->txt('save'));
 }
Exemplo n.º 3
0
 /**
  * @param ilPropertyFormGUI $form
  * @return ilPropertyFormGUI
  */
 public function populateQuestionSpecificFormPart(ilPropertyFormGUI $form)
 {
     // shuffle answers
     $shuffleAnswers = new ilCheckboxInputGUI($this->lng->txt("shuffle_answers"), "shuffle_answers_enabled");
     $shuffleAnswers->setChecked($this->object->isShuffleAnswersEnabled());
     $form->addItem($shuffleAnswers);
     if (!$this->object->getSelfAssessmentEditingMode()) {
         // answer mode (single-/multi-line)
         $answerType = new ilSelectInputGUI($this->lng->txt('answer_types'), 'answer_type');
         $answerType->setOptions($this->object->getAnswerTypeSelectOptions($this->lng));
         $answerType->setValue($this->object->getAnswerType());
         $form->addItem($answerType);
     }
     if (!$this->object->getSelfAssessmentEditingMode() && $this->object->isSingleLineAnswerType($this->object->getAnswerType())) {
         // thumb size
         $thumbSize = new ilNumberInputGUI($this->lng->txt('thumb_size'), 'thumb_size');
         $thumbSize->setSuffix($this->lng->txt("thumb_size_unit_pixel"));
         $thumbSize->setInfo($this->lng->txt('thumb_size_info'));
         $thumbSize->setDecimals(false);
         $thumbSize->setMinValue(20);
         $thumbSize->setSize(6);
         $thumbSize->setValue($this->object->getThumbSize());
         $form->addItem($thumbSize);
     }
     // option label
     $optionLabel = new ilRadioGroupInputGUI($this->lng->txt('option_label'), 'option_label');
     $optionLabel->setInfo($this->lng->txt('option_label_info'));
     $optionLabel->setRequired(true);
     $optionLabel->setValue($this->object->getOptionLabel());
     foreach ($this->object->getValidOptionLabelsTranslated($this->lng) as $labelValue => $labelText) {
         $option = new ilRadioOption($labelText, $labelValue);
         $optionLabel->addOption($option);
         if ($this->object->isCustomOptionLabel($labelValue)) {
             $customLabelTrue = new ilTextInputGUI($this->lng->txt('option_label_custom_true'), 'option_label_custom_true');
             $customLabelTrue->setValue($this->object->getCustomTrueOptionLabel());
             $option->addSubItem($customLabelTrue);
             $customLabelFalse = new ilTextInputGUI($this->lng->txt('option_label_custom_false'), 'option_label_custom_false');
             $customLabelFalse->setValue($this->object->getCustomFalseOptionLabel());
             $option->addSubItem($customLabelFalse);
         }
     }
     $form->addItem($optionLabel);
     // points
     $points = new ilNumberInputGUI($this->lng->txt('points'), 'points');
     $points->setRequired(true);
     $points->setSize(3);
     $points->allowDecimals(true);
     $points->setMinValue(0);
     $points->setMinvalueShouldBeGreater(true);
     $points->setValue($this->object->getPoints());
     $form->addItem($points);
     // score partial solution
     $scorePartialSolution = new ilCheckboxInputGUI($this->lng->txt('score_partsol_enabled'), 'score_partsol_enabled');
     $scorePartialSolution->setInfo($this->lng->txt('score_partsol_enabled_info'));
     $scorePartialSolution->setChecked($this->object->isScorePartialSolutionEnabled());
     $form->addItem($scorePartialSolution);
     return $form;
 }
Exemplo n.º 4
0
 private function formTimingObject()
 {
     global $ilAccess;
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->setTableWidth("100%");
     $form->setId("tst_change_workingtime");
     $form->setTitle($this->lng->txt("tst_change_workingtime"));
     // test users
     $participantslist = new ilSelectInputGUI($this->lng->txt('participants'), "participant");
     $participants =& $this->object->getTestParticipants();
     $times = $this->object->getStartingTimeOfParticipants();
     $addons = $this->object->getTimeExtensionsOfParticipants();
     $options = array('' => $this->lng->txt('please_select'), '0' => $this->lng->txt('all_participants'));
     foreach ($participants as $participant) {
         $started = "";
         if ($this->object->getAnonymity()) {
             $name = $this->lng->txt("anonymous");
         } else {
             $name = $participant['lastname'] . ', ' . $participant['firstname'];
         }
         if ($times[$participant['active_id']]) {
             $started = ", " . $this->lng->txt('tst_started') . ': ' . ilDatePresentation::formatDate(new ilDateTime($times[$participant['active_id']], IL_CAL_DATETIME));
         }
         if ($addons[$participant['active_id']] > 0) {
             $started .= ", " . $this->lng->txt('extratime') . ': ' . $addons[$participant['active_id']] . ' ' . $this->lng->txt('minutes');
         }
         $options[$participant['active_id']] = $participant['login'] . ' (' . $name . ')' . $started;
     }
     $participantslist->setRequired(true);
     $participantslist->setOptions($options);
     $form->addItem($participantslist);
     // extra time
     $extratime = new ilNumberInputGUI($this->lng->txt("extratime"), "extratime");
     $extratime->setInfo($this->lng->txt('tst_extratime_info'));
     $extratime->setRequired(true);
     $extratime->setMinValue(0);
     $extratime->setMinvalueShouldBeGreater(false);
     $extratime->setSuffix($this->lng->txt('minutes'));
     $extratime->setSize(5);
     $form->addItem($extratime);
     if (is_array($_POST) && strlen($_POST['cmd']['timing'])) {
         $form->setValuesByArray($_POST);
     }
     if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) {
         $form->addCommandButton("timing", $this->lng->txt("save"));
     }
     $form->addCommandButton('timingOverview', $this->lng->txt("cancel"));
     return $form;
 }
 public function populateQuestionSpecificFormPart(\ilPropertyFormGUI $form)
 {
     // shuffle
     $shuffle = new ilCheckboxInputGUI($this->lng->txt("shuffle_answers"), "shuffle");
     $shuffle->setValue(1);
     $shuffle->setChecked($this->object->getShuffle());
     $shuffle->setRequired(FALSE);
     $form->addItem($shuffle);
     if ($this->object->getId()) {
         $hidden = new ilHiddenInputGUI("", "ID");
         $hidden->setValue($this->object->getId());
         $form->addItem($hidden);
     }
     if (!$this->object->getSelfAssessmentEditingMode()) {
         $isSingleline = $this->object->lastChange == 0 && !array_key_exists('types', $_POST) ? $this->object->getMultilineAnswerSetting() ? false : true : $this->object->isSingleline;
         // Answer types
         $types = new ilSelectInputGUI($this->lng->txt("answer_types"), "types");
         $types->setRequired(false);
         $types->setValue($isSingleline ? 0 : 1);
         $types->setOptions(array(0 => $this->lng->txt('answers_singleline'), 1 => $this->lng->txt('answers_multiline')));
         $form->addItem($types);
     }
     if ($isSingleline) {
         // thumb size
         $thumb_size = new ilNumberInputGUI($this->lng->txt("thumb_size"), "thumb_size");
         $thumb_size->setSuffix($this->lng->txt("thumb_size_unit_pixel"));
         $thumb_size->setMinValue(20);
         $thumb_size->setDecimals(0);
         $thumb_size->setSize(6);
         $thumb_size->setInfo($this->lng->txt('thumb_size_info'));
         $thumb_size->setValue($this->object->getThumbSize());
         $thumb_size->setRequired(false);
         $form->addItem($thumb_size);
         return $isSingleline;
     }
     return $isSingleline;
 }
Exemplo n.º 6
0
 /**
  * @return ilPropertyFormGUI
  */
 protected function getEctsForm()
 {
     require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this, 'saveEctsForm'));
     $form->addCommandButton('saveEctsForm', $this->lng->txt('save'));
     $form->setTitle($this->lng->txt('ects_output_of_ects_grades'));
     $allow_ects_marks = new ilCheckboxInputGUI($this->lng->txt('ects_allow_ects_grades'), 'ectcs_status');
     for ($i = ord('a'); $i <= ord('e'); $i++) {
         $mark = chr($i);
         $mark_step = new ilNumberInputGUI(chr($i - 32) . ' - ' . $this->lng->txt('ects_grade_' . $mark . '_short'), 'ects_grade_' . $mark);
         $mark_step->setSize(5);
         $mark_step->allowDecimals(true);
         $mark_step->setMinValue(0, true);
         $mark_step->setMaxValue(100, true);
         $mark_step->setSuffix($this->lng->txt('percentile'));
         $mark_step->setRequired(true);
         $allow_ects_marks->addSubItem($mark_step);
     }
     $use_ects_fx = new ilCheckboxInputGUI($this->lng->txt('use_ects_fx'), 'use_ects_fx');
     $threshold = new ilNumberInputGUI($this->lng->txt('ects_fx_threshold'), 'ects_fx_threshold');
     $threshold->setInfo($this->lng->txt('ects_fx_threshold_info'));
     $threshold->setSuffix($this->lng->txt('percentile'));
     $threshold->allowDecimals(true);
     $threshold->setSize(5);
     $threshold->setRequired(true);
     $use_ects_fx->addSubItem($threshold);
     $allow_ects_marks->addSubItem($use_ects_fx);
     $form->addItem($allow_ects_marks);
     return $form;
 }
 /**
  * Build property form
  * @param	string	$a_mode
  * @param	int		$id
  * @return	object
  */
 function initForm($a_mode = "create", $id = NULL)
 {
     global $lng, $ilCtrl;
     $lng->loadLanguageModule("dateplaner");
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form_gui = new ilPropertyFormGUI();
     $title = new ilTextInputGUI($lng->txt("title"), "title");
     $title->setRequired(true);
     $title->setSize(40);
     $title->setMaxLength(120);
     $form_gui->addItem($title);
     /*
     $type = new ilRadioGroupInputGUI($lng->txt("book_schedule_type"), "type");
     $type->setRequired(true);
     $form_gui->addItem($type);
     $fix = new ilRadioOption($lng->txt("book_schedule_type_fix"), "fix");
     $fix->setInfo($lng->txt("book_schedule_type_fix_info"));
     $type->addOption($fix);
     $flex = new ilRadioOption($lng->txt("book_schedule_type_flexible"), "flexible");
     $flex->setInfo($lng->txt("book_schedule_type_flexible_info"));
     $type->addOption($flex);
     
     $raster = new ilNumberInputGUI($lng->txt("book_schedule_raster"), "raster");
     $raster->setRequired(true);
     $raster->setInfo($lng->txt("book_schedule_raster_info"));
     $raster->setMinValue(1);
     $raster->setSize(3);
     $raster->setMaxLength(3);
     $raster->setSuffix($lng->txt("book_minutes"));
     $flex->addSubItem($raster);
     
     $rent_min = new ilNumberInputGUI($lng->txt("book_schedule_rent_min"), "rent_min");
     $rent_min->setInfo($lng->txt("book_schedule_rent_info"));
     $rent_min->setMinValue(1);
     $rent_min->setSize(3);
     $rent_min->setMaxLength(3);
     $flex->addSubItem($rent_min);
     
     $rent_max = new ilNumberInputGUI($lng->txt("book_schedule_rent_max"), "rent_max");
     $rent_max->setInfo($lng->txt("book_schedule_rent_info"));
     $rent_max->setMinValue(1);
     $rent_max->setSize(3);
     $rent_max->setMaxLength(3);
     $flex->addSubItem($rent_max);
     
     $break = new ilNumberInputGUI($lng->txt("book_schedule_break"), "break");
     $break->setInfo($lng->txt("book_schedule_break_info"));
     $break->setMinValue(1);
     $break->setSize(3);
     $break->setMaxLength(3);
     $flex->addSubItem($break);
     */
     include_once "Modules/BookingManager/classes/class.ilScheduleInputGUI.php";
     $definition = new ilScheduleInputGUI($lng->txt("book_schedule_days"), "days");
     $definition->setInfo($lng->txt("book_schedule_days_info"));
     $definition->setRequired(true);
     $form_gui->addItem($definition);
     $deadline = new ilNumberInputGUI($lng->txt("book_deadline"), "deadline");
     $deadline->setInfo($lng->txt("book_deadline_info"));
     $deadline->setSuffix($lng->txt("book_hours"));
     $deadline->setMinValue(0);
     $deadline->setSize(3);
     $deadline->setMaxLength(3);
     $form_gui->addItem($deadline);
     if ($a_mode == "edit") {
         $form_gui->setTitle($lng->txt("book_edit_schedule"));
         $item = new ilHiddenInputGUI('schedule_id');
         $item->setValue($id);
         $form_gui->addItem($item);
         include_once 'Modules/BookingManager/classes/class.ilBookingSchedule.php';
         $schedule = new ilBookingSchedule($id);
         $title->setValue($schedule->getTitle());
         $deadline->setValue($schedule->getDeadline());
         /*
         if($schedule->getRaster())
         {
         	$type->setValue("flexible");
         	$raster->setValue($schedule->getRaster());
         	$rent_min->setValue($schedule->getMinRental());
         	$rent_max->setValue($schedule->getMaxRental());
         	$break->setValue($schedule->getAutoBreak());
         }
         else
         {
         	$type->setValue("fix");
         }
         */
         $definition->setValue($schedule->getDefinitionBySlots());
         $form_gui->addCommandButton("update", $lng->txt("save"));
     } else {
         $form_gui->setTitle($lng->txt("book_add_schedule"));
         $form_gui->addCommandButton("save", $lng->txt("save"));
         $form_gui->addCommandButton("render", $lng->txt("cancel"));
     }
     $form_gui->setFormAction($ilCtrl->getFormAction($this));
     return $form_gui;
 }
 private function initLoginSettingsForm()
 {
     $this->setSubTabs('settings');
     $this->tabs_gui->setTabActive('settings');
     $this->tabs_gui->setSubTabActive('loginname_settings');
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->loginSettingsForm = new ilPropertyFormGUI();
     $this->loginSettingsForm->setFormAction($this->ctrl->getFormAction($this, 'saveLoginnameSettings'));
     $this->loginSettingsForm->setTitle($this->lng->txt('loginname_settings'));
     $chbChangeLogin = new ilCheckboxInputGUI($this->lng->txt('allow_change_loginname'), 'allow_change_loginname');
     $chbChangeLogin->setValue(1);
     $this->loginSettingsForm->addItem($chbChangeLogin);
     $chbCreateHistory = new ilCheckboxInputGUI($this->lng->txt('history_loginname'), 'create_history_loginname');
     $chbCreateHistory->setInfo($this->lng->txt('loginname_history_info'));
     $chbCreateHistory->setValue(1);
     $chbChangeLogin->addSubItem($chbCreateHistory);
     $chbReuseLoginnames = new ilCheckboxInputGUI($this->lng->txt('reuse_of_loginnames_contained_in_history'), 'reuse_of_loginnames');
     $chbReuseLoginnames->setValue(1);
     $chbReuseLoginnames->setInfo($this->lng->txt('reuse_of_loginnames_contained_in_history_info'));
     $chbChangeLogin->addSubItem($chbReuseLoginnames);
     $chbChangeBlockingTime = new ilNumberInputGUI($this->lng->txt('loginname_change_blocking_time'), 'loginname_change_blocking_time');
     $chbChangeBlockingTime->allowDecimals(true);
     $chbChangeBlockingTime->setSuffix($this->lng->txt('days'));
     $chbChangeBlockingTime->setInfo($this->lng->txt('loginname_change_blocking_time_info'));
     $chbChangeBlockingTime->setSize(10);
     $chbChangeBlockingTime->setMaxLength(10);
     $chbChangeLogin->addSubItem($chbChangeBlockingTime);
     $this->loginSettingsForm->addCommandButton('saveLoginnameSettings', $this->lng->txt('save'));
 }
 protected function initSettingsForm()
 {
     global $rbacsystem;
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->setTitle($this->lng->txt('tracking_settings'));
     $activate = new ilCheckboxGroupInputGUI($this->lng->txt('activate_tracking'));
     $form->addItem($activate);
     // learning progress
     $lp = new ilCheckboxInputGUI($this->lng->txt('trac_learning_progress'), 'learning_progress_tracking');
     if ($this->object->enabledLearningProgress()) {
         $lp->setChecked(true);
     }
     $activate->addSubItem($lp);
     // lp settings
     /*
     $desktop = new ilCheckboxInputGUI($this->lng->txt('trac_lp_on_personal_desktop'), 'lp_desktop');
     $desktop->setInfo($this->lng->txt('trac_lp_on_personal_desktop_info'));
     $desktop->setChecked($this->object->hasLearningProgressDesktop());
     $lp->addSubItem($desktop);
     */
     $learner = new ilCheckboxInputGUI($this->lng->txt('trac_lp_learner_access'), 'lp_learner');
     $learner->setInfo($this->lng->txt('trac_lp_learner_access_info'));
     $learner->setChecked($this->object->hasLearningProgressLearner());
     $lp->addSubItem($learner);
     // extended data
     $extdata = new ilCheckboxGroupInputGUI($this->lng->txt('trac_learning_progress_settings_info'), 'lp_extdata');
     $extdata->addOption(new ilCheckboxOption($this->lng->txt('trac_first_and_last_access'), 'lp_access'));
     $extdata->addOption(new ilCheckboxOption($this->lng->txt('trac_read_count'), 'lp_count'));
     $extdata->addOption(new ilCheckboxOption($this->lng->txt('trac_spent_seconds'), 'lp_spent'));
     $lp->addSubItem($extdata);
     $ext_value = array();
     if ($this->object->hasExtendedData(ilObjUserTracking::EXTENDED_DATA_LAST_ACCESS)) {
         $ext_value[] = 'lp_access';
     }
     if ($this->object->hasExtendedData(ilObjUserTracking::EXTENDED_DATA_READ_COUNT)) {
         $ext_value[] = 'lp_count';
     }
     if ($this->object->hasExtendedData(ilObjUserTracking::EXTENDED_DATA_SPENT_SECONDS)) {
         $ext_value[] = 'lp_spent';
     }
     $extdata->setValue($ext_value);
     $listgui = new ilCheckboxInputGUI($this->lng->txt('trac_lp_list_gui'), 'lp_list');
     $listgui->setInfo($this->lng->txt('trac_lp_list_gui_info'));
     $listgui->setChecked($this->object->hasLearningProgressListGUI());
     $lp->addSubItem($listgui);
     /* => REPOSITORY
     		// change event
     		$event = new ilCheckboxInputGUI($this->lng->txt('trac_repository_changes'), 'change_event_tracking');
     		if($this->object->enabledChangeEventTracking())
     		{
     			$event->setChecked(true);
     		}
     		$activate->addSubItem($event);
     		*/
     // object statistics
     $objstat = new ilCheckboxInputGUI($this->lng->txt('trac_object_statistics'), 'object_statistics');
     if ($this->object->enabledObjectStatistics()) {
         $objstat->setChecked(true);
     }
     $activate->addSubItem($objstat);
     // session statistics
     $sessstat = new ilCheckboxInputGUI($this->lng->txt('session_statistics'), 'session_statistics');
     if ($this->object->enabledSessionStatistics()) {
         $sessstat->setChecked(true);
     }
     $activate->addSubItem($sessstat);
     // Anonymized
     $user = new ilCheckboxInputGUI($this->lng->txt('trac_anonymized'), 'user_related');
     $user->setInfo($this->lng->txt('trac_anonymized_info'));
     $user->setChecked(!$this->object->enabledUserRelatedData());
     $form->addItem($user);
     // Max time gap
     $valid = new ilNumberInputGUI($this->lng->txt('trac_valid_request'), 'valid_request');
     $valid->setMaxLength(4);
     $valid->setSize(4);
     $valid->setSuffix($this->lng->txt('seconds'));
     $valid->setInfo($this->lng->txt('info_valid_request'));
     $valid->setValue($this->object->getValidTimeSpan());
     $valid->setMinValue(1);
     $valid->setMaxValue(9999);
     $valid->setRequired(true);
     $form->addItem($valid);
     include_once "Services/Administration/classes/class.ilAdministrationSettingsFormHandler.php";
     ilAdministrationSettingsFormHandler::addFieldsToForm(ilAdministrationSettingsFormHandler::FORM_LP, $form, $this);
     // #12259
     if ($rbacsystem->checkAccess("write", $this->object->getRefId())) {
         $form->addCommandButton('saveSettings', $this->lng->txt('save'));
     } else {
         $lp->setDisabled(true);
         $learner->setDisabled(true);
         $extdata->setDisabled(true);
         $listgui->setDisabled(true);
         $objstat->setDisabled(true);
         $user->setDisabled(true);
         $valid->setDisabled(true);
     }
     return $form;
 }
 /**
  * @param ilPropertyFormGUI $form
  */
 private function addTestRunProperties(ilPropertyFormGUI $form)
 {
     // section header test run
     $header = new ilFormSectionHeaderGUI();
     $header->setTitle($this->lng->txt("tst_settings_header_test_run"));
     $form->addItem($header);
     // max. number of passes
     $limitPasses = new ilCheckboxInputGUI($this->lng->txt("tst_limit_nr_of_tries"), 'limitPasses');
     $limitPasses->setInfo($this->lng->txt("tst_nr_of_tries_desc"));
     $limitPasses->setChecked($this->testOBJ->getNrOfTries() > 0);
     $nr_of_tries = new ilNumberInputGUI($this->lng->txt("tst_nr_of_tries"), "nr_of_tries");
     $nr_of_tries->setSize(3);
     $nr_of_tries->allowDecimals(false);
     $nr_of_tries->setMinValue(1);
     $nr_of_tries->setMinvalueShouldBeGreater(false);
     $nr_of_tries->setValue($this->testOBJ->getNrOfTries() ? $this->testOBJ->getNrOfTries() : 1);
     $nr_of_tries->setRequired(true);
     if ($this->testOBJ->participantDataExist()) {
         $limitPasses->setDisabled(true);
         $nr_of_tries->setDisabled(true);
     }
     $limitPasses->addSubItem($nr_of_tries);
     $form->addItem($limitPasses);
     // enable max. processing time
     $processing = new ilCheckboxInputGUI($this->lng->txt("tst_processing_time"), "chb_processing_time");
     $processing->setInfo($this->lng->txt("tst_processing_time_desc"));
     $processing->setValue(1);
     if ($this->settingsTemplate && $this->getTemplateSettingValue('chb_processing_time')) {
         $processing->setChecked(true);
     } else {
         $processing->setChecked($this->testOBJ->getEnableProcessingTime());
     }
     // max. processing time
     $processingtime = new ilNumberInputGUI($this->lng->txt("tst_processing_time_duration"), 'processing_time');
     $processingtime->allowDecimals(false);
     $processingtime->setMinValue(1);
     $processingtime->setMinvalueShouldBeGreater(false);
     $processingtime->setValue($this->testOBJ->getProcessingTimeAsMinutes());
     $processingtime->setSize(5);
     $processingtime->setSuffix($this->lng->txt('minutes'));
     $processingtime->setInfo($this->lng->txt("tst_processing_time_duration_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);
     // 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', ''));
     $values = array();
     if ($this->testOBJ->getShowKioskModeTitle()) {
         array_push($values, 'kiosk_title');
     }
     if ($this->testOBJ->getShowKioskModeParticipant()) {
         array_push($values, 'kiosk_participant');
     }
     $kiosktitle->setValue($values);
     $kiosktitle->setInfo($this->lng->txt("kiosk_options_desc"));
     $kiosk->addSubItem($kiosktitle);
     $form->addItem($kiosk);
     $examIdInPass = new ilCheckboxInputGUI($this->lng->txt('examid_in_test_pass'), 'examid_in_test_pass');
     $examIdInPass->setInfo($this->lng->txt('examid_in_test_pass_desc'));
     $examIdInPass->setChecked($this->testOBJ->isShowExamIdInTestPassEnabled());
     $form->addItem($examIdInPass);
 }
Exemplo n.º 11
0
 /**
  * Init settings form
  */
 protected function initSettingsForm()
 {
     global $ilCtrl;
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setFormAction($ilCtrl->getFormAction($this));
     $form->setTitle($GLOBALS['lng']->txt('settings'));
     $form->addCommandButton('update', $GLOBALS['lng']->txt('save'));
     $form->addCommandButton('settings', $GLOBALS['lng']->txt('cancel'));
     // activation
     $active = new ilCheckboxInputGUI($GLOBALS['lng']->txt('fm_settings_active'), 'active');
     $active->setInfo($GLOBALS['lng']->txt('fm_settings_active_info'));
     $active->setValue(1);
     $active->setChecked(ilFMSettings::getInstance()->isEnabled());
     $form->addItem($active);
     // one frame
     $local = new ilCheckboxInputGUI($GLOBALS['lng']->txt('fm_settings_local'), 'local');
     $local->setInfo($GLOBALS['lng']->txt('fm_settings_local_info'));
     $local->setValue(1);
     $local->setChecked(ilFMSettings::getInstance()->IsLocalFSEnabled());
     $form->addItem($local);
     $fs = new ilNumberInputGUI($GLOBALS['lng']->txt('fm_settings_filesize'), 'filesize');
     $fs->setSuffix('MiB');
     $fs->setSize(3);
     $fs->setMaxLength(3);
     $fs->setMinValue(1);
     $fs->setMaxValue(999);
     $fs->setInfo($GLOBALS['lng']->txt('fm_settings_filesize_info'));
     $fs->setValue(ilFMSettings::getInstance()->getMaxFileSize());
     $form->addItem($fs);
     return $form;
 }
Exemplo n.º 12
0
 protected function initEditCustomForm(ilPropertyFormGUI $a_form)
 {
     global $lng, $ilSetting;
     $this->setSettingsSubTabs("properties");
     if ($this->id_type == self::REPOSITORY_NODE_ID) {
         $appr = new ilCheckboxInputGUI($lng->txt("blog_enable_approval"), "approval");
         $appr->setInfo($lng->txt("blog_enable_approval_info"));
         $a_form->addItem($appr);
     }
     $notes = new ilCheckboxInputGUI($lng->txt("blog_enable_notes"), "notes");
     $a_form->addItem($notes);
     if ($ilSetting->get('enable_global_profiles')) {
         $rss = new ilCheckboxInputGUI($lng->txt("blog_enable_rss"), "rss");
         $rss->setInfo($lng->txt("blog_enable_rss_info"));
         $a_form->addItem($rss);
     }
     // navigation
     $nav = new ilFormSectionHeaderGUI();
     $nav->setTitle($lng->txt("blog_settings_navigation"));
     $a_form->addItem($nav);
     $nav_mode = new ilRadioGroupInputGUI($lng->txt("blog_nav_mode"), "nav");
     $nav_mode->setRequired(true);
     $a_form->addItem($nav_mode);
     $opt = new ilRadioOption($lng->txt("blog_nav_mode_month_list"), ilObjBlog::NAV_MODE_LIST);
     $opt->setInfo($lng->txt("blog_nav_mode_month_list_info"));
     $nav_mode->addOption($opt);
     $detail_num = new ilNumberInputGUI($lng->txt("blog_nav_mode_month_list_num_detail"), "nav_list_detail");
     $detail_num->setInfo($lng->txt("blog_nav_mode_month_list_num_detail_info"));
     $detail_num->setRequired(true);
     $detail_num->setSize(3);
     $detail_num->setMinValue(0);
     $opt->addSubItem($detail_num);
     $mon_num = new ilNumberInputGUI($lng->txt("blog_nav_mode_month_list_num_month"), "nav_list_mon");
     $mon_num->setInfo($lng->txt("blog_nav_mode_month_list_num_month_info"));
     $mon_num->setSize(3);
     $mon_num->setMinValue(1);
     $opt->addSubItem($mon_num);
     $opt = new ilRadioOption($lng->txt("blog_nav_mode_month_single"), ilObjBlog::NAV_MODE_MONTH);
     $opt->setInfo($lng->txt("blog_nav_mode_month_single_info"));
     $nav_mode->addOption($opt);
     $order_options = array();
     if ($this->object->getOrder()) {
         foreach ($this->object->getOrder() as $item) {
             $order_options[] = $lng->txt("blog_" . $item);
         }
     }
     if (!in_array($lng->txt("blog_navigation"), $order_options)) {
         $order_options[] = $lng->txt("blog_navigation");
     }
     if ($this->id_type == self::REPOSITORY_NODE_ID) {
         if (!in_array($lng->txt("blog_authors"), $order_options)) {
             $order_options[] = $lng->txt("blog_authors");
         }
         $auth = new ilCheckboxInputGUI($lng->txt("blog_enable_nav_authors"), "nav_authors");
         $auth->setInfo($lng->txt("blog_enable_nav_authors_info"));
         $a_form->addItem($auth);
     }
     $keyw = new ilCheckboxInputGUI($lng->txt("blog_enable_keywords"), "keywords");
     $keyw->setInfo($lng->txt("blog_enable_keywords_info"));
     $a_form->addItem($keyw);
     if (!in_array($lng->txt("blog_keywords"), $order_options)) {
         $order_options[] = $lng->txt("blog_keywords");
     }
     $order = new ilNonEditableValueGUI($lng->txt("blog_nav_sortorder"), "order");
     $order->setMultiValues($order_options);
     $order->setValue(array_shift($order_options));
     $order->setMulti(true, true, false);
     $a_form->addItem($order);
     // presentation (frame)
     $pres = new ilFormSectionHeaderGUI();
     $pres->setTitle($lng->txt("blog_presentation_frame"));
     $a_form->addItem($pres);
     $ppic = new ilCheckboxInputGUI($lng->txt("blog_profile_picture"), "ppic");
     $a_form->addItem($ppic);
     if ($this->id_type == self::REPOSITORY_NODE_ID) {
         $ppic->setInfo($lng->txt("blog_profile_picture_repository_info"));
     }
     $blga_set = new ilSetting("blga");
     if ($blga_set->get("banner")) {
         include_once "Services/Form/classes/class.ilFileInputGUI.php";
         ilFileInputGUI::setPersonalWorkspaceQuotaCheck(true);
         $dimensions = " (" . $blga_set->get("banner_width") . "x" . $blga_set->get("banner_height") . ")";
         $img = new ilImageFileInputGUI($lng->txt("blog_banner") . $dimensions, "banner");
         $a_form->addItem($img);
         // show existing file
         $file = $this->object->getImageFullPath(true);
         if ($file) {
             $img->setImage($file);
         }
     }
     /* #15000
     		$bg_color = new ilColorPickerInputGUI($lng->txt("blog_background_color"), "bg_color");
     		$a_form->addItem($bg_color);
     
     		$font_color = new ilColorPickerInputGUI($lng->txt("blog_font_color"), "font_color");
     		$a_form->addItem($font_color);	
     		*/
     // presentation (overview)
     $list = new ilFormSectionHeaderGUI();
     $list->setTitle($lng->txt("blog_presentation_overview"));
     $a_form->addItem($list);
     $post_num = new ilNumberInputGUI($lng->txt("blog_list_num_postings"), "ov_list_post_num");
     $post_num->setInfo($lng->txt("blog_list_num_postings_info"));
     $post_num->setSize(3);
     $post_num->setMinValue(1);
     $post_num->setRequired(true);
     $a_form->addItem($post_num);
     $abs_shorten = new ilCheckboxInputGUI($lng->txt("blog_abstract_shorten"), "abss");
     $a_form->addItem($abs_shorten);
     $abs_shorten_len = new ilNumberInputGUI($lng->txt("blog_abstract_shorten_length"), "abssl");
     $abs_shorten_len->setSize(5);
     $abs_shorten_len->setRequired(true);
     $abs_shorten_len->setSuffix($lng->txt("blog_abstract_shorten_characters"));
     $abs_shorten_len->setMinValue(50, true);
     $abs_shorten->addSubItem($abs_shorten_len);
     $abs_img = new ilCheckboxInputGUI($lng->txt("blog_abstract_image"), "absi");
     $abs_img->setInfo($lng->txt("blog_abstract_image_info"));
     $a_form->addItem($abs_img);
     $abs_img_width = new ilNumberInputGUI($lng->txt("blog_abstract_image_width"), "absiw");
     $abs_img_width->setSize(5);
     $abs_img_width->setRequired(true);
     $abs_img_width->setSuffix($lng->txt("blog_abstract_image_pixels"));
     $abs_img_width->setMinValue(32, true);
     $abs_img->addSubItem($abs_img_width);
     $abs_img_height = new ilNumberInputGUI($lng->txt("blog_abstract_image_height"), "absih");
     $abs_img_height->setSize(5);
     $abs_img_height->setRequired(true);
     $abs_img_height->setSuffix($lng->txt("blog_abstract_image_pixels"));
     $abs_img_height->setMinValue(32, true);
     $abs_img->addSubItem($abs_img_height);
 }
 function initForm()
 {
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $this->form_gui = new ilPropertyFormGUI();
     $this->form_gui->setFormAction($this->ctrl->getFormAction($this, 'save'));
     $this->form_gui->setTitle($this->lng->txt('reg_settings_header'));
     $reg_type = new ilRadioGroupInputGUI($this->lng->txt('reg_type'), 'reg_type');
     $reg_type->addOption(new ilRadioOption($this->lng->txt('reg_disabled'), IL_REG_DISABLED));
     $option = new ilRadioOption($this->lng->txt('reg_direct'), IL_REG_DIRECT);
     $option->setInfo($this->lng->txt('reg_direct_info'));
     $cd = new ilCheckboxInputGUI($this->lng->txt('reg_allow_codes'), 'reg_codes_' . IL_REG_DIRECT);
     $cd->setInfo($this->lng->txt('reg_allow_codes_info'));
     $option->addSubItem($cd);
     $reg_type->addOption($option);
     $option = new ilRadioOption($this->lng->txt('reg_approve'), IL_REG_APPROVE);
     $option->setInfo($this->lng->txt('reg_approve_info'));
     $cd = new ilCheckboxInputGUI($this->lng->txt('reg_allow_codes'), 'reg_codes_' . IL_REG_APPROVE);
     $cd->setInfo($this->lng->txt('reg_allow_codes_info'));
     $option->addSubItem($cd);
     $reg_type->addOption($option);
     $option = new ilRadioOption($this->lng->txt('reg_type_confirmation'), IL_REG_ACTIVATION);
     $option->setInfo($this->lng->txt('reg_type_confirmation_info'));
     $lt = new ilNumberInputGUI($this->lng->txt('reg_confirmation_hash_life_time'), 'reg_hash_life_time');
     $lt->setSize(5);
     $lt->setMaxLength(5);
     $lt->setMinValue(ilRegistrationSettings::REG_HASH_LIFETIME_MIN_VALUE);
     $lt->setRequired(true);
     $lt->setInfo($this->lng->txt('reg_confirmation_hash_life_time_info'));
     $lt->setSuffix($this->lng->txt('seconds'));
     $option->addSubItem($lt);
     $cd = new ilCheckboxInputGUI($this->lng->txt('reg_allow_codes'), 'reg_codes_' . IL_REG_ACTIVATION);
     $cd->setInfo($this->lng->txt('reg_allow_codes_info'));
     $option->addSubItem($cd);
     $reg_type->addOption($option);
     $option = new ilRadioOption($this->lng->txt('registration_reg_type_codes'), IL_REG_CODES);
     $option->setInfo($this->lng->txt('registration_reg_type_codes_info'));
     $reg_type->addOption($option);
     $this->form_gui->addItem($reg_type);
     $pwd_gen = new ilCheckboxInputGUI($this->lng->txt('passwd_generation'), 'reg_pwd');
     $pwd_gen->setValue(1);
     $pwd_gen->setInfo($this->lng->txt('reg_info_pwd'));
     $this->form_gui->addItem($pwd_gen);
     require_once 'Services/Captcha/classes/class.ilCaptchaUtil.php';
     $cap = new ilCheckboxInputGUI($this->lng->txt('adm_captcha_anonymous_short'), 'activate_captcha_anonym');
     $cap->setInfo($this->lng->txt('adm_captcha_anonymous_reg'));
     $cap->setValue(1);
     if (!ilCaptchaUtil::checkFreetype()) {
         $cap->setAlert(ilCaptchaUtil::getPreconditionsMessage());
     }
     $this->form_gui->addItem($cap);
     $approver = new ilTextInputGUI($this->lng->txt('reg_notification'), 'reg_approver');
     $approver->setSize(32);
     $approver->setMaxLength(50);
     $approver->setInfo($this->lng->txt('reg_notification_info'));
     $this->form_gui->addItem($approver);
     $roles = new ilRadioGroupInputGUI($this->lng->txt('reg_role_assignment'), 'reg_role_type');
     $option = new ilRadioOption($this->lng->txt('reg_fixed'), IL_REG_ROLES_FIXED);
     $list = new ilCustomInputGUI($this->lng->txt('reg_available_roles'));
     $edit = $this->ctrl->getLinkTarget($this, 'editRoles');
     $list->setHtml($this->__parseRoleList($this->__prepareRoleList(), $edit));
     $option->addSubItem($list);
     $roles->addOption($option);
     $option = new ilRadioOption($this->lng->txt('reg_email'), IL_REG_ROLES_EMAIL);
     $list = new ilCustomInputGUI($this->lng->txt('reg_available_roles'));
     $edit = $this->ctrl->getLinkTarget($this, 'editEmailAssignments');
     $list->setHtml($this->__parseRoleList($this->__prepareAutomaticRoleList(), $edit));
     $option->addSubItem($list);
     $roles->addOption($option);
     $roles->setInfo($this->lng->txt('registration_codes_override_global_info'));
     $this->form_gui->addItem($roles);
     $limit = new ilCheckboxInputGUI($this->lng->txt('reg_access_limitations'), 'reg_access_limitation');
     $limit->setValue(1);
     $list = new ilCustomInputGUI($this->lng->txt('reg_available_roles'));
     $edit = $this->ctrl->getLinkTarget($this, 'editRoleAccessLimitations');
     $list->setHtml($this->__parseRoleList($this->__prepareAccessLimitationRoleList(), $edit));
     $list->setInfo($this->lng->txt('registration_codes_override_global_info'));
     $limit->addSubItem($list);
     $this->form_gui->addItem($limit);
     $domains = new ilTextInputGUI($this->lng->txt('reg_allowed_domains'), 'reg_allowed_domains');
     $domains->setInfo($this->lng->txt('reg_allowed_domains_info'));
     $this->form_gui->addItem($domains);
     $this->form_gui->addCommandButton('save', $this->lng->txt('save'));
 }
 /**
  * Creates an output of the edit form for the question
  *
  * @access public
  */
 public function editQuestion($checkonly = FALSE)
 {
     $save = $this->isSaveCommand();
     $this->getQuestionTemplate();
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->setTitle($this->outQuestionType());
     $form->setMultipart(FALSE);
     $form->setTableWidth("100%");
     $form->setId("orderinghorizontal");
     $this->addBasicQuestionFormProperties($form);
     // errortext
     $errortext = new ilTextAreaInputGUI($this->lng->txt("errortext"), "errortext");
     $errortext->setValue(ilUtil::prepareFormOutput($this->object->getErrorText()));
     $errortext->setRequired(TRUE);
     $errortext->setInfo($this->lng->txt("errortext_info"));
     $errortext->setRows(10);
     $errortext->setCols(80);
     $form->addItem($errortext);
     if (!$this->getSelfAssessmentEditingMode()) {
         // textsize
         $textsize = new ilNumberInputGUI($this->lng->txt("textsize"), "textsize");
         $textsize->setValue(strlen($this->object->getTextSize()) ? $this->object->getTextSize() : 100.0);
         $textsize->setInfo($this->lng->txt("textsize_errortext_info"));
         $textsize->setSize(6);
         $textsize->setSuffix("%");
         $textsize->setMinValue(10);
         $textsize->setRequired(true);
         $form->addItem($textsize);
     }
     if (count($this->object->getErrorData()) || $checkonly) {
         $header = new ilFormSectionHeaderGUI();
         $header->setTitle($this->lng->txt("errors_section"));
         $form->addItem($header);
         include_once "./Modules/TestQuestionPool/classes/class.ilErrorTextWizardInputGUI.php";
         $errordata = new ilErrorTextWizardInputGUI($this->lng->txt("errors"), "errordata");
         $values = array();
         $errordata->setKeyName($this->lng->txt('text_wrong'));
         $errordata->setValueName($this->lng->txt('text_correct'));
         $errordata->setValues($this->object->getErrorData());
         $form->addItem($errordata);
         // points for wrong selection
         $points_wrong = new ilNumberInputGUI($this->lng->txt("points_wrong"), "points_wrong");
         $points_wrong->setValue($this->object->getPointsWrong());
         $points_wrong->setInfo($this->lng->txt("points_wrong_info"));
         $points_wrong->setSize(6);
         $points_wrong->setRequired(true);
         $form->addItem($points_wrong);
     }
     $form->addCommandButton("analyze", $this->lng->txt('analyze_errortext'));
     $this->addQuestionFormCommandButtons($form);
     $errors = false;
     if ($save) {
         $form->setValuesByPost();
         $errors = !$form->checkInput();
         $form->setValuesByPost();
         // again, because checkInput now performs the whole stripSlashes handling and we need this if we don't want to have duplication of backslashes
         if ($errors) {
             $checkonly = false;
         }
     }
     if (!$checkonly) {
         $this->tpl->setVariable("QUESTION_DATA", $form->getHTML());
     }
     return $errors;
 }
 /**
  * @param ilPropertyFormGUI $a_form
  */
 public function addCustomSettingsToForm(ilPropertyFormGUI $a_form)
 {
     /**
      * @var $lng ilLanguage
      */
     global $lng;
     $lng->loadLanguageModule('forum');
     $max_notification_age = new ilNumberInputGUI($lng->txt('frm_max_notification_age'), 'max_notification_age');
     $max_notification_age->setSize(5);
     $max_notification_age->setSuffix($lng->txt('frm_max_notification_age_unit'));
     $max_notification_age->setRequired(true);
     $max_notification_age->allowDecimals(false);
     $max_notification_age->setMinValue(1);
     $max_notification_age->setInfo($lng->txt('frm_max_notification_age_info'));
     $max_notification_age->setValue($this->settings->get('max_notification_age', 30));
     $a_form->addItem($max_notification_age);
 }
Exemplo n.º 16
0
 /**
  * Init survey settings form
  * 
  * @return ilPropertyFormGUI
  */
 function initPropertiesForm()
 {
     $template_settings = $hide_rte_switch = null;
     $template = $this->object->getTemplate();
     if ($template) {
         include_once "Services/Administration/classes/class.ilSettingsTemplate.php";
         $template = new ilSettingsTemplate($template);
         $template_settings = $template->getSettings();
         $hide_rte_switch = $template_settings["rte_switch"]["hide"];
     }
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->setTableWidth("100%");
     $form->setId("survey_properties");
     // general properties
     $header = new ilFormSectionHeaderGUI();
     $header->setTitle($this->lng->txt("settings"));
     $form->addItem($header);
     // title & description (meta data)
     include_once 'Services/MetaData/classes/class.ilMD.php';
     $md_obj = new ilMD($this->object->getId(), 0, "svy");
     $md_section = $md_obj->getGeneral();
     $title = new ilTextInputGUI($this->lng->txt("title"), "title");
     $title->setRequired(true);
     $title->setValue($md_section->getTitle());
     $form->addItem($title);
     $ids = $md_section->getDescriptionIds();
     if ($ids) {
         $desc_obj = $md_section->getDescription(array_pop($ids));
         $desc = new ilTextAreaInputGUI($this->lng->txt("description"), "description");
         $desc->setCols(50);
         $desc->setRows(4);
         $desc->setValue($desc_obj->getDescription());
         $form->addItem($desc);
     }
     // pool usage
     $pool_usage = new ilRadioGroupInputGUI($this->lng->txt("survey_question_pool_usage"), "use_pool");
     $opt = new ilRadioOption($this->lng->txt("survey_question_pool_usage_active"), 1);
     $opt->setInfo($this->lng->txt("survey_question_pool_usage_active_info"));
     $pool_usage->addOption($opt);
     $opt = new ilRadioOption($this->lng->txt("survey_question_pool_usage_inactive"), 0);
     $opt->setInfo($this->lng->txt("survey_question_pool_usage_inactive_info"));
     $pool_usage->addOption($opt);
     $pool_usage->setValue($this->object->getPoolUsage());
     $form->addItem($pool_usage);
     // 360°: appraisees
     if ($this->object->get360Mode()) {
         $self_eval = new ilCheckboxInputGUI($this->lng->txt("survey_360_self_evaluation"), "self_eval");
         $self_eval->setInfo($this->lng->txt("survey_360_self_evaluation_info"));
         $self_eval->setChecked($this->object->get360SelfEvaluation());
         $form->addItem($self_eval);
         $self_rate = new ilCheckboxInputGUI($this->lng->txt("survey_360_self_raters"), "self_rate");
         $self_rate->setInfo($this->lng->txt("survey_360_self_raters_info"));
         $self_rate->setChecked($this->object->get360SelfRaters());
         $form->addItem($self_rate);
         $self_appr = new ilCheckboxInputGUI($this->lng->txt("survey_360_self_appraisee"), "self_appr");
         $self_appr->setInfo($this->lng->txt("survey_360_self_appraisee_info"));
         $self_appr->setChecked($this->object->get360SelfAppraisee());
         $form->addItem($self_appr);
     }
     // activation
     include_once "Services/Object/classes/class.ilObjectActivation.php";
     $this->lng->loadLanguageModule('rep');
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('rep_activation_availability'));
     $form->addItem($section);
     // additional info only with multiple references
     $act_obj_info = $act_ref_info = "";
     if (sizeof(ilObject::_getAllReferences($this->object->getId())) > 1) {
         $act_obj_info = ' ' . $this->lng->txt('rep_activation_online_object_info');
         $act_ref_info = $this->lng->txt('rep_activation_access_ref_info');
     }
     $online = new ilCheckboxInputGUI($this->lng->txt('rep_activation_online'), 'online');
     $online->setInfo($this->lng->txt('svy_activation_online_info') . $act_obj_info);
     $online->setChecked($this->object->isOnline());
     $form->addItem($online);
     $act_type = new ilCheckboxInputGUI($this->lng->txt('rep_visibility_until'), 'access_type');
     // $act_type->setInfo($this->lng->txt('svy_availability_until_info'));
     $act_type->setChecked($this->object->isActivationLimited());
     $this->tpl->addJavaScript('./Services/Form/js/date_duration.js');
     include_once "Services/Form/classes/class.ilDateDurationInputGUI.php";
     $dur = new ilDateDurationInputGUI($this->lng->txt('rep_time_period'), "access_period");
     $dur->setShowTime(true);
     $date = $this->object->getActivationStartDate();
     $dur->setStart(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
     $dur->setStartText($this->lng->txt('rep_activation_limited_start'));
     $date = $this->object->getActivationEndDate();
     $dur->setEnd(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
     $dur->setEndText($this->lng->txt('rep_activation_limited_end'));
     $act_type->addSubItem($dur);
     $visible = new ilCheckboxInputGUI($this->lng->txt('rep_activation_limited_visibility'), 'access_visiblity');
     $visible->setInfo($this->lng->txt('svy_activation_limited_visibility_info'));
     $visible->setChecked($this->object->getActivationVisibility());
     $act_type->addSubItem($visible);
     $form->addItem($act_type);
     // before start
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('svy_settings_section_before_start'));
     $form->addItem($section);
     // introduction
     $intro = new ilTextAreaInputGUI($this->lng->txt("introduction"), "introduction");
     $intro->setValue($this->object->prepareTextareaOutput($this->object->getIntroduction()));
     $intro->setRows(10);
     $intro->setCols(80);
     $intro->setUseRte(TRUE);
     $intro->setInfo($this->lng->txt("survey_introduction_info"));
     include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
     $intro->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("survey"));
     $intro->addPlugin("latex");
     $intro->addButton("latex");
     $intro->addButton("pastelatex");
     $intro->setRTESupport($this->object->getId(), "svy", "survey", null, $hide_rte_switch);
     $form->addItem($intro);
     // access
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('svy_settings_section_access'));
     $form->addItem($section);
     // enable start date
     $start = $this->object->getStartDate();
     $enablestartingtime = new ilCheckboxInputGUI($this->lng->txt("start_date"), "enabled_start_date");
     $enablestartingtime->setValue(1);
     // $enablestartingtime->setOptionTitle($this->lng->txt("enabled"));
     $enablestartingtime->setChecked($start);
     // start date
     $startingtime = new ilDateTimeInputGUI('', 'start_date');
     $startingtime->setShowTime(true);
     if ($start) {
         $startingtime->setDate(new ilDate($start, IL_CAL_TIMESTAMP));
     }
     $enablestartingtime->addSubItem($startingtime);
     $form->addItem($enablestartingtime);
     // enable end date
     $end = $this->object->getEndDate();
     $enableendingtime = new ilCheckboxInputGUI($this->lng->txt("end_date"), "enabled_end_date");
     $enableendingtime->setValue(1);
     // $enableendingtime->setOptionTitle($this->lng->txt("enabled"));
     $enableendingtime->setChecked($end);
     // end date
     $endingtime = new ilDateTimeInputGUI('', 'end_date');
     $endingtime->setShowTime(true);
     if ($end) {
         $endingtime->setDate(new ilDate($end, IL_CAL_TIMESTAMP));
     }
     $enableendingtime->addSubItem($endingtime);
     $form->addItem($enableendingtime);
     // anonymization
     if (!$this->object->get360Mode()) {
         $codes = new ilCheckboxInputGUI($this->lng->txt("survey_access_codes"), "acc_codes");
         $codes->setInfo($this->lng->txt("survey_access_codes_info"));
         $codes->setChecked(!$this->object->isAccessibleWithoutCode());
         $form->addItem($codes);
         if ($this->object->_hasDatasets($this->object->getSurveyId())) {
             $codes->setDisabled(true);
         }
     }
     // question behaviour
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('svy_settings_section_question_behaviour'));
     $form->addItem($section);
     // show question titles
     $show_question_titles = new ilCheckboxInputGUI($this->lng->txt("svy_show_questiontitles"), "show_question_titles");
     $show_question_titles->setValue(1);
     $show_question_titles->setChecked($this->object->getShowQuestionTitles());
     $form->addItem($show_question_titles);
     // finishing
     $info = new ilFormSectionHeaderGUI();
     $info->setTitle($this->lng->txt("svy_settings_section_finishing"));
     $form->addItem($info);
     $view_own = new ilCheckboxInputGUI($this->lng->txt("svy_results_view_own"), "view_own");
     $view_own->setInfo($this->lng->txt("svy_results_view_own_info"));
     $view_own->setChecked($this->object->hasViewOwnResults());
     $form->addItem($view_own);
     $mail_own = new ilCheckboxInputGUI($this->lng->txt("svy_results_mail_own"), "mail_own");
     $mail_own->setInfo($this->lng->txt("svy_results_mail_own_info"));
     $mail_own->setChecked($this->object->hasMailOwnResults());
     $form->addItem($mail_own);
     // final statement
     $finalstatement = new ilTextAreaInputGUI($this->lng->txt("outro"), "outro");
     $finalstatement->setValue($this->object->prepareTextareaOutput($this->object->getOutro()));
     $finalstatement->setRows(10);
     $finalstatement->setCols(80);
     $finalstatement->setUseRte(TRUE);
     $finalstatement->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("survey"));
     $finalstatement->addPlugin("latex");
     $finalstatement->addButton("latex");
     $finalstatement->addButton("pastelatex");
     $finalstatement->setRTESupport($this->object->getId(), "svy", "survey", null, $hide_rte_switch);
     $form->addItem($finalstatement);
     // mail notification
     $mailnotification = new ilCheckboxInputGUI($this->lng->txt("mailnotification"), "mailnotification");
     // $mailnotification->setOptionTitle($this->lng->txt("activate"));
     $mailnotification->setInfo($this->lng->txt("svy_result_mail_notification_info"));
     // #11762
     $mailnotification->setValue(1);
     $mailnotification->setChecked($this->object->getMailNotification());
     // addresses
     $mailaddresses = new ilTextInputGUI($this->lng->txt("mailaddresses"), "mailaddresses");
     $mailaddresses->setValue($this->object->getMailAddresses());
     $mailaddresses->setSize(80);
     $mailaddresses->setInfo($this->lng->txt('mailaddresses_info'));
     $mailaddresses->setRequired(true);
     // participant data
     $participantdata = new ilTextAreaInputGUI($this->lng->txt("mailparticipantdata"), "mailparticipantdata");
     $participantdata->setValue($this->object->getMailParticipantData());
     $participantdata->setRows(6);
     $participantdata->setCols(80);
     $participantdata->setUseRte(false);
     $participantdata->setInfo($this->lng->txt("mailparticipantdata_info"));
     // #12755 - because of privacy concerns we restrict user data to a minimum
     $placeholders = array("FIRST_NAME" => "firstname", "LAST_NAME" => "lastname", "LOGIN" => "login");
     $txt = array();
     foreach ($placeholders as $placeholder => $caption) {
         $txt[] = "[" . strtoupper($placeholder) . "]: " . $this->lng->txt($caption);
     }
     $txt = implode("<br />", $txt);
     $participantdatainfo = new ilNonEditableValueGUI($this->lng->txt("mailparticipantdata_placeholder"), "", true);
     $participantdatainfo->setValue($txt);
     $mailnotification->addSubItem($mailaddresses);
     $mailnotification->addSubItem($participantdata);
     $mailnotification->addSubItem($participantdatainfo);
     $form->addItem($mailnotification);
     // tutor notification - currently not available for 360°
     if (!$this->object->get360Mode()) {
         // parent course?
         global $tree;
         $has_parent = $tree->checkForParentType($this->object->getRefId(), "grp");
         if (!$has_parent) {
             $has_parent = $tree->checkForParentType($this->object->getRefId(), "crs");
         }
         $num_inv = sizeof($this->object->getInvitedUsers());
         // notification
         $tut = new ilCheckboxInputGUI($this->lng->txt("survey_notification_tutor_setting"), "tut");
         $tut->setChecked($this->object->getTutorNotificationStatus());
         $form->addItem($tut);
         $tut_logins = array();
         $tuts = $this->object->getTutorNotificationRecipients();
         if ($tuts) {
             foreach ($tuts as $tut_id) {
                 $tmp = ilObjUser::_lookupName($tut_id);
                 if ($tmp["login"]) {
                     $tut_logins[] = $tmp["login"];
                 }
             }
         }
         $tut_ids = new ilTextInputGUI($this->lng->txt("survey_notification_tutor_recipients"), "tut_ids");
         $tut_ids->setDataSource($this->ctrl->getLinkTarget($this, "doAutoComplete", "", true));
         $tut_ids->setRequired(true);
         $tut_ids->setMulti(true);
         $tut_ids->setMultiValues($tut_logins);
         $tut_ids->setValue(array_shift($tut_logins));
         $tut->addSubItem($tut_ids);
         $tut_grp = new ilRadioGroupInputGUI($this->lng->txt("survey_notification_target_group"), "tut_grp");
         $tut_grp->setRequired(true);
         $tut_grp->setValue($this->object->getTutorNotificationTarget());
         $tut->addSubItem($tut_grp);
         $tut_grp_crs = new ilRadioOption($this->lng->txt("survey_notification_target_group_parent_course"), ilObjSurvey::NOTIFICATION_PARENT_COURSE);
         if (!$has_parent) {
             $tut_grp_crs->setInfo($this->lng->txt("survey_notification_target_group_parent_course_inactive"));
         }
         $tut_grp->addOption($tut_grp_crs);
         $tut_grp_inv = new ilRadioOption($this->lng->txt("survey_notification_target_group_invited"), ilObjSurvey::NOTIFICATION_INVITED_USERS);
         $tut_grp_inv->setInfo(sprintf($this->lng->txt("survey_notification_target_group_invited_info"), $num_inv));
         $tut_grp->addOption($tut_grp_inv);
     }
     // reminders
     // reminder - currently not available for 360°
     if (!$this->object->get360Mode()) {
         $info = new ilFormSectionHeaderGUI();
         $info->setTitle($this->lng->txt("svy_settings_section_reminders"));
         $form->addItem($info);
         $rmd = new ilCheckboxInputGUI($this->lng->txt("survey_reminder_setting"), "rmd");
         $rmd->setChecked($this->object->getReminderStatus());
         $form->addItem($rmd);
         $rmd_start = new ilDateTimeInputGUI($this->lng->txt("survey_reminder_start"), "rmd_start");
         $rmd_start->setRequired(true);
         $start = $this->object->getReminderStart();
         if ($start) {
             $rmd_start->setDate($start);
         }
         $rmd->addSubItem($rmd_start);
         $end = $this->object->getReminderEnd();
         $rmd_end = new ilDateTimeInputGUI($this->lng->txt("survey_reminder_end"), "rmd_end");
         $rmd_end->enableDateActivation("", "rmd_end_tgl", (bool) $end);
         if ($end) {
             $rmd_end->setDate($end);
         }
         $rmd->addSubItem($rmd_end);
         $rmd_freq = new ilNumberInputGUI($this->lng->txt("survey_reminder_frequency"), "rmd_freq");
         $rmd_freq->setRequired(true);
         $rmd_freq->setSize(3);
         $rmd_freq->setSuffix($this->lng->txt("survey_reminder_frequency_days"));
         $rmd_freq->setValue($this->object->getReminderFrequency());
         $rmd_freq->setMinValue(1);
         $rmd->addSubItem($rmd_freq);
         $rmd_grp = new ilRadioGroupInputGUI($this->lng->txt("survey_notification_target_group"), "rmd_grp");
         $rmd_grp->setRequired(true);
         $rmd_grp->setValue($this->object->getReminderTarget());
         $rmd->addSubItem($rmd_grp);
         $rmd_grp_crs = new ilRadioOption($this->lng->txt("survey_notification_target_group_parent_course"), ilObjSurvey::NOTIFICATION_PARENT_COURSE);
         if (!$has_parent) {
             $rmd_grp_crs->setInfo($this->lng->txt("survey_notification_target_group_parent_course_inactive"));
         }
         $rmd_grp->addOption($rmd_grp_crs);
         $rmd_grp_inv = new ilRadioOption($this->lng->txt("survey_notification_target_group_invited"), ilObjSurvey::NOTIFICATION_INVITED_USERS);
         $rmd_grp_inv->setInfo(sprintf($this->lng->txt("survey_notification_target_group_invited_info"), $num_inv));
         $rmd_grp->addOption($rmd_grp_inv);
     }
     // results
     $results = new ilFormSectionHeaderGUI();
     $results->setTitle($this->lng->txt("results"));
     $form->addItem($results);
     // evaluation access
     if (!$this->object->get360Mode()) {
         $evaluation_access = new ilRadioGroupInputGUI($this->lng->txt('evaluation_access'), "evaluation_access");
         $option = new ilCheckboxOption($this->lng->txt("evaluation_access_off"), ilObjSurvey::EVALUATION_ACCESS_OFF, '');
         $option->setInfo($this->lng->txt("svy_evaluation_access_off_info"));
         $evaluation_access->addOption($option);
         $option = new ilCheckboxOption($this->lng->txt("evaluation_access_all"), ilObjSurvey::EVALUATION_ACCESS_ALL, '');
         $option->setInfo($this->lng->txt("svy_evaluation_access_all_info"));
         $evaluation_access->addOption($option);
         $option = new ilCheckboxOption($this->lng->txt("evaluation_access_participants"), ilObjSurvey::EVALUATION_ACCESS_PARTICIPANTS, '');
         $option->setInfo($this->lng->txt("svy_evaluation_access_participants_info"));
         $evaluation_access->addOption($option);
         $evaluation_access->setValue($this->object->getEvaluationAccess());
         $form->addItem($evaluation_access);
         $anonymization_options = new ilRadioGroupInputGUI($this->lng->txt("survey_results_anonymization"), "anonymization_options");
         $option = new ilCheckboxOption($this->lng->txt("survey_results_personalized"), "statpers");
         $option->setInfo($this->lng->txt("survey_results_personalized_info"));
         $anonymization_options->addOption($option);
         $option = new ilCheckboxOption($this->lng->txt("survey_results_anonymized"), "statanon");
         $option->setInfo($this->lng->txt("survey_results_anonymized_info"));
         $anonymization_options->addOption($option);
         $anonymization_options->setValue($this->object->hasAnonymizedResults() ? "statanon" : "statpers");
         $form->addItem($anonymization_options);
         if ($this->object->_hasDatasets($this->object->getSurveyId())) {
             $anonymization_options->setDisabled(true);
         }
     } else {
         $ts_results = new ilRadioGroupInputGUI($this->lng->txt("survey_360_results"), "ts_res");
         $ts_results->setValue($this->object->get360Results());
         $option = new ilRadioOption($this->lng->txt("survey_360_results_none"), ilObjSurvey::RESULTS_360_NONE);
         $option->setInfo($this->lng->txt("survey_360_results_none_info"));
         $ts_results->addOption($option);
         $option = new ilRadioOption($this->lng->txt("survey_360_results_own"), ilObjSurvey::RESULTS_360_OWN);
         $option->setInfo($this->lng->txt("survey_360_results_own_info"));
         $ts_results->addOption($option);
         $option = new ilRadioOption($this->lng->txt("survey_360_results_all"), ilObjSurvey::RESULTS_360_ALL);
         $option->setInfo($this->lng->txt("survey_360_results_all_info"));
         $ts_results->addOption($option);
         $form->addItem($ts_results);
     }
     // competence service activation for 360 mode
     include_once "./Services/Skill/classes/class.ilSkillManagementSettings.php";
     $skmg_set = new ilSkillManagementSettings();
     if ($this->object->get360Mode() && $skmg_set->isActivated()) {
         $other = new ilFormSectionHeaderGUI();
         $other->setTitle($this->lng->txt("other"));
         $form->addItem($other);
         $skill_service = new ilCheckboxInputGUI($this->lng->txt("survey_activate_skill_service"), "skill_service");
         $skill_service->setInfo($this->lng->txt("survey_activate_skill_service_info"));
         $skill_service->setChecked($this->object->get360SkillService());
         $form->addItem($skill_service);
     }
     $form->addCommandButton("saveProperties", $this->lng->txt("save"));
     // remove items when using template
     if ($template_settings) {
         foreach ($template_settings as $id => $item) {
             if ($item["hide"]) {
                 $form->removeItemByPostVar($id);
             }
         }
     }
     return $form;
 }
 public function addCustomSettingsToForm(ilPropertyFormGUI $a_form)
 {
     global $lng, $rbacreview, $ilObjDataCache, $ilSetting;
     $lng->loadLanguageModule("user");
     $schedule = $a_form->getItemByPostVar('type');
     $schedule->setTitle($lng->txt('delete_inactive_user_accounts_frequency'), 'delete_inactive_user_accounts_frequency');
     $schedule->setInfo($lng->txt('delete_inactive_user_accounts_frequency_desc'), 'delete_inactive_user_accounts_frequency_desc');
     include_once 'Services/Form/classes/class.ilMultiSelectInputGUI.php';
     $sub_mlist = new ilMultiSelectInputGUI($lng->txt('delete_inactive_user_accounts_include_roles'), 'cron_inactive_user_delete_include_roles');
     $sub_mlist->setInfo($lng->txt('delete_inactive_user_accounts_include_roles_desc'));
     $roles = array();
     foreach ($rbacreview->getGlobalRoles() as $role_id) {
         if ($role_id != ANONYMOUS_ROLE_ID) {
             $roles[$role_id] = $ilObjDataCache->lookupTitle($role_id);
         }
     }
     $sub_mlist->setOptions($roles);
     $setting = $ilSetting->get('cron_inactive_user_delete_include_roles', null);
     if ($setting === null) {
         $setting = array();
     } else {
         $setting = explode(',', $setting);
     }
     $sub_mlist->setValue($setting);
     $sub_mlist->setWidth(300);
     #$sub_mlist->setHeight(100);
     $a_form->addItem($sub_mlist);
     $default_setting = self::DEFAULT_INACTIVITY_PERIOD;
     $sub_text = new ilNumberInputGUI($lng->txt('delete_inactive_user_accounts_period'), 'cron_inactive_user_delete_period');
     $sub_text->setInfo($lng->txt('delete_inactive_user_accounts_period_desc'));
     $sub_text->setValue($ilSetting->get("cron_inactive_user_delete_period", $default_setting));
     $sub_text->setSize(4);
     $sub_text->setMaxLength(4);
     $sub_text->setRequired(true);
     $a_form->addItem($sub_text);
     $sub_period = new ilNumberInputGUI($lng->txt('send_mail_to_inactive_users'), 'cron_inactive_user_reminder_period');
     $sub_period->setInfo($lng->txt("send_mail_to_inactive_users_desc"));
     $sub_period->setValue($ilSetting->get("cron_inactive_user_reminder_period", $default_setting));
     $sub_period->setSuffix($lng->txt("send_mail_to_inactive_users_suffix"));
     $sub_period->setSize(4);
     $sub_period->setMaxLength(4);
     $sub_period->setRequired(false);
     $sub_period->setMinValue(0);
     $a_form->addItem($sub_period);
     /*		
     $default_setting = ilCronDeleteInactiveUserAccounts::DEFAULT_SETTING_INCLUDE_ADMINS;
     $sub_cb = new ilCheckboxInputGUI($lng->txt('delete_inactive_user_accounts_include_admins'),'cron_inactive_user_delete_include_admins');
     $sub_cb->setChecked($ilSetting->get("cron_inactive_user_delete_include_admins", $default_setting) ? 1 : 0 );
     //$sub_cb->setOptionTitle($lng->txt('delete_inactive_user_accounts_include_admins'));
     $sub_cb->setInfo($lng->txt('delete_inactive_user_accounts_include_admins_desc'));
     $a_form->addItem($sub_cb);
     */
 }
 /**
  * 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 addResultDetailsSettingsFormSection(ilPropertyFormGUI $form)
 {
     // HEADER: result settings
     $header_tr = new ilFormSectionHeaderGUI();
     $header_tr->setTitle($this->lng->txt('tst_results_details_options'));
     $form->addItem($header_tr);
     // show solution details
     $showSolutionDetails = new ilCheckboxInputGUI($this->lng->txt('tst_show_solution_details'), 'solution_details');
     $showSolutionDetails->setInfo($this->lng->txt('tst_show_solution_details_desc'));
     $showSolutionDetails->setChecked($this->testOBJ->getShowSolutionDetails());
     $form->addItem($showSolutionDetails);
     // best solution in test results
     $results_print_best_solution = new ilCheckboxInputGUI($this->lng->txt('tst_results_print_best_solution'), 'print_bs_with_res');
     $results_print_best_solution->setInfo($this->lng->txt('tst_results_print_best_solution_info'));
     $results_print_best_solution->setChecked((bool) $this->testOBJ->isBestSolutionPrintedWithResult());
     $showSolutionDetails->addSubItem($results_print_best_solution);
     // show solution feedback ==> solution feedback in test results
     $showSolutionFeedbackOption = new ilCheckboxInputGUI($this->lng->txt('tst_show_solution_feedback'), 'solution_feedback');
     $showSolutionFeedbackOption->setInfo($this->lng->txt('tst_show_solution_feedback_desc'));
     $showSolutionFeedbackOption->setChecked($this->testOBJ->getShowSolutionFeedback());
     $form->addItem($showSolutionFeedbackOption);
     // show suggested solution
     $showSuggestedSolutionOption = new ilCheckboxInputGUI($this->lng->txt('tst_show_solution_suggested'), 'solution_suggested');
     $showSuggestedSolutionOption->setInfo($this->lng->txt('tst_show_solution_suggested_desc'));
     $showSuggestedSolutionOption->setChecked($this->testOBJ->getShowSolutionSuggested());
     $form->addItem($showSuggestedSolutionOption);
     // show solution printview ==> list of answers
     $showSolutionPrintview = new ilCheckboxInputGUI($this->lng->txt('tst_show_solution_printview'), 'solution_printview');
     $showSolutionPrintview->setInfo($this->lng->txt('tst_show_solution_printview_desc'));
     $showSolutionPrintview->setChecked($this->testOBJ->getShowSolutionPrintview());
     $form->addItem($showSolutionPrintview);
     // show best solution in list of answers
     $solutionCompareInput = new ilCheckboxInputGUI($this->lng->txt('tst_show_solution_compare'), 'solution_compare');
     $solutionCompareInput->setChecked($this->testOBJ->getShowSolutionListComparison());
     $showSolutionPrintview->addSubItem($solutionCompareInput);
     // solution answers only ==> printview of results (answers only)
     $solutionAnswersOnly = new ilCheckboxInputGUI($this->lng->txt('tst_show_solution_answers_only'), 'solution_answers_only');
     $solutionAnswersOnly->setInfo($this->lng->txt('tst_show_solution_answers_only_desc'));
     $solutionAnswersOnly->setChecked($this->testOBJ->getShowSolutionAnswersOnly());
     $showSolutionPrintview->addSubItem($solutionAnswersOnly);
     // high score
     $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_tables = new ilRadioGroupInputGUI($this->lng->txt('tst_highscore_mode'), 'highscore_mode');
     $highscore_tables->setRequired(true);
     $highscore_tables->setValue($this->testOBJ->getHighscoreMode());
     $highscore_table_own = new ilRadioOption($this->lng->txt('tst_highscore_own_table'), ilObjTest::HIGHSCORE_SHOW_OWN_TABLE);
     $highscore_table_own->setInfo($this->lng->txt('tst_highscore_own_table_description'));
     $highscore_tables->addOption($highscore_table_own);
     $highscore_table_other = new ilRadioOption($this->lng->txt('tst_highscore_top_table'), ilObjTest::HIGHSCORE_SHOW_TOP_TABLE);
     $highscore_table_other->setInfo($this->lng->txt('tst_highscore_top_table_description'));
     $highscore_tables->addOption($highscore_table_other);
     $highscore_table_other = new ilRadioOption($this->lng->txt('tst_highscore_all_tables'), ilObjTest::HIGHSCORE_SHOW_ALL_TABLES);
     $highscore_table_other->setInfo($this->lng->txt('tst_highscore_all_tables_description'));
     $highscore_tables->addOption($highscore_table_other);
     $highscore->addSubItem($highscore_tables);
     $highscore_top_num = new ilNumberInputGUI($this->lng->txt("tst_highscore_top_num"), "highscore_top_num");
     $highscore_top_num->setSize(4);
     $highscore_top_num->setRequired(true);
     $highscore_top_num->setMinValue(1);
     $highscore_top_num->setSuffix($this->lng->txt("tst_highscore_top_num_unit"));
     $highscore_top_num->setValue($this->testOBJ->getHighscoreTopNum(null));
     $highscore_top_num->setInfo($this->lng->txt("tst_highscore_top_num_description"));
     $highscore->addSubItem($highscore_top_num);
     $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);
     // show signature placeholder
     $showSignaturePlaceholder = new ilCheckboxInputGUI($this->lng->txt('tst_show_solution_signature'), 'solution_signature');
     $showSignaturePlaceholder->setInfo($this->lng->txt('tst_show_solution_signature_desc'));
     $showSignaturePlaceholder->setChecked($this->testOBJ->getShowSolutionSignature());
     if ($this->testOBJ->getAnonymity()) {
         $showSignaturePlaceholder->setDisabled(true);
     }
     $form->addItem($showSignaturePlaceholder);
     // show signature placeholder
     $showExamId = new ilCheckboxInputGUI($this->lng->txt('examid_in_test_res'), 'examid_in_test_res');
     $showExamId->setInfo($this->lng->txt('examid_in_test_res_desc'));
     $showExamId->setChecked($this->testOBJ->isShowExamIdInTestResultsEnabled());
     $form->addItem($showExamId);
     // export settings
     $export_settings = new ilCheckboxInputGUI($this->lng->txt('tst_exp_sc_short'), 'exp_sc_short');
     $export_settings->setInfo($this->lng->txt('tst_exp_sc_short_desc'));
     $export_settings->setChecked($this->testOBJ->getExportSettingsSingleChoiceShort());
     $form->addItem($export_settings);
 }
Exemplo n.º 20
0
 /**
  * @param $form ilPropertyFormGUI
  * @return \ilPropertyFormGUI|void
  */
 public function populateQuestionSpecificFormPart(ilPropertyFormGUI $form)
 {
     // errortext
     $errortext = new ilTextAreaInputGUI($this->lng->txt("errortext"), "errortext");
     $errortext->setValue($this->object->getErrorText());
     $errortext->setRequired(TRUE);
     $errortext->setInfo($this->lng->txt("errortext_info"));
     $errortext->setRows(10);
     $errortext->setCols(80);
     $form->addItem($errortext);
     if (!$this->object->getSelfAssessmentEditingMode()) {
         // textsize
         $textsize = new ilNumberInputGUI($this->lng->txt("textsize"), "textsize");
         $textsize->setValue(strlen($this->object->getTextSize()) ? $this->object->getTextSize() : 100.0);
         $textsize->setInfo($this->lng->txt("textsize_errortext_info"));
         $textsize->setSize(6);
         $textsize->setSuffix("%");
         $textsize->setMinValue(10);
         $textsize->setRequired(true);
         $form->addItem($textsize);
     }
 }
Exemplo n.º 21
0
 protected function initEditCustomForm(ilPropertyFormGUI $a_form)
 {
     // default width
     $ni = new ilNumberInputGUI($this->lng->txt("mep_default_width"), "default_width");
     $ni->setMinValue(0);
     $ni->setSuffix("px");
     $ni->setMaxLength(5);
     $ni->setSize(5);
     $a_form->addItem($ni);
     // default height
     $ni = new ilNumberInputGUI($this->lng->txt("mep_default_height"), "default_height");
     $ni->setSuffix("px");
     $ni->setMinValue(0);
     $ni->setMaxLength(5);
     $ni->setSize(5);
     $ni->setInfo($this->lng->txt("mep_default_width_height_info"));
     $a_form->addItem($ni);
 }