/**
  * 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;
 }
 /**
  * Init settings property form
  *
  * @access private
  */
 private function initForm()
 {
     $this->setFormAction($this->ctrl->getFormAction($this->parent_gui));
     $name = new ilTextInputGUI($this->lng->txt("bibl_library_name"), 'name');
     $name->setRequired(true);
     $name->setValue('');
     $this->addItem($name);
     $url = new ilTextInputGUI($this->lng->txt("bibl_library_url"), 'url');
     $url->setRequired(true);
     $url->setValue('');
     $this->addItem($url);
     $img = new ilTextInputGUI($this->lng->txt("bibl_library_img"), 'img');
     $img->setValue('');
     $this->addItem($img);
     $show_in_list = new ilCheckboxInputGUI($this->lng->txt("bibl_library_show_in_list"), 'show_in_list');
     $show_in_list->setValue(1);
     $this->addItem($show_in_list);
     switch ($this->action) {
         case 'create':
             $this->setTitle($this->lng->txt("bibl_settings_new"));
             $this->addCommandButton('create', $this->lng->txt('save'));
             break;
         case 'update':
             $this->addCommandButton('update', $this->lng->txt('save'));
             $this->fillForm();
             $this->setTitle($this->lng->txt("bibl_settings_edit"));
             break;
     }
     $this->addCommandButton('cancel', $this->lng->txt("cancel"));
 }
 public function addToForm()
 {
     $bool = new ilCheckboxInputGUI($this->getTitle(), $this->getElementId());
     $bool->setValue(1);
     $this->addBasicFieldProperties($bool, $this->getADT()->getCopyOfDefinition());
     // :TODO: required checkboxes do not make sense
     $bool->setRequired(false);
     $bool->setChecked($this->getADT()->getStatus());
     $this->addToParentElement($bool);
 }
 public function addToForm()
 {
     global $lng;
     if ($this->getForm() instanceof ilPropertyFormGUI) {
         // :TODO: use DateDurationInputGUI ?!
         if (!(bool) $this->text_input) {
             $check = new ilCheckboxInputGUI($this->getTitle(), $this->addToElementId("tgl"));
             $check->setValue(1);
             $checked = false;
         } else {
             $check = new ilCustomInputGUI($this->getTitle());
         }
         $date_from = new ilDateTimeInputGUI($lng->txt('from'), $this->addToElementId("lower"));
         $date_from->setShowTime(true);
         $check->addSubItem($date_from);
         if ($this->getLowerADT()->getDate() && !$this->getLowerADT()->isNull()) {
             $date_from->setDate($this->getLowerADT()->getDate());
             $checked = true;
         }
         $date_until = new ilDateTimeInputGUI($lng->txt('until'), $this->addToElementId("upper"));
         $date_until->setShowTime(true);
         $check->addSubItem($date_until);
         if ($this->getUpperADT()->getDate() && !$this->getUpperADT()->isNull()) {
             $date_until->setDate($this->getUpperADT()->getDate());
             $checked = true;
         }
         if (!(bool) $this->text_input) {
             $check->setChecked($checked);
         } else {
             $date_from->setMode(ilDateTimeInputGUI::MODE_INPUT);
             $date_until->setMode(ilDateTimeInputGUI::MODE_INPUT);
         }
         $this->addToParentElement($check);
     } else {
         // see ilTable2GUI::addFilterItemByMetaType()
         include_once "./Services/Form/classes/class.ilCombinationInputGUI.php";
         include_once "./Services/Form/classes/class.ilDateTimeInputGUI.php";
         $item = new ilCombinationInputGUI($this->getTitle(), $this->getElementId());
         $lower = new ilDateTimeInputGUI("", $this->addToElementId("lower"));
         $lower->setShowTime(true);
         $item->addCombinationItem("lower", $lower, $lng->txt("from"));
         if ($this->getLowerADT()->getDate() && !$this->getLowerADT()->isNull()) {
             $lower->setDate($this->getLowerADT()->getDate());
         }
         $upper = new ilDateTimeInputGUI("", $this->addToElementId("upper"));
         $upper->setShowTime(true);
         $item->addCombinationItem("upper", $upper, $lng->txt("to"));
         if ($this->getUpperADT()->getDate() && !$this->getUpperADT()->isNull()) {
             $upper->setDate($this->getUpperADT()->getDate());
         }
         $item->setComparisonMode(ilCombinationInputGUI::COMPARISON_ASCENDING);
         $item->setMode(ilDateTimeInputGUI::MODE_INPUT);
         $this->addToParentElement($item);
     }
 }
 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());
 }
 /**
  * Init Social Bookmark edit/create Form
  *
  * @param        ilObjectGUI	$formhandlerObject        taken as form target
  * @param        int        	$mode        "create" / "edit"
  */
 public static function _initForm($formhandlerObject, $mode = "create", $id = 0)
 {
     global $lng, $ilCtrl;
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setMultipart(true);
     // File Title
     $in_title = new ilTextInputGUI($lng->txt("title"), "title");
     $in_title->setMaxLength(128);
     $in_title->setSize(40);
     $in_title->setRequired(true);
     $form->addItem($in_title);
     // Link
     $in_link = new ilTextInputGUI($lng->txt("link"), "link");
     $in_link->setMaxLength(300);
     $in_link->setSize(40);
     $in_link->setRequired(true);
     $in_link->setInfo($lng->txt('socialbm_link_description'));
     $form->addItem($in_link);
     // File
     $in_file = new ilFileInputGUI($lng->txt("file"), "image_file");
     $in_file->setSuffixes(array('bmp', 'gif', 'jpg', 'jpeg', 'png'));
     $form->addItem($in_file);
     // Activate on submit
     $in_activate = new ilCheckboxInputGUI($lng->txt("activate"), "activate");
     $in_activate->setValue('1');
     $form->addItem($in_activate);
     // save and cancel commands
     if ($mode == "create") {
         $form->addCommandButton("createSocialBookmark", $lng->txt("create"));
         $form->addCommandButton("editSocialBookmarks", $lng->txt("cancel"));
         $form->setTitle($lng->txt("adm_social_bm_create"));
         $in_file->setRequired(true);
     } else {
         if ($mode == "update") {
             $in_hidden = new ilHiddenInputGUI("sbm_id", $id);
             $form->addItem($in_hidden);
             $form->addCommandButton("updateSocialBookmark", $lng->txt("update"));
             $form->addCommandButton("cancel", $lng->txt("cancel"));
             $form->setTitle($lng->txt("adm_social_bm_edit"));
             $in_file->setRequired(false);
         }
     }
     $form->setTableWidth("60%");
     $form->setFormAction($ilCtrl->getFormAction($formhandlerObject));
     return $form;
 }
 /**
  * Init configuration form.
  *
  * @return object form object
  */
 public function initConfigurationForm()
 {
     global $lng, $ilCtrl;
     $pl = $this->getPluginObject();
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     // Setting for the ephorus logging
     $ephorus_logging = new ilCheckboxInputGUI($pl->txt("ephorus_logging"), "ephorus_logging");
     $ephorus_logging->setValue(1);
     $ephorus_logging->setInfo($pl->txt("ephorus_logging_description"));
     $form->addItem($ephorus_logging);
     // Setting for the hand-in code
     $handin_code = new ilTextInputGUI($pl->txt("handin_code"), "handin_code");
     $handin_code->setRequired(true);
     $form->addItem($handin_code);
     // Setting for the hand-in address
     $handin_address = new ilTextInputGUI($pl->txt("handin_address"), "handin_address");
     $handin_address->setSize(80);
     $handin_address->setRequired(true);
     $form->addItem($handin_address);
     // Setting for the index address
     $index_address = new ilTextInputGUI($pl->txt("index_address"), "index_address");
     $index_address->setSize(80);
     $index_address->setRequired(true);
     $form->addItem($index_address);
     // Setting for the processtype
     $processtype = new ilSelectInputGUI($pl->txt("default_processtype"), "processtype");
     $processtype->setOptions(array(1 => $pl->txt("default"), 3 => $pl->txt("private")));
     $processtype->setInfo($pl->txt("default_processtype_description"));
     $form->addItem($processtype);
     // Setting for the disclosure
     $disclosure = new ilTextAreaInputGUI($pl->txt("disclosure"), "disclosure");
     $disclosure->setCols(79);
     $disclosure->setRows(4);
     $form->addItem($disclosure);
     $form->addCommandButton("save", $lng->txt("save") . " / " . $pl->txt("check_connection"));
     $form->setTitle($pl->txt("ephorus_plugin_configuration"));
     $form->setFormAction($ilCtrl->getFormAction($this));
     return $form;
 }
 /**
  * Init configuration form
  * @global type $ilCtrl 
  */
 protected function initConfigurationForm()
 {
     global $ilCtrl, $lng;
     $settings = ilFhoevEventSettings::getInstance();
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setTitle($this->getPluginObject()->txt('tbl_fhoev_event_settings'));
     $form->setFormAction($ilCtrl->getFormAction($this));
     $form->addCommandButton('save', $lng->txt('save'));
     $form->setShowTopButtons(false);
     $lock = new ilCheckboxInputGUI($this->getPluginObject()->txt('tbl_settings_active'), 'active');
     $lock->setValue(1);
     $lock->setChecked($settings->isActive());
     $form->addItem($lock);
     $dtpl = new ilNumberInputGUI($this->getPluginObject()->txt('tbl_settings_dtpl'), 'dtpl');
     $dtpl->setSize(8);
     $dtpl->setValue($settings->getTemplateId());
     $dtpl->setRequired(TRUE);
     $dtpl->setMinValue(1);
     $form->addItem($dtpl);
     return $form;
 }
Ejemplo n.º 9
0
 public function addCustomSettingsToForm(ilPropertyFormGUI $a_form)
 {
     global $lng;
     $lng->loadLanguageModule("file");
     require_once 'Services/WebDAV/classes/class.ilObjDiskQuotaSettings.php';
     $disk_quota_obj = ilObjDiskQuotaSettings::getInstance();
     // Enable disk quota reminder mail
     $cb_prop_reminder = new ilCheckboxInputGUI($lng->txt("enable_disk_quota_reminder_mail"), "enable_disk_quota_reminder_mail");
     $cb_prop_reminder->setValue('1');
     $cb_prop_reminder->setChecked($disk_quota_obj->isDiskQuotaReminderMailEnabled());
     $cb_prop_reminder->setInfo($lng->txt('disk_quota_reminder_mail_desc'));
     $a_form->addItem($cb_prop_reminder);
     // Enable summary mail for certain users
     $cb_prop_summary = new ilCheckboxInputGUI($lng->txt("enable_disk_quota_summary_mail"), "enable_disk_quota_summary_mail");
     $cb_prop_summary->setValue(1);
     $cb_prop_summary->setChecked($disk_quota_obj->isDiskQuotaSummaryMailEnabled());
     $cb_prop_summary->setInfo($lng->txt('enable_disk_quota_summary_mail_desc'));
     $a_form->addItem($cb_prop_summary);
     // Edit disk quota recipients
     $summary_rcpt = new ilTextInputGUI($lng->txt("disk_quota_summary_rctp"), "disk_quota_summary_rctp");
     $summary_rcpt->setValue($disk_quota_obj->getSummaryRecipients());
     $summary_rcpt->setInfo($lng->txt('disk_quota_summary_rctp_desc'));
     $cb_prop_summary->addSubItem($summary_rcpt);
 }
 public function StatutoryRegulationsObject()
 {
     $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment');
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this, 'saveStatutoryRegulations'));
     $form->setTitle($this->lng->txt('statutory_regulations'));
     $form->setTableWidth('100%');
     // message
     $post_gui = new ilTextAreaInputGUI($this->lng->txt('content'), 'statutory_regulations');
     $post_gui->setCols(50);
     $post_gui->setRows(15);
     $post_gui->setUseRte(true);
     $post_gui->addPlugin('latex');
     $post_gui->addButton('latex');
     $post_gui->addButton('pastelatex');
     $post_gui->addPlugin('ilimgupload');
     $post_gui->addButton('ilimgupload');
     $post_gui->removePlugin('advlink');
     $post_gui->removePlugin(ilRTE::ILIAS_IMG_MANAGER_PLUGIN);
     $post_gui->removePlugin('image');
     $post_gui->usePurifier(true);
     $post_gui->setRTERootBlockElement('');
     $post_gui->setRTESupport(ilObject::_lookupObjId($this->ref_id), 'pays~', 'frm_post', 'tpl.tinymce_frm_post.html', false, '3.4.7');
     $post_gui->disableButtons(array('charmap', 'undo', 'redo', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'anchor', 'fullscreen', 'cut', 'copy', 'paste', 'pastetext', 'formatselect', 'image'));
     // purifier
     require_once 'Services/Html/classes/class.ilHtmlPurifierFactory.php';
     require_once 'Services/RTE/classes/class.ilRTE.php';
     $post_gui->setPurifier(ilHtmlPurifierFactory::_getInstanceByType('frm_post'));
     $post_gui->setValue(ilRTE::_replaceMediaObjectImageSrc($this->genSetData->get('statutory_regulations'), 1));
     $form->addItem($post_gui);
     // show staturaltyio regulations in shoppingcart
     $cb_showShoppingCart = new ilCheckboxInputGUI($this->lng->txt('show_sr_shoppingcart'), 'show_sr_shoppingcart');
     $cb_showShoppingCart->setInfo($this->lng->txt('show_sr_shoppingcart_info'));
     $cb_showShoppingCart->setValue(1);
     $cb_showShoppingCart->setChecked($this->genSetData->get('show_sr_shoppingcart'));
     $form->addItem($cb_showShoppingCart);
     // attach staturaltyio regulations at invoice
     $cb_attachInvoice = new ilCheckboxInputGUI($this->lng->txt('attach_sr_invoice'), 'attach_sr_invoice');
     $cb_attachInvoice->setInfo($this->lng->txt('attach_sr_invoice_info'));
     $cb_attachInvoice->setValue(1);
     $cb_attachInvoice->setChecked($this->genSetData->get('attach_sr_invoice'));
     $form->addItem($cb_attachInvoice);
     $form->addCommandButton('saveStatutoryRegulations', $this->lng->txt('save'));
     $this->tpl->setVariable('FORM', $form->getHTML());
 }
 /**
  * Init settings property form
  *
  * @access protected
  */
 protected function initFormSettings()
 {
     if (is_object($this->form)) {
         return true;
     }
     include_once 'Services/Calendar/classes/class.ilCalendarUtil.php';
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $this->form = new ilPropertyFormGUI();
     $this->form->setFormAction($this->ctrl->getFormAction($this));
     $this->form->setTitle($this->lng->txt('cal_global_settings'));
     $this->form->addCommandButton('save', $this->lng->txt('save'));
     #$this->form->addCommandButton('cancel',$this->lng->txt('cancel'));
     $check = new ilCheckboxInputGUI($this->lng->txt('enable_calendar'), 'enable');
     $check->setValue(1);
     $check->setChecked($this->settings->isEnabled() ? true : false);
     $this->form->addItem($check);
     $server_tz = new ilNonEditableValueGUI($this->lng->txt('cal_server_tz'));
     $server_tz->setValue(ilTimeZone::_getDefaultTimeZone());
     $this->form->addItem($server_tz);
     $select = new ilSelectInputGUI($this->lng->txt('cal_def_timezone'), 'default_timezone');
     $select->setOptions(ilCalendarUtil::_getShortTimeZoneList());
     $select->setInfo($this->lng->txt('cal_def_timezone_info'));
     $select->setValue($this->settings->getDefaultTimeZone());
     $this->form->addItem($select);
     $year = date("Y");
     $select = new ilSelectInputGUI($this->lng->txt('cal_def_date_format'), 'default_date_format');
     $select->setOptions(array(ilCalendarSettings::DATE_FORMAT_DMY => '31.10.' . $year, ilCalendarSettings::DATE_FORMAT_YMD => $year . "-10-31", ilCalendarSettings::DATE_FORMAT_MDY => "10/31/" . $year));
     $select->setInfo($this->lng->txt('cal_def_date_format_info'));
     $select->setValue($this->settings->getDefaultDateFormat());
     $this->form->addItem($select);
     $select = new ilSelectInputGUI($this->lng->txt('cal_def_time_format'), 'default_time_format');
     $select->setOptions(array(ilCalendarSettings::TIME_FORMAT_24 => '13:00', ilCalendarSettings::TIME_FORMAT_12 => '1:00pm'));
     $select->setInfo($this->lng->txt('cal_def_time_format_info'));
     $select->setValue($this->settings->getDefaultTimeFormat());
     $this->form->addItem($select);
     // Weekstart
     $radio = new ilRadioGroupInputGUI($this->lng->txt('cal_def_week_start'), 'default_week_start');
     $radio->setValue($this->settings->getDefaultWeekStart());
     $option = new ilRadioOption($this->lng->txt('l_su'), 0);
     $radio->addOption($option);
     $option = new ilRadioOption($this->lng->txt('l_mo'), 1);
     $radio->addOption($option);
     $this->form->addItem($radio);
     // Day start
     $day_start = new ilSelectInputGUI($this->lng->txt('cal_day_start'), 'dst');
     $day_start->setOptions(ilCalendarUtil::getHourSelection($this->settings->getDefaultTimeFormat()));
     $day_start->setValue($this->settings->getDefaultDayStart());
     $this->form->addItem($day_start);
     $day_end = new ilSelectInputGUI($this->lng->txt('cal_day_end'), 'den');
     $day_end->setOptions(ilCalendarUtil::getHourSelection($this->settings->getDefaultTimeFormat()));
     $day_end->setValue($this->settings->getDefaultDayEnd());
     $this->form->addItem($day_end);
     $sync = new ilCheckboxInputGUI($this->lng->txt('cal_webcal_sync'), 'webcal');
     $sync->setValue(1);
     $sync->setChecked($this->settings->isWebCalSyncEnabled());
     $sync->setInfo($this->lng->txt('cal_webcal_sync_info'));
     $sync_min = new ilNumberInputGUI('', 'webcal_hours');
     $sync_min->setSize(2);
     $sync_min->setMaxLength(3);
     $sync_min->setValue($this->settings->getWebCalSyncHours());
     $sync_min->setSuffix($this->lng->txt('hours'));
     $sync->addSubItem($sync_min);
     $this->form->addItem($sync);
     // enable milestone planning in groups
     $mil = new ilFormSectionHeaderGUI();
     $mil->setTitle($this->lng->txt('cal_milestone_settings'));
     $this->form->addItem($mil);
     $checkm = new ilCheckboxInputGUI($this->lng->txt('cal_enable_group_milestones'), 'enable_grp_milestones');
     $checkm->setValue(1);
     $checkm->setChecked($this->settings->getEnableGroupMilestones() ? true : false);
     $checkm->setInfo($this->lng->txt('cal_enable_group_milestones_desc'));
     $this->form->addItem($checkm);
     // Consultation hours
     $con = new ilFormSectionHeaderGUI();
     $con->setTitle($this->lng->txt('cal_ch_form_header'));
     $this->form->addItem($con);
     $ch = new ilCheckboxInputGUI($this->lng->txt('cal_ch_form'), 'ch');
     $ch->setInfo($this->lng->txt('cal_ch_form_info'));
     $ch->setValue(1);
     $ch->setChecked($this->settings->areConsultationHoursEnabled());
     $this->form->addItem($ch);
     // repository visibility default
     $rep = new ilFormSectionHeaderGUI();
     $rep->setTitle($GLOBALS['lng']->txt('cal_setting_global_vis_repos'));
     $this->form->addItem($rep);
     $crs = new ilCheckboxInputGUI($GLOBALS['lng']->txt('cal_setting_global_crs_vis'), 'visible_crs');
     $crs->setInfo($GLOBALS['lng']->txt('cal_setting_global_crs_vis_info'));
     $crs->setValue(1);
     $crs->setInfo($GLOBALS['lng']->txt('cal_setting_global_crs_vis_info'));
     $crs->setChecked($this->settings->isCourseCalendarEnabled());
     $this->form->addItem($crs);
     $grp = new ilCheckboxInputGUI($GLOBALS['lng']->txt('cal_setting_global_grp_vis'), 'visible_grp');
     $grp->setInfo($GLOBALS['lng']->txt('cal_setting_global_grp_vis_info'));
     $grp->setValue(1);
     $grp->setInfo($GLOBALS['lng']->txt('cal_setting_global_grp_vis_info'));
     $grp->setChecked($this->settings->isGroupCalendarEnabled());
     $this->form->addItem($grp);
     // Notifications
     $not = new ilFormSectionHeaderGUI();
     $not->setTitle($this->lng->txt('notifications'));
     $this->form->addItem($not);
     $cgn = new ilCheckboxInputGUI($this->lng->txt('cal_notification'), 'cn');
     $cgn->setOptionTitle($this->lng->txt('cal_notification_crsgrp'));
     $cgn->setValue(1);
     $cgn->setChecked($this->settings->isNotificationEnabled());
     $cgn->setInfo($this->lng->txt('cal_adm_notification_info'));
     $this->form->addItem($cgn);
     $cnu = new ilCheckboxInputGUI('', 'cnu');
     $cnu->setOptionTitle($this->lng->txt('cal_notification_users'));
     $cnu->setValue(1);
     $cnu->setChecked($this->settings->isUserNotificationEnabled());
     $cnu->setInfo($this->lng->txt('cal_adm_notification_user_info'));
     $this->form->addItem($cnu);
     // Registration
     $book = new ilFormSectionHeaderGUI();
     $book->setTitle($this->lng->txt('cal_registrations'));
     $this->form->addItem($book);
     $cgn = new ilCheckboxInputGUI($this->lng->txt('cal_cg_registrations'), 'cgr');
     $cgn->setValue(1);
     $cgn->setChecked($this->settings->isCGRegistrationEnabled());
     $cgn->setInfo($this->lng->txt('cal_cg_registration_info'));
     $this->form->addItem($cgn);
     // Synchronisation cache
     $sec = new ilFormSectionHeaderGUI();
     $sec->setTitle($this->lng->txt('cal_cache_settings'));
     $this->form->addItem($sec);
     $cache = new ilRadioGroupInputGUI($this->lng->txt('cal_sync_cache'), 'sync_cache');
     $cache->setValue((int) $this->settings->isSynchronisationCacheEnabled());
     $cache->setInfo($this->lng->txt('cal_sync_cache_info'));
     $cache->setRequired(true);
     $sync_cache = new ilRadioOption($this->lng->txt('cal_sync_disabled'), 0);
     $cache->addOption($sync_cache);
     $sync_cache = new ilRadioOption($this->lng->txt('cal_sync_enabled'), 1);
     $cache->addOption($sync_cache);
     $cache_t = new ilNumberInputGUI('', 'sync_cache_time');
     $cache_t->setValue($this->settings->getSynchronisationCacheMinutes());
     $cache_t->setMinValue(0);
     $cache_t->setSize(3);
     $cache_t->setMaxLength(3);
     $cache_t->setSuffix($this->lng->txt('form_minutes'));
     $sync_cache->addSubItem($cache_t);
     $this->form->addItem($cache);
     // Calendar cache
     $cache = new ilRadioGroupInputGUI($this->lng->txt('cal_cache'), 'cache');
     $cache->setValue((int) $this->settings->isCacheUsed());
     $cache->setInfo($this->lng->txt('cal_cache_info'));
     $cache->setRequired(true);
     $sync_cache = new ilRadioOption($this->lng->txt('cal_cache_disabled'), 0);
     $cache->addOption($sync_cache);
     $sync_cache = new ilRadioOption($this->lng->txt('cal_cache_enabled'), 1);
     $cache->addOption($sync_cache);
     $cache_t = new ilNumberInputGUI('', 'cache_time');
     $cache_t->setValue($this->settings->getCacheMinutes());
     $cache_t->setMinValue(0);
     $cache_t->setSize(3);
     $cache_t->setMaxLength(3);
     $cache_t->setSuffix($this->lng->txt('form_minutes'));
     $sync_cache->addSubItem($cache_t);
     $this->form->addItem($cache);
 }
 /**
  * init settings form
  *
  * @access protected
  */
 protected function initSettingsForm($a_mode = 'update')
 {
     if (is_object($this->form)) {
         return true;
     }
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $this->form = new ilPropertyFormGUI();
     $this->form->setFormAction($this->ctrl->getFormAction($this, 'settings'));
     $this->form->setTitle($this->lng->txt('ecs_connection_settings'));
     $ena = new ilCheckboxInputGUI($this->lng->txt('ecs_active'), 'active');
     $ena->setChecked($this->settings->isEnabled());
     $ena->setValue(1);
     $this->form->addItem($ena);
     $ser = new ilTextInputGUI($this->lng->txt('ecs_server_url'), 'server');
     $ser->setValue((string) $this->settings->getServer());
     $ser->setRequired(true);
     $this->form->addItem($ser);
     $pro = new ilSelectInputGUI($this->lng->txt('ecs_protocol'), 'protocol');
     // fixed to https
     #$pro->setOptions(array(ilECSSetting::PROTOCOL_HTTP => $this->lng->txt('http'),
     #		ilECSSetting::PROTOCOL_HTTPS => $this->lng->txt('https')));
     $pro->setOptions(array(ilECSSetting::PROTOCOL_HTTPS => 'HTTPS'));
     $pro->setValue($this->settings->getProtocol());
     $pro->setRequired(true);
     $this->form->addItem($pro);
     $por = new ilTextInputGUI($this->lng->txt('ecs_port'), 'port');
     $por->setSize(5);
     $por->setMaxLength(5);
     $por->setValue((string) $this->settings->getPort());
     $por->setRequired(true);
     $this->form->addItem($por);
     $tcer = new ilRadioGroupInputGUI($this->lng->txt('ecs_auth_type'), 'auth_type');
     $tcer->setValue($this->settings->getAuthType());
     $this->form->addItem($tcer);
     // Certificate based authentication
     $cert_based = new ilRadioOption($this->lng->txt('ecs_auth_type_cert'), ilECSSetting::AUTH_CERTIFICATE);
     $tcer->addOption($cert_based);
     $cli = new ilTextInputGUI($this->lng->txt('ecs_client_cert'), 'client_cert');
     $cli->setSize(60);
     $cli->setValue((string) $this->settings->getClientCertPath());
     $cli->setRequired(true);
     $cert_based->addSubItem($cli);
     $key = new ilTextInputGUI($this->lng->txt('ecs_cert_key'), 'key_path');
     $key->setSize(60);
     $key->setValue((string) $this->settings->getKeyPath());
     $key->setRequired(true);
     $cert_based->addSubItem($key);
     $cerp = new ilTextInputGUI($this->lng->txt('ecs_key_password'), 'key_password');
     $cerp->setSize(12);
     $cerp->setValue((string) $this->settings->getKeyPassword());
     $cerp->setInputType('password');
     $cerp->setRequired(true);
     $cert_based->addSubItem($cerp);
     $cer = new ilTextInputGUI($this->lng->txt('ecs_ca_cert'), 'ca_cert');
     $cer->setSize(60);
     $cer->setValue((string) $this->settings->getCACertPath());
     $cer->setRequired(true);
     $cert_based->addSubItem($cer);
     // Apache auth
     $apa_based = new ilRadioOption($this->lng->txt('ecs_auth_type_apache'), ilECSSetting::AUTH_APACHE);
     $tcer->addOption($apa_based);
     $user = new ilTextInputGUI($this->lng->txt('ecs_apache_user'), 'auth_user');
     $user->setSize(32);
     $user->setValue((string) $this->settings->getAuthUser());
     $user->setRequired(true);
     $apa_based->addSubItem($user);
     $pass = new ilPasswordInputGUI($this->lng->txt('ecs_apache_pass'), 'auth_pass');
     $pass->setRetype(false);
     $pass->setSize(16);
     $pass->setMaxLength(32);
     $pass->setValue((string) $this->settings->getAuthPass());
     $pass->setRequired(true);
     $apa_based->addSubItem($pass);
     $ser = new ilNonEditableValueGUI($this->lng->txt('cert_serial'));
     $ser->setValue($this->settings->getCertSerialNumber() ? $this->settings->getCertSerialNumber() : $this->lng->txt('ecs_no_value'));
     $cert_based->addSubItem($ser);
     $loc = new ilFormSectionHeaderGUI();
     $loc->setTitle($this->lng->txt('ecs_local_settings'));
     $this->form->addItem($loc);
     $pol = new ilDurationInputGUI($this->lng->txt('ecs_polling'), 'polling');
     $pol->setShowDays(false);
     $pol->setShowHours(false);
     $pol->setShowMinutes(true);
     $pol->setShowSeconds(true);
     $pol->setSeconds($this->settings->getPollingTimeSeconds());
     $pol->setMinutes($this->settings->getPollingTimeMinutes());
     $pol->setRequired(true);
     $pol->setInfo($this->lng->txt('ecs_polling_info'));
     $this->form->addItem($pol);
     $imp = new ilCustomInputGUI($this->lng->txt('ecs_import_id'));
     $imp->setRequired(true);
     $tpl = new ilTemplate('tpl.ecs_import_id_form.html', true, true, 'Services/WebServices/ECS');
     $tpl->setVariable('SIZE', 5);
     $tpl->setVariable('MAXLENGTH', 11);
     $tpl->setVariable('POST_VAR', 'import_id');
     $tpl->setVariable('PROPERTY_VALUE', $this->settings->getImportId());
     if ($this->settings->getImportId()) {
         $tpl->setVariable('COMPLETE_PATH', $this->buildPath($this->settings->getImportId()));
     }
     $imp->setHTML($tpl->get());
     $imp->setInfo($this->lng->txt('ecs_import_id_info'));
     $this->form->addItem($imp);
     $loc = new ilFormSectionHeaderGUI();
     $loc->setTitle($this->lng->txt('ecs_remote_user_settings'));
     $this->form->addItem($loc);
     $role = new ilSelectInputGUI($this->lng->txt('ecs_role'), 'global_role');
     $role->setOptions($this->prepareRoleSelect());
     $role->setValue($this->settings->getGlobalRole());
     $role->setInfo($this->lng->txt('ecs_global_role_info'));
     $role->setRequired(true);
     $this->form->addItem($role);
     $duration = new ilDurationInputGUI($this->lng->txt('ecs_account_duration'), 'duration');
     $duration->setInfo($this->lng->txt('ecs_account_duration_info'));
     $duration->setMonths($this->settings->getDuration());
     $duration->setShowSeconds(false);
     $duration->setShowMinutes(false);
     $duration->setShowHours(false);
     $duration->setShowDays(false);
     $duration->setShowMonths(true);
     $duration->setRequired(true);
     $this->form->addItem($duration);
     // Email recipients
     $loc = new ilFormSectionHeaderGUI();
     $loc->setTitle($this->lng->txt('ecs_notifications'));
     $this->form->addItem($loc);
     $rcp_user = new ilTextInputGUI($this->lng->txt('ecs_user_rcp'), 'user_recipients');
     $rcp_user->setValue((string) $this->settings->getUserRecipientsAsString());
     $rcp_user->setInfo($this->lng->txt('ecs_user_rcp_info'));
     $this->form->addItem($rcp_user);
     $rcp_econ = new ilTextInputGUI($this->lng->txt('ecs_econ_rcp'), 'econtent_recipients');
     $rcp_econ->setValue((string) $this->settings->getEContentRecipientsAsString());
     $rcp_econ->setInfo($this->lng->txt('ecs_econ_rcp_info'));
     $this->form->addItem($rcp_econ);
     $rcp_app = new ilTextInputGUI($this->lng->txt('ecs_approval_rcp'), 'approval_recipients');
     $rcp_app->setValue((string) $this->settings->getApprovalRecipientsAsString());
     $rcp_app->setInfo($this->lng->txt('ecs_approval_rcp_info'));
     $this->form->addItem($rcp_app);
     if ($a_mode == 'update') {
         $this->form->addCommandButton('update', $this->lng->txt('save'));
     } else {
         $this->form->addCommandButton('save', $this->lng->txt('save'));
     }
     $this->form->addCommandButton('overview', $this->lng->txt('cancel'));
 }
 /**
  * init form edit
  *
  * @access protected
  * @return
  */
 protected function initFormEdit()
 {
     global $tree;
     include_once "Services/Object/classes/class.ilObjectActivation.php";
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $this->form = new ilPropertyFormGUI();
     $this->form->setFormAction($this->ctrl->getFormAction($this));
     $title = ilObject::_lookupTitle(ilObject::_lookupObjId($this->getItemId()));
     $this->form->setTitle($title . ': ' . $this->lng->txt('crs_edit_timings'));
     $timings = new ilRadioGroupInputGUI($this->lng->txt('timings'), 'timing_type');
     // opt deactivated
     $dea = new ilRadioOption($this->lng->txt('crs_timings_disabled'), ilObjectActivation::TIMINGS_DEACTIVATED);
     $dea->setInfo($this->lng->txt('crs_timings_disabled_info'));
     $timings->addOption($dea);
     // Visiblity
     $vis = new ilRadioOption($this->lng->txt('crs_timings_availability_enabled'), ilObjectActivation::TIMINGS_ACTIVATION);
     #$vis->setInfo($this->lng->txt('crs_timings_visibility'));
     $start = new ilDateTimeInputGUI($this->lng->txt('crs_timings_start'), 'timing_start');
     $start->setShowTime(true);
     #$start->setMinuteStepSize(5);
     $vis->addSubItem($start);
     $end = new ilDateTimeInputGUI($this->lng->txt('crs_timings_end'), 'timing_end');
     $end->setShowTime(true);
     #$end->setMinuteStepSize(5);
     $vis->addSubItem($end);
     $isv = new ilCheckboxInputGUI($this->lng->txt('crs_timings_visibility_short'), 'visible');
     $isv->setInfo($this->lng->txt('crs_timings_visibility'));
     $isv->setValue(1);
     $vis->addSubItem($isv);
     $timings->addOption($vis);
     // Timings
     $tim = new ilRadioOption($this->lng->txt('crs_timings_presetting'), ilObjectActivation::TIMINGS_PRESETTING);
     $tim->setInfo($this->lng->txt('crs_item_presetting_info'));
     $start = new ilDateTimeInputGUI($this->lng->txt('crs_timings_sug_begin'), 'sug_start');
     $tim->addSubItem($start);
     $end = new ilDateTimeInputGUI($this->lng->txt('crs_timings_sug_end'), 'sug_end');
     $tim->addSubItem($end);
     if ($tree->checkForParentType($this->parent_ref_id, 'crs')) {
         $cha = new ilCheckboxInputGUI($this->lng->txt('crs_timings_changeable'), 'changeable');
         $tim->addSubItem($cha);
         $start = new ilDateTimeInputGUI($this->lng->txt('crs_timings_early_begin'), 'early_start');
         $tim->addSubItem($start);
         $late = new ilDateTimeInputGUI($this->lng->txt('crs_timings_short_limit_start_end'), 'late_end');
         $tim->addSubItem($late);
     }
     $timings->addOption($tim);
     $this->form->addItem($timings);
     $this->form->addCommandButton('update', $this->lng->txt('save'));
     $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
 }
Ejemplo n.º 14
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;
 }
Ejemplo n.º 15
0
 private function initHTTPSForm()
 {
     global $ilCtrl, $lng;
     $this->setServerInfoSubTabs('adm_https');
     $lng->loadLanguageModule('ps');
     include_once './Services/PrivacySecurity/classes/class.ilSecuritySettings.php';
     $security = ilSecuritySettings::_getInstance();
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setTitle($lng->txt("adm_https"));
     $form->setFormAction($ilCtrl->getFormAction($this, 'saveHTTPS'));
     $check2 = new ilCheckboxInputGUI($lng->txt('activate_https'), 'https_enabled');
     $check2->setChecked($security->isHTTPSEnabled() ? 1 : 0);
     $check2->setValue(1);
     $form->addItem($check2);
     // save and cancel commands
     $form->addCommandButton('saveHTTPS', $lng->txt('save'));
     return $form;
 }
 /**
  * Edit disk quota settings.
  */
 public function editDiskQuotaSettings()
 {
     global $rbacsystem, $ilErr, $ilSetting, $tpl, $lng, $ilCtrl;
     if (!$rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
         $ilErr->raiseError($lng->txt("no_permission"), $ilErr->WARNING);
     }
     $this->tabs_gui->setTabActive('disk_quota');
     $this->addDiskQuotaSubtabs('settings');
     require_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     require_once "./Services/Form/classes/class.ilCheckboxInputGUI.php";
     require_once "./Services/Form/classes/class.ilRadioGroupInputGUI.php";
     require_once "./Services/Form/classes/class.ilRadioOption.php";
     require_once "./Services/Form/classes/class.ilTextAreaInputGUI.php";
     require_once "./Services/WebDAV/classes/class.ilDAVServer.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($ilCtrl->getFormAction($this));
     $form->setTitle($lng->txt("settings"));
     // Enable disk quota
     $cb_prop = new ilCheckboxInputGUI($lng->txt("enable_disk_quota"), "enable_disk_quota");
     $cb_prop->setValue('1');
     $cb_prop->setChecked($this->disk_quota_obj->isDiskQuotaEnabled());
     $cb_prop->setInfo($lng->txt('enable_disk_quota_info'));
     $form->addItem($cb_prop);
     // Enable disk quota reminder mail
     $cb_prop_reminder = new ilCheckboxInputGUI($lng->txt("enable_disk_quota_reminder_mail"), "enable_disk_quota_reminder_mail");
     $cb_prop_reminder->setValue('1');
     $cb_prop_reminder->setChecked($this->disk_quota_obj->isDiskQuotaReminderMailEnabled());
     $cb_prop_reminder->setInfo($lng->txt('disk_quota_reminder_mail_desc'));
     $cb_prop->addSubItem($cb_prop_reminder);
     // Enable summary mail for certain users
     $cb_prop_summary = new ilCheckboxInputGUI($lng->txt("enable_disk_quota_summary_mail"), "enable_disk_quota_summary_mail");
     $cb_prop_summary->setValue(1);
     $cb_prop_summary->setChecked($this->disk_quota_obj->isDiskQuotaSummaryMailEnabled());
     $cb_prop_summary->setInfo($lng->txt('enable_disk_quota_summary_mail_desc'));
     $cb_prop->addSubItem($cb_prop_summary);
     // Edit disk quota recipients
     $summary_rcpt = new ilTextInputGUI($lng->txt("disk_quota_summary_rctp"), "disk_quota_summary_rctp");
     $summary_rcpt->setValue($this->disk_quota_obj->getSummaryRecipients());
     $summary_rcpt->setInfo($lng->txt('disk_quota_summary_rctp_desc'));
     $cb_prop_summary->addSubItem($summary_rcpt);
     // command buttons
     $form->addCommandButton('saveDiskQuotaSettings', $lng->txt('save'));
     $form->addCommandButton('editDiskQuotaSettings', $lng->txt('cancel'));
     $tpl->setContent($form->getHTML());
 }
 public function populateQuestionSpecificFormPart(\ilPropertyFormGUI $form)
 {
     // shuffle
     $shuffle = new ilCheckboxInputGUI($this->lng->txt("shuffle_answers"), "shuffle");
     $shuffle->setValue(1);
     $shuffle->setChecked($this->object->getShuffle());
     $shuffle->setRequired(FALSE);
     $form->addItem($shuffle);
     if ($this->object->getId()) {
         $hidden = new ilHiddenInputGUI("", "ID");
         $hidden->setValue($this->object->getId());
         $form->addItem($hidden);
     }
     if (!$this->object->getSelfAssessmentEditingMode()) {
         $isSingleline = $this->object->lastChange == 0 && !array_key_exists('types', $_POST) ? $this->object->getMultilineAnswerSetting() ? false : true : $this->object->isSingleline;
         // Answer types
         $types = new ilSelectInputGUI($this->lng->txt("answer_types"), "types");
         $types->setRequired(false);
         $types->setValue($isSingleline ? 0 : 1);
         $types->setOptions(array(0 => $this->lng->txt('answers_singleline'), 1 => $this->lng->txt('answers_multiline')));
         $form->addItem($types);
     }
     if ($isSingleline) {
         // thumb size
         $thumb_size = new ilNumberInputGUI($this->lng->txt("thumb_size"), "thumb_size");
         $thumb_size->setMinValue(20);
         $thumb_size->setDecimals(0);
         $thumb_size->setSize(6);
         $thumb_size->setInfo($this->lng->txt('thumb_size_info'));
         $thumb_size->setValue($this->object->getThumbSize());
         $thumb_size->setRequired(false);
         $form->addItem($thumb_size);
         return $isSingleline;
     }
     return $isSingleline;
 }
 /**
  * Init form settings
  */
 protected function dInitFormTreeSettings(ilPropertyFormGUI $form = null)
 {
     include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSMappingUtils.php';
     include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
     if ($form instanceof ilPropertyFormGUI) {
         return $form;
     }
     include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignment.php';
     $assignment = new ilECSNodeMappingAssignment($this->getServer()->getServerId(), $this->getMid(), (int) $_REQUEST['tid'], 0);
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this, 'dEditTree'));
     $form->setTitle($this->lng->txt('general_settings'));
     $form->addCommandButton('dUpdateTreeSettings', $this->lng->txt('save'));
     $form->addCommandButton('dTrees', $this->lng->txt('cancel'));
     $form->setTableWidth('30%');
     // CMS id (readonly)
     include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
     $cmsid = new ilNumberInputGUI($this->lng->txt('ecs_cms_id'), 'cmsid');
     $cmsid->setValue(ilECSCmsData::lookupCmsId(ilECSCmsTree::lookupRootId((int) $_REQUEST['tid'])));
     $cmsid->setDisabled(true);
     $cmsid->setSize(7);
     $cmsid->setMaxLength(12);
     $form->addItem($cmsid);
     $mapping_status = ilECSMappingUtils::lookupMappingStatus($this->getServer()->getServerId(), $this->getMid(), (int) $_REQUEST['tid']);
     $mapping_advanced = $mapping_status != ilECSMappingUtils::MAPPED_MANUAL ? true : false;
     // Status (readonly)
     $status = new ilNonEditableValueGUI($this->lng->txt('status'), '');
     $status->setValue(ilECSMappingUtils::mappingStatusToString($mapping_status));
     $form->addItem($status);
     // title update
     $title = new ilCheckboxInputGUI($this->lng->txt('ecs_title_updates'), 'title');
     $title->setValue(1);
     $title->setChecked($assignment->isTitleUpdateEnabled());
     #$title->setInfo($this->lng->txt('ecs_title_update_info'));
     $form->addItem($title);
     $position = new ilCheckboxInputGUI($this->lng->txt('ecs_position_updates'), 'position');
     $position->setDisabled(!$mapping_advanced);
     $position->setChecked($mapping_advanced && $assignment->isPositionUpdateEnabled());
     $position->setValue(1);
     #$position->setInfo($this->lng->txt('ecs_position_update_info'));
     $form->addItem($position);
     $tree = new ilCheckboxInputGUI($this->lng->txt('ecs_tree_updates'), 'tree');
     $tree->setDisabled(!$mapping_advanced);
     $tree->setChecked($mapping_advanced && $assignment->isTreeUpdateEnabled());
     $tree->setValue(1);
     #$tree->setInfo($this->lng->txt('ecs_tree_update_info'));
     $form->addItem($tree);
     return $form;
 }
Ejemplo n.º 19
0
 /**
  * init auth mode determinitation form
  *
  * @access protected
  */
 protected function initAuthModeDetermination()
 {
     if (is_object($this->form)) {
         return true;
     }
     // Are there any authentication methods that support automatic determination ?
     include_once 'Services/Authentication/classes/class.ilAuthModeDetermination.php';
     $det = ilAuthModeDetermination::_getInstance();
     if ($det->getCountActiveAuthModes() <= 1) {
         return false;
     }
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $this->form = new ilPropertyFormGUI();
     $this->form->setFormAction($this->ctrl->getFormAction($this));
     $this->form->setTableWidth('100%');
     $this->form->setTitle($this->lng->txt('auth_auth_settings'));
     $this->form->addCommandButton('updateAuthModeDetermination', $this->lng->txt('save'));
     require_once 'Services/Captcha/classes/class.ilCaptchaUtil.php';
     $cap = new ilCheckboxInputGUI($this->lng->txt('adm_captcha_anonymous_short'), 'activate_captcha_anonym');
     $cap->setInfo($this->lng->txt('adm_captcha_anonymous_auth'));
     $cap->setValue(1);
     if (!ilCaptchaUtil::checkFreetype()) {
         $cap->setAlert(ilCaptchaUtil::getPreconditionsMessage());
     }
     $cap->setChecked(ilCaptchaUtil::isActiveForLogin());
     $this->form->addItem($cap);
     $header = new ilFormSectionHeaderGUI();
     $header->setTitle($this->lng->txt('auth_auth_mode_determination'));
     $this->form->addItem($header);
     $kind = new ilRadioGroupInputGUI($this->lng->txt('auth_kind_determination'), 'kind');
     $kind->setInfo($this->lng->txt('auth_mode_determination_info'));
     $kind->setValue($det->getKind());
     $kind->setRequired(true);
     $option_user = new ilRadioOption($this->lng->txt('auth_by_user'), 0);
     $kind->addOption($option_user);
     $option_determination = new ilRadioOption($this->lng->txt('auth_automatic'), 1);
     include_once 'Services/Authentication/classes/class.ilAuthUtils.php';
     $auth_sequenced = $det->getAuthModeSequence();
     $counter = 1;
     foreach ($auth_sequenced as $auth_mode) {
         switch ($auth_mode) {
             case AUTH_LDAP:
                 $text = $this->lng->txt('auth_ldap');
                 break;
             case AUTH_RADIUS:
                 $text = $this->lng->txt('auth_radius');
                 break;
             case AUTH_LOCAL:
                 $text = $this->lng->txt('auth_local');
                 break;
             case AUTH_SOAP:
                 $text = $this->lng->txt('auth_soap');
                 break;
             case AUTH_APACHE:
                 $text = $this->lng->txt('auth_apache');
                 break;
                 // begin-patch auth_plugin
             // begin-patch auth_plugin
             default:
                 foreach (ilAuthUtils::getAuthPlugins() as $pl) {
                     $option = $pl->getMultipleAuthModeOptions($auth_mode);
                     $text = $option[$auth_mode]['txt'];
                 }
                 break;
                 // end-patch auth_plugin
         }
         $pos = new ilTextInputGUI($text, 'position[' . $auth_mode . ']');
         $pos->setValue($counter++);
         $pos->setSize(1);
         $pos->setMaxLength(1);
         $option_determination->addSubItem($pos);
     }
     $kind->addOption($option_determination);
     $this->form->addItem($kind);
     return true;
 }
 /**
  * @return ilPropertyFormGUI
  */
 protected function getSettingsForm()
 {
     require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this, 'saveSettings'));
     $form->setTitle($this->lng->txt('settings'));
     $frm_radio = new ilRadioGroupInputGUI($this->lng->txt('show_topics_overview'), 'forum_overview');
     $frm_radio->addOption(new ilRadioOption($this->lng->txt('new') . ', ' . $this->lng->txt('is_read') . ', ' . $this->lng->txt('unread'), '0'));
     $frm_radio->addOption(new ilRadioOption($this->lng->txt('is_read') . ', ' . $this->lng->txt('unread'), '1'));
     $frm_radio->setInfo($this->lng->txt('topics_overview_info'));
     $form->addItem($frm_radio);
     $check = new ilCheckboxInputGui($this->lng->txt('enable_fora_statistics'), 'fora_statistics');
     $check->setInfo($this->lng->txt('enable_fora_statistics_desc'));
     $form->addItem($check);
     $check = new ilCheckboxInputGui($this->lng->txt('enable_anonymous_fora'), 'anonymous_fora');
     $check->setInfo($this->lng->txt('enable_anonymous_fora_desc'));
     $form->addItem($check);
     require_once 'Services/Cron/classes/class.ilCronManager.php';
     if (ilCronManager::isJobActive('frm_notification')) {
         require_once 'Services/Administration/classes/class.ilAdministrationSettingsFormHandler.php';
         ilAdministrationSettingsFormHandler::addFieldsToForm(ilAdministrationSettingsFormHandler::FORM_FORUM, $form, $this);
     } else {
         $notifications = new ilCheckboxInputGui($this->lng->txt('cron_forum_notification'), 'forum_notification');
         $notifications->setInfo($this->lng->txt('cron_forum_notification_desc'));
         $notifications->setValue(1);
         $form->addItem($notifications);
     }
     require_once 'Services/Captcha/classes/class.ilCaptchaUtil.php';
     $cap = new ilCheckboxInputGUI($this->lng->txt('adm_captcha_anonymous_short'), 'activate_captcha_anonym');
     $cap->setInfo($this->lng->txt('adm_captcha_anonymous_frm'));
     $cap->setValue(1);
     if (!ilCaptchaUtil::checkFreetype()) {
         $cap->setAlert(ilCaptchaUtil::getPreconditionsMessage());
     }
     $form->addItem($cap);
     $form->addCommandButton('saveSettings', $this->lng->txt('save'));
     $form->addCommandButton('cancel', $this->lng->txt('cancel'));
     return $form;
 }
Ejemplo n.º 21
0
 public function populateQuestionSpecificFormPart(ilPropertyFormGUI $form)
 {
     // maxsize
     $maxsize = new ilNumberInputGUI($this->lng->txt("maxsize"), "maxsize");
     $maxsize->setValue($this->object->getMaxSize());
     $maxsize->setInfo($this->lng->txt("maxsize_info"));
     $maxsize->setSize(10);
     $maxsize->setMinValue(0);
     $maxsize->setMaxValue($this->determineMaxFilesize());
     $maxsize->setRequired(FALSE);
     $form->addItem($maxsize);
     // allowedextensions
     $allowedextensions = new ilTextInputGUI($this->lng->txt("allowedextensions"), "allowedextensions");
     $allowedextensions->setInfo($this->lng->txt("allowedextensions_info"));
     $allowedextensions->setValue($this->object->getAllowedExtensions());
     $allowedextensions->setRequired(FALSE);
     $form->addItem($allowedextensions);
     // points
     $points = new ilNumberInputGUI($this->lng->txt("points"), "points");
     $points->allowDecimals(true);
     $points->setValue(is_numeric($this->object->getPoints()) && $this->object->getPoints() >= 0 ? $this->object->getPoints() : '');
     $points->setRequired(TRUE);
     $points->setSize(3);
     $points->setMinValue(0.0);
     $points->setMinvalueShouldBeGreater(false);
     $form->addItem($points);
     $subcompl = new ilCheckboxInputGUI($this->lng->txt('ass_completion_by_submission'), 'completion_by_submission');
     $subcompl->setInfo($this->lng->txt('ass_completion_by_submission_info'));
     $subcompl->setValue(1);
     $subcompl->setChecked($this->object->isCompletionBySubmissionEnabled());
     $form->addItem($subcompl);
     return $form;
 }
 /**
  * Init upload form.
  */
 public function initUploadForm()
 {
     global $lng, $ilCtrl;
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form = new ilPropertyFormGUI();
     // type selection
     $options = array("scorm2004" => $lng->txt("lm_type_scorm2004"), "scorm" => $lng->txt("lm_type_scorm"), "aicc" => $lng->txt("lm_type_aicc"), "hacp" => $lng->txt("lm_type_hacp"));
     $si = new ilSelectInputGUI($this->lng->txt("type"), "sub_type");
     $si->setOptions($options);
     $this->form->addItem($si);
     // input file
     $fi = new ilFileInputGUI($this->lng->txt("select_file"), "scormfile");
     $fi->setRequired(true);
     $this->form->addItem($fi);
     // todo "uploaded file"
     // todo wysiwyg editor removement
     include_once 'Services/FileSystem/classes/class.ilUploadFiles.php';
     if (ilUploadFiles::_getUploadDirectory()) {
         $options = array();
         $fi->setRequired(false);
         $files = ilUploadFiles::_getUploadFiles();
         $options[""] = $this->lng->txt("cont_select_from_upload_dir");
         foreach ($files as $file) {
             $file = htmlspecialchars($file, ENT_QUOTES, "utf-8");
             $options[$file] = $file;
         }
         //
         $si = new ilSelectInputGUI($this->lng->txt("cont_uploaded_file"), "uploaded_file");
         $si->setOptions($options);
         $this->form->addItem($si);
     }
     // validate file
     $cb = new ilCheckboxInputGUI($this->lng->txt("cont_validate_file"), "validate");
     $cb->setValue("y");
     //$cb->setChecked(true);
     $this->form->addItem($cb);
     // import for editing
     $cb = new ilCheckboxInputGUI($this->lng->txt("sahs_authoring_mode"), "editable");
     $cb->setValue("y");
     $cb->setInfo($this->lng->txt("sahs_authoring_mode_info"));
     $this->form->addItem($cb);
     //
     $radg = new ilRadioGroupInputGUI($lng->txt("sahs_sequencing"), "import_sequencing");
     $radg->setValue(0);
     $op1 = new ilRadioOption($lng->txt("sahs_std_sequencing"), 0, $lng->txt("sahs_std_sequencing_info"));
     $radg->addOption($op1);
     $op1 = new ilRadioOption($lng->txt("sahs_import_sequencing"), 1, $lng->txt("sahs_import_sequencing_info"));
     $radg->addOption($op1);
     $cb->addSubItem($radg);
     $this->form->addCommandButton("upload", $lng->txt("import"));
     $this->form->addCommandButton("cancel", $lng->txt("cancel"));
     $this->form->setTitle($lng->txt("import_sahs"));
     $this->form->setFormAction($ilCtrl->getFormAction($this, "upload"));
     $this->form->setTarget(ilFrameTargetInfo::_getFrame("MainContent"));
 }
 protected function initSettingsForm()
 {
     global $ilSetting;
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setTitle($this->lng->txt("settings"));
     $form->setFormAction($this->ctrl->getFormAction($this, 'saveSettings'));
     // default repository view
     $options = array("flat" => $this->lng->txt("flatview"), "tree" => $this->lng->txt("treeview"));
     $si = new ilSelectInputGUI($this->lng->txt("def_repository_view"), "default_rep_view");
     $si->setOptions($options);
     $si->setInfo($this->lng->txt(""));
     if ($ilSetting->get("default_repository_view") == "tree") {
         $si->setValue("tree");
     } else {
         $si->setValue("flat");
     }
     $form->addItem($si);
     //
     $options = array("" => $this->lng->txt("adm_rep_tree_only_container"), "tree" => $this->lng->txt("adm_all_resource_types"));
     // repository tree
     $radg = new ilRadioGroupInputGUI($this->lng->txt("adm_rep_tree_presentation"), "tree_pres");
     $radg->setValue($ilSetting->get("repository_tree_pres"));
     $op1 = new ilRadioOption($this->lng->txt("adm_rep_tree_only_cntr"), "", $this->lng->txt("adm_rep_tree_only_cntr_info"));
     $radg->addOption($op1);
     $op2 = new ilRadioOption($this->lng->txt("adm_rep_tree_all_types"), "all_types", $this->lng->txt("adm_rep_tree_all_types_info"));
     // limit tree in courses and groups
     $cb = new ilCheckboxInputGUI($this->lng->txt("adm_rep_tree_limit_grp_crs"), "rep_tree_limit_grp_crs");
     $cb->setChecked($ilSetting->get("rep_tree_limit_grp_crs"));
     $cb->setInfo($this->lng->txt("adm_rep_tree_limit_grp_crs_info"));
     $op2->addSubItem($cb);
     $radg->addOption($op2);
     $form->addItem($radg);
     /* OBSOLETE
     		// synchronize repository tree with main view
     		$cb = new ilCheckboxInputGUI($this->lng->txt("adm_synchronize_rep_tree"), "rep_tree_synchronize");
     		$cb->setInfo($this->lng->txt("adm_synchronize_rep_tree_info"));
     		$cb->setChecked($ilSetting->get("rep_tree_synchronize"));
     		$form->addItem($cb);
     		*/
     /* DISABLED
     		// repository access check
     		$options = array(
     			0 => "0",
     			10 => "10",
     			30 => "30",
     			60 => "60",
     			120 => "120"
     			);
     		$si = new ilSelectInputGUI($this->lng->txt("adm_repository_cache_time"), "rep_cache");
     		$si->setOptions($options);
     		$si->setValue($ilSetting->get("rep_cache"));
     		$si->setInfo($this->lng->txt("adm_repository_cache_time_info")." ".
     			$this->lng->txt("adm_repository_cache_time_info2"));
     		$form->addItem($si);
     		*/
     // trash
     $cb = new ilCheckboxInputGUI($this->lng->txt("enable_trash"), "enable_trash");
     $cb->setInfo($this->lng->txt("enable_trash_info"));
     if ($ilSetting->get("enable_trash")) {
         $cb->setChecked(true);
     }
     $form->addItem($cb);
     // change event
     require_once 'Services/Tracking/classes/class.ilChangeEvent.php';
     $this->lng->loadLanguageModule("trac");
     $event = new ilCheckboxInputGUI($this->lng->txt('trac_repository_changes'), 'change_event_tracking');
     $event->setChecked(ilChangeEvent::_isActive());
     $form->addItem($event);
     include_once "Services/Administration/classes/class.ilAdministrationSettingsFormHandler.php";
     ilAdministrationSettingsFormHandler::addFieldsToForm(ilAdministrationSettingsFormHandler::FORM_REPOSITORY, $form, $this);
     // object lists
     $lists = new ilFormSectionHeaderGUI();
     $lists->setTitle($this->lng->txt("rep_object_lists"));
     $form->addItem($lists);
     $sdesc = new ilCheckboxInputGUI($this->lng->txt("adm_rep_shorten_description"), "rep_shorten_description");
     $sdesc->setInfo($this->lng->txt("adm_rep_shorten_description_info"));
     $sdesc->setChecked($ilSetting->get("rep_shorten_description"));
     $form->addItem($sdesc);
     $sdesclen = new ilNumberInputGUI($this->lng->txt("adm_rep_shorten_description_length"), "rep_shorten_description_length");
     $sdesclen->setValue($ilSetting->get("rep_shorten_description_length"));
     $sdesclen->setSize(3);
     $sdesc->addSubItem($sdesclen);
     // load action commands asynchronously
     $cb = new ilCheckboxInputGUI($this->lng->txt("adm_item_cmd_asynch"), "item_cmd_asynch");
     $cb->setInfo($this->lng->txt("adm_item_cmd_asynch_info"));
     $cb->setChecked($ilSetting->get("item_cmd_asynch"));
     $form->addItem($cb);
     // notes/comments/tagging
     $pl = new ilCheckboxInputGUI($this->lng->txt('adm_show_comments_tagging_in_lists'), 'comments_tagging_in_lists');
     $pl->setValue(1);
     $pl->setChecked($ilSetting->get('comments_tagging_in_lists'));
     $form->addItem($pl);
     $pltags = new ilCheckboxInputGUI($this->lng->txt('adm_show_comments_tagging_in_lists_tags'), 'comments_tagging_in_lists_tags');
     $pltags->setValue(1);
     $pltags->setChecked($ilSetting->get('comments_tagging_in_lists_tags'));
     $pl->addSubItem($pltags);
     $form->addCommandButton('saveSettings', $this->lng->txt('save'));
     return $form;
 }
 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;
 }
 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'));
 }
Ejemplo n.º 26
0
 private function initForm()
 {
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $this->form = new ilPropertyFormGUI();
     $this->form->setFormAction($this->ctrl->getFormAction($this, 'save'));
     $this->form->setTitle($this->lng->txt('general_settings'));
     // Subject prefix
     $pre = new ilTextInputGUI($this->lng->txt('mail_subject_prefix'), 'mail_subject_prefix');
     $pre->setSize(12);
     $pre->setMaxLength(32);
     $pre->setInfo($this->lng->txt('mail_subject_prefix_info'));
     $this->form->addItem($pre);
     // incoming type
     include_once 'Services/Mail/classes/class.ilMailOptions.php';
     $options = array(IL_MAIL_LOCAL => $this->lng->txt('mail_incoming_local'), IL_MAIL_EMAIL => $this->lng->txt('mail_incoming_smtp'), IL_MAIL_BOTH => $this->lng->txt('mail_incoming_both'));
     $si = new ilSelectInputGUI($this->lng->txt('mail_incoming'), 'mail_incoming_mail');
     $si->setOptions($options);
     $this->ctrl->setParameterByClass('ilobjuserfoldergui', 'ref_id', USER_FOLDER_ID);
     $si->setInfo(sprintf($this->lng->txt('mail_settings_incoming_type_see_also'), $this->ctrl->getLinkTargetByClass('ilobjuserfoldergui', 'settings')));
     $this->ctrl->clearParametersByClass('ilobjuserfoldergui');
     $this->form->addItem($si);
     // noreply address
     $ti = new ilTextInputGUI($this->lng->txt('mail_external_sender_noreply'), 'mail_external_sender_noreply');
     $ti->setInfo($this->lng->txt('info_mail_external_sender_noreply'));
     $ti->setMaxLength(255);
     $this->form->addItem($ti);
     $system_sender_name = new ilTextInputGUI($this->lng->txt('mail_system_sender_name'), 'mail_system_sender_name');
     $system_sender_name->setInfo($this->lng->txt('mail_system_sender_name_info'));
     $system_sender_name->setMaxLength(255);
     $this->form->addItem($system_sender_name);
     $cb = new ilCheckboxInputGUI($this->lng->txt('mail_use_pear_mail'), 'pear_mail_enable');
     $cb->setInfo($this->lng->txt('mail_use_pear_mail_info'));
     $cb->setValue(1);
     $this->form->addItem($cb);
     // prevent smtp mails
     $cb = new ilCheckboxInputGUI($this->lng->txt('mail_prevent_smtp_globally'), 'prevent_smtp_globally');
     $cb->setValue(1);
     $this->form->addItem($cb);
     $cron_mail = new ilSelectInputGUI($this->lng->txt('cron_mail_notification'), 'mail_notification');
     $cron_options = array(0 => $this->lng->txt('cron_mail_notification_never'), 1 => $this->lng->txt('cron_mail_notification_cron'));
     $cron_mail->setOptions($cron_options);
     $cron_mail->setInfo($this->lng->txt('cron_mail_notification_desc'));
     $this->form->addItem($cron_mail);
     // section header
     $sh = new ilFormSectionHeaderGUI();
     $sh->setTitle($this->lng->txt('mail') . ' (' . $this->lng->txt('internal_system') . ')');
     $this->form->addItem($sh);
     // max attachment size
     $ti = new ilNumberInputGUI($this->lng->txt('mail_maxsize_attach'), 'mail_maxsize_attach');
     $ti->setSuffix($this->lng->txt('kb'));
     $ti->setInfo($this->lng->txt('mail_max_size_attachments_total'));
     $ti->setMaxLength(10);
     $ti->setSize(10);
     $this->form->addItem($ti);
     // Course/Group member notification
     $mn = new ilFormSectionHeaderGUI();
     $mn->setTitle($this->lng->txt('mail_member_notification'));
     $this->form->addItem($mn);
     include_once "Services/Administration/classes/class.ilAdministrationSettingsFormHandler.php";
     ilAdministrationSettingsFormHandler::addFieldsToForm(ilAdministrationSettingsFormHandler::FORM_MAIL, $this->form, $this);
     $this->form->addCommandButton('save', $this->lng->txt('save'));
 }
 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());
 }
 /**
  * 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;
 }
Ejemplo n.º 29
0
 public function populateQuestionSpecificFormPart(\ilPropertyFormGUI $form)
 {
     // points
     $points = new ilNumberInputGUI($this->lng->txt("points"), "points");
     $points->setValue($this->object->getPoints());
     $points->setRequired(TRUE);
     $points->setSize(3);
     $points->setMinValue(0.0);
     $form->addItem($points);
     $header = new ilFormSectionHeaderGUI();
     $header->setTitle($this->lng->txt("applet_attributes"));
     $form->addItem($header);
     // java applet
     $javaapplet = $this->object->getJavaAppletFilename();
     $applet = new ilFileInputGUI($this->lng->txt('javaapplet'), 'javaappletName');
     $applet->setSuffixes(array('jar', 'class'));
     $applet->setRequired(false);
     if (strlen($javaapplet)) {
         $filename = new ilNonEditableValueGUI($this->lng->txt('filename'), 'uploaded_javaapplet');
         $filename->setValue($javaapplet);
         $applet->addSubItem($filename);
         $delete = new ilCheckboxInputGUI('', 'delete_applet');
         $delete->setOptionTitle($this->lng->txt('delete'));
         $delete->setValue(1);
         $applet->addSubItem($delete);
     }
     $form->addItem($applet);
     // Code
     $code = new ilTextInputGUI($this->lng->txt("code"), "java_code");
     $code->setValue($this->object->getJavaCode());
     $code->setRequired(TRUE);
     $form->addItem($code);
     if (!strlen($javaapplet)) {
         // Archive
         $archive = new ilTextInputGUI($this->lng->txt("archive"), "java_archive");
         $archive->setValue($this->object->getJavaArchive());
         $archive->setRequired(false);
         $form->addItem($archive);
         // Codebase
         $codebase = new ilTextInputGUI($this->lng->txt("codebase"), "java_codebase");
         $codebase->setValue($this->object->getJavaCodebase());
         $codebase->setRequired(false);
         $form->addItem($codebase);
     }
     // Width
     $width = new ilNumberInputGUI($this->lng->txt("width"), "java_width");
     $width->setDecimals(0);
     $width->setSize(6);
     $width->setMinValue(50);
     $width->setMaxLength(6);
     $width->setValue($this->object->getJavaWidth());
     $width->setRequired(TRUE);
     $form->addItem($width);
     // Height
     $height = new ilNumberInputGUI($this->lng->txt("height"), "java_height");
     $height->setDecimals(0);
     $height->setSize(6);
     $height->setMinValue(50);
     $height->setMaxLength(6);
     $height->setValue($this->object->getJavaHeight());
     $height->setRequired(TRUE);
     $form->addItem($height);
     $header = new ilFormSectionHeaderGUI();
     $header->setTitle($this->lng->txt("applet_parameters"));
     $form->addItem($header);
     include_once "./Modules/TestQuestionPool/classes/class.ilKVPWizardInputGUI.php";
     $kvp = new ilKVPWizardInputGUI($this->lng->txt("applet_parameters"), "kvp");
     $values = array();
     for ($i = 0; $i < $this->object->getParameterCount(); $i++) {
         $param = $this->object->getParameter($i);
         array_push($values, array($param['name'], $param['value']));
     }
     if (count($values) == 0) {
         array_push($values, array("", ""));
     }
     $kvp->setKeyName($this->lng->txt('name'));
     $kvp->setValueName($this->lng->txt('value'));
     $kvp->setValues($values);
     $form->addItem($kvp);
 }
 /**
  * Init/create property form for fields
  * @return 
  */
 protected function initFieldForm($a_mode)
 {
     if ($this->form instanceof ilPropertyFormGUI) {
         return true;
     }
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $this->form = new ilPropertyFormGUI();
     switch ($a_mode) {
         case self::MODE_CREATE:
             $this->form->setFormAction($this->ctrl->getFormAction($this));
             $this->form->setTitle($this->lng->txt('ps_cdf_add_field'));
             $this->form->addCommandButton('saveField', $this->lng->txt('save'));
             $this->form->addCommandButton('listFields', $this->lng->txt('cancel'));
             break;
         case self::MODE_UPDATE:
             $this->ctrl->setParameter($this, 'field_id', (int) $_REQUEST['field_id']);
             $this->form->setFormAction($this->ctrl->getFormAction($this));
             $this->form->setTitle($this->lng->txt('ps_cdf_edit_field'));
             $this->form->addCommandButton('updateField', $this->lng->txt('save'));
             $this->form->addCommandButton('listFields', $this->lng->txt('cancel'));
             break;
     }
     // Name
     $na = new ilTextInputGUI($this->lng->txt('ps_cdf_name'), 'na');
     $na->setSize(32);
     $na->setMaxLength(255);
     $na->setRequired(true);
     $this->form->addItem($na);
     // Type
     $ty = new ilRadioGroupInputGUI($this->lng->txt('ps_field_type'), 'ty');
     $ty->setRequired(true);
     $this->form->addItem($ty);
     //		Text type
     $ty_te = new ilRadioOption($this->lng->txt('ps_type_txt_long'), IL_CDF_TYPE_TEXT);
     $ty->addOption($ty_te);
     //		Select Type
     $ty_se = new ilRadioOption($this->lng->txt('ps_type_select_long'), IL_CDF_TYPE_SELECT);
     $ty->addOption($ty_se);
     // Select Type Values
     include_once './Services/Form/classes/class.ilSelectBuilderInputGUI.php';
     $ty_se_mu = new ilSelectBuilderInputGUI($this->lng->txt('ps_cdf_value'), 'va');
     $ty_se_mu->setAllowMove(true);
     $ty_se_mu->setRequired(true);
     $ty_se_mu->setSize(32);
     $ty_se_mu->setMaxLength(128);
     $ty_se->addSubItem($ty_se_mu);
     // Required
     $re = new ilCheckboxInputGUI($this->lng->txt('ps_cdf_required'), 're');
     $re->setValue(1);
     $this->form->addItem($re);
 }