/** * List templates */ function listTemplates() { // list pages include_once "./Modules/Wiki/classes/class.ilWikiPage.php"; $pages = ilWikiPage::getAllPages($this->wiki->getId()); $options = array("" => $this->lng->txt("please_select")); foreach ($pages as $p) { //if (!in_array($p["id"], $ipages_ids)) //{ $options[$p["id"]] = ilUtil::shortenText($p["title"], 60, true); //} } $this->toolbar->setFormAction($this->ctrl->getFormAction($this)); $this->toolbar->setOpenFormTag(true); $this->toolbar->setCloseFormTag(false); if (count($options) > 0) { include_once "./Services/Form/classes/class.ilSelectInputGUI.php"; $si = new ilSelectInputGUI($this->lng->txt("wiki_pages"), "templ_page_id"); $si->setOptions($options); $this->toolbar->addInputItem($si); $this->toolbar->addFormButton($this->lng->txt("wiki_add_template"), "add"); $this->toolbar->addSeparator(); } // empty page as template? include_once "./Services/Form/classes/class.ilCheckboxInputGUI.php"; $cb = new ilCheckboxInputGUI($this->lng->txt("wiki_empty_page_template"), "empty_page_templ"); $cb->setChecked($this->wiki->getEmptyPageTemplate()); $this->toolbar->addInputItem($cb, true); $this->toolbar->addFormButton($this->lng->txt("save"), "saveTemplateSettings"); include_once "./Modules/Wiki/classes/class.ilWikiPageTemplatesTableGUI.php"; $tab = new ilWikiPageTemplatesTableGUI($this, "listTemplates", $this->wiki->getId()); $tab->setOpenFormTag(false); $tab->setCloseFormTag(true); $this->tpl->setContent($tab->getHTML()); }
public function build() { $this->setFormAction($this->ctrl->getFormAction($this->questionSetConfigGUI)); $this->setTitle($this->lng->txt('tst_rnd_quest_set_cfg_general_form')); $this->setId('tstRndQuestSetCfgGeneralForm'); $this->addCommandButton(ilTestRandomQuestionSetConfigGUI::CMD_SAVE_GENERAL_CONFIG_FORM, $this->lng->txt('save')); // Require Pools with Homogeneous Scored Questions $requirePoolsQuestionsHomoScored = new ilCheckboxInputGUI($this->lng->txt('tst_inp_all_quest_points_equal_per_pool'), 'quest_points_equal_per_pool'); $requirePoolsQuestionsHomoScored->setInfo($this->lng->txt('tst_inp_all_quest_points_equal_per_pool_desc')); $requirePoolsQuestionsHomoScored->setChecked($this->questionSetConfig->arePoolsWithHomogeneousScoredQuestionsRequired()); $this->addItem($requirePoolsQuestionsHomoScored); // question amount config mode (per test / per pool) $questionAmountConfigMode = new ilRadioGroupInputGUI($this->lng->txt('tst_inp_quest_amount_cfg_mode'), 'quest_amount_cfg_mode'); $questionAmountConfigMode->setValue($this->fetchValidQuestionAmountConfigModeWithFallbackModePerTest($this->questionSetConfig)); $questionAmountConfigModePerTest = new ilRadioOption($this->lng->txt('tst_inp_quest_amount_cfg_mode_test'), ilTestRandomQuestionSetConfig::QUESTION_AMOUNT_CONFIG_MODE_PER_TEST); $questionAmountConfigMode->addOption($questionAmountConfigModePerTest); $questionAmountConfigModePerPool = new ilRadioOption($this->lng->txt('tst_inp_quest_amount_cfg_mode_pool'), ilTestRandomQuestionSetConfig::QUESTION_AMOUNT_CONFIG_MODE_PER_POOL); $questionAmountConfigMode->addOption($questionAmountConfigModePerPool); $questionAmountConfigMode->setRequired(true); $this->addItem($questionAmountConfigMode); // question amount per test $questionAmountPerTest = new ilNumberInputGUI($this->lng->txt('tst_inp_quest_amount_per_test'), 'quest_amount_per_test'); $questionAmountPerTest->setRequired(true); $questionAmountPerTest->setMinValue(0); $questionAmountPerTest->allowDecimals(false); $questionAmountPerTest->setMinvalueShouldBeGreater(true); $questionAmountPerTest->setSize(4); $questionAmountPerTest->setValue($this->questionSetConfig->getQuestionAmountPerTest()); $questionAmountConfigModePerTest->addSubItem($questionAmountPerTest); if ($this->testOBJ->participantDataExist()) { $requirePoolsQuestionsHomoScored->setDisabled(true); $questionAmountConfigMode->setDisabled(true); $questionAmountPerTest->setDisabled(true); } }
public function addToForm() { global $lng; $adt = $this->getADT(); $default = false; if ($adt->isNull()) { // see ilPersonalProfileGUI::addLocationToForm() // use installation default include_once "./Services/Maps/classes/class.ilMapUtil.php"; $def = ilMapUtil::getDefaultSettings(); $adt->setLatitude($def["latitude"]); $adt->setLongitude($def["longitude"]); $adt->setZoom($def["zoom"]); $default = true; } // :TODO: title? $title = $this->isRequired() ? $this->getTitle() : $lng->txt("location"); $loc = new ilLocationInputGUI($title, $this->getElementId()); $loc->setLongitude($adt->getLongitude()); $loc->setLatitude($adt->getLatitude()); $loc->setZoom($adt->getZoom()); $this->addBasicFieldProperties($loc, $adt->getCopyOfDefinition()); if (!$this->isRequired()) { $optional = new ilCheckboxInputGUI($this->getTitle(), $this->getElementId() . "_tgl"); $optional->addSubItem($loc); $this->addToParentElement($optional); if (!$default && !$adt->isNull()) { $optional->setChecked(true); } } else { $this->addToParentElement($loc); } }
public function addToForm() { global $lng; $adt = $this->getADT(); $default = false; if ($adt->isNull()) { // see ilPersonalProfileGUI::addLocationToForm() // use installation default include_once "./Services/Maps/classes/class.ilMapUtil.php"; $def = ilMapUtil::getDefaultSettings(); $adt->setLatitude($def["latitude"]); $adt->setLongitude($def["longitude"]); $adt->setZoom($def["zoom"]); $default = true; } $optional = new ilCheckboxInputGUI($this->getTitle(), $this->addToElementId("tgl")); if (!$default && !$adt->isNull()) { $optional->setChecked(true); } $loc = new ilLocationInputGUI($lng->txt("location"), $this->getElementId()); $loc->setLongitude($adt->getLongitude()); $loc->setLatitude($adt->getLatitude()); $loc->setZoom($adt->getZoom()); $optional->addSubItem($loc); $rad = new ilNumberInputGUI($lng->txt("form_location_radius"), $this->addToElementId("rad")); $rad->setSize(4); $rad->setSuffix($lng->txt("form_location_radius_km")); $rad->setValue($this->radius); $rad->setRequired(true); $optional->addSubItem($rad); $this->addToParentElement($optional); }
/** * 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")); }
protected function initEditCustomForm(ilPropertyFormGUI $a_form) { global $lng, $ilSetting; if ($this->id_type == self::REPOSITORY_NODE_ID) { $appr = new ilCheckboxInputGUI($lng->txt("blog_enable_approval"), "approval"); $appr->setInfo($lng->txt("blog_enable_approval_info")); $a_form->addItem($appr); } $notes = new ilCheckboxInputGUI($lng->txt("blog_enable_notes"), "notes"); $a_form->addItem($notes); if ($ilSetting->get('enable_global_profiles')) { $rss = new ilCheckboxInputGUI($lng->txt("blog_enable_rss"), "rss"); $rss->setInfo($lng->txt("blog_enable_rss_info")); $a_form->addItem($rss); } $ppic = new ilCheckboxInputGUI($lng->txt("blog_profile_picture"), "ppic"); $a_form->addItem($ppic); $blga_set = new ilSetting("blga"); if ($blga_set->get("banner")) { $dimensions = " (" . $blga_set->get("banner_width") . "x" . $blga_set->get("banner_height") . ")"; $img = new ilImageFileInputGUI($lng->txt("blog_banner") . $dimensions, "banner"); $a_form->addItem($img); // show existing file $file = $this->object->getImageFullPath(true); if ($file) { $img->setImage($file); } } $bg_color = new ilColorPickerInputGUI($lng->txt("blog_background_color"), "bg_color"); $a_form->addItem($bg_color); $font_color = new ilColorPickerInputGUI($lng->txt("blog_font_color"), "font_color"); $a_form->addItem($font_color); }
public function addCustomSettingsToForm(ilPropertyFormGUI $a_form) { global $lng, $ilSetting; $cb = new ilCheckboxInputGUI($lng->txt("cron_mail_notification_message"), "mail_notification_message"); $cb->setInfo($lng->txt("cron_mail_notification_message_info")); $cb->setChecked($ilSetting->get("mail_notification_message")); $a_form->addItem($cb); }
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); } }
public function initPluginSettings() { if ($this->getAdminConfigObject()->getDefaultAllowPublicLinksConfigAllowPublicLinks() && $this->getAdminConfigObject()->getDefaultAllowPublicLinks()) { $public_links = new ilCheckboxInputGUI($this->txt("activate_public_links"), "activate_public_links"); $public_links->setInfo($this->txt("info_activate_public_links")); $this->form->addItem($public_links); } if ($this->getAdminConfigObject()->getConfigMaxFileSize()) { $max_file_size = new ilNumberInputGUI($this->txt("max_file_size"), "max_file_size"); $max_file_size->setInfo($this->txt("info_max_file_size")); $max_file_size->setMaxLength(10); $max_file_size->setSize(10); $this->form->addItem($max_file_size); } }
/** * 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; }
public function checkInput() { if ($this->getRequired() && !isset($_POST[$this->getPostVar()])) { global $lng; $this->setAlert($lng->txt("msg_input_is_required")); return false; } return parent::checkInput(); }
/** * Edit question overview form. */ function edit($a_insert = false) { global $ilCtrl, $tpl, $lng; $this->displayValidationError(); // edit form include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($ilCtrl->getFormAction($this)); if ($a_insert) { $form->setTitle($this->lng->txt("cont_ed_insert_qover")); } else { $form->setTitle($this->lng->txt("cont_edit_qover")); } // short message $cb = new ilCheckboxInputGUI($this->lng->txt("cont_qover_short_message"), "short"); $cb->setInfo($this->lng->txt("cont_qover_short_message_info")); if (!$a_insert) { $cb->setChecked($this->content_obj->getShortMessage()); } else { $cb->setChecked(true); } $form->addItem($cb); // list wrong questions $cb = new ilCheckboxInputGUI($this->lng->txt("cont_qover_list_wrong_q"), "wrong_questions"); $cb->setInfo($this->lng->txt("cont_qover_list_wrong_q_info")); if (!$a_insert) { $cb->setChecked($this->content_obj->getListWrongQuestions()); } $form->addItem($cb); // save/cancel buttons if ($a_insert) { $form->addCommandButton("create_qover", $lng->txt("save")); $form->addCommandButton("cancelCreate", $lng->txt("cancel")); } else { $form->addCommandButton("update", $lng->txt("save")); $form->addCommandButton("cancelUpdate", $lng->txt("cancel")); } $html = $form->getHTML(); $tpl->setContent($html); return $ret; }
/** * @param ilRadioOption $option * @throws ilCloudPluginConfigException */ public function initPluginCreationFormSection(ilRadioOption $option) { $option->setInfo($this->txt("create_info1") . "</br>" . $this->txt("create_info2") . $this->getAdminConfigObject()->getAppName() . $this->txt("create_info3")); $sub_selection = new ilRadioGroupInputGUI($this->txt(self::F_BASE_FOLDER), "dropbox_base_folder"); $sub_selection->setRequired(true); $option_default = new ilRadioOption($this->txt("default_base_folder"), self::F_DROPBOX_DEFAULT_BASE_FOLDER); $option_custom = new ilRadioOption($this->txt("custom_base_folder"), self::F_DROPBOX_CUSTOM_FOLDER_SELECTION); $custom_base_folder_input = new ilTextInputGUI($this->txt("custom_base_folder_input"), self::F_DROPBOX_CUSTOM_BASE_FOLDER_INPUT); $custom_base_folder_input->setRequired(true); $custom_base_folder_input->setInfo($this->txt("custom_base_folder_input_info")); $option_custom->addSubItem($custom_base_folder_input); $sub_selection->addOption($option_default); $sub_selection->addOption($option_custom); $sub_selection->setValue(self::F_DROPBOX_DEFAULT_BASE_FOLDER); $option->addSubItem($sub_selection); $sub_selection2 = new ilCheckboxInputGUI($this->txt(self::F_ONLINE), self::F_ONLINE); if ($this->getAdminConfigObject()->getValue('config_default_online')) { $sub_selection2->setChecked(true); } $option->addSubItem($sub_selection2); }
/** * 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; }
public function showTopicsSettings() { $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment'); $genSet = ilPaymentSettings::_getInstance(); $genSetData = $genSet->getAll(); $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this, 'saveTopicsSettings')); $form->setTitle($this->lng->txt('pays_general_settings')); $form->addCommandButton('saveTopicsSettings', $this->lng->txt('save')); // use topics $formItem = new ilCheckboxInputGUI($this->lng->txt('enable_topics'), 'enable_topics'); $formItem->setChecked((int) $genSetData['enable_topics']); $formItem->setInfo($this->lng->txt('enable_topics_info')); $form->addItem($formItem); // default sorting type $formItem = new ilSelectInputGUI($this->lng->txt('pay_topics_default_sorting_type'), 'topics_sorting_type'); $formItem->setValue($genSetData['topics_sorting_type']); $options = array(1 => $this->lng->txt('pay_topics_sort_by_title'), 2 => $this->lng->txt('pay_topics_sort_by_date'), 3 => $this->lng->txt('pay_topics_sort_manually')); $formItem->setOptions($options); $form->addItem($formItem); // default sorting direction $formItem = new ilSelectInputGUI($this->lng->txt('pay_topics_default_sorting_direction'), 'topics_sorting_direction'); $formItem->setValue($genSetData['topics_sorting_direction']); $options = array('asc' => $this->lng->txt('sort_asc'), 'desc' => $this->lng->txt('sort_desc')); $formItem->setOptions($options); $form->addItem($formItem); // topics custom sorting $formItem = new ilCheckboxInputGUI($this->lng->txt('pay_topics_allow_custom_sorting'), 'topics_allow_custom_sorting'); $formItem->setChecked((int) $genSetData['topics_allow_custom_sorting']); $formItem->setInfo($this->lng->txt('pay_topics_allow_custom_sorting_info')); $form->addItem($formItem); // show topics filter $formItem = new ilCheckboxInputGUI($this->lng->txt('show_topics_filter'), 'show_topics_filter'); $formItem->setChecked((int) $genSetData['show_topics_filter']); $formItem->setInfo($this->lng->txt('show_topics_filter_info')); $form->addItem($formItem); $this->tpl->setVariable('FORM', $form->getHTML()); return true; }
public static function getGeneralSettingsForm() { global $lng; $form = new ilPropertyFormGUI(); require_once 'Services/Notifications/classes/class.ilNotificationDatabaseHelper.php'; $channels = ilNotificationDatabaseHandler::getAvailableChannels(array(), true); $options = array('set_by_user' => $lng->txt('set_by_user'), 'set_by_admin' => $lng->txt('set_by_admin')); /** * @todo dirty... */ $form->restored_values = array(); $store_values = array(); foreach ($channels as $channel) { $chb = new ilCheckboxInputGUI($lng->txt('enable_' . $channel['name']), 'enable_' . $channel['name']); $store_values[] = 'enable_' . $channel['name']; $select = new ilSelectInputGUI($lng->txt('config_type'), 'notifications[' . $channel['name'] . ']'); $select->setOptions($options); $select->setValue($channel['config_type']); $chb->addSubItem($select); /** * @todo dirty... */ $form->restored_values['notifications[' . $channel['name'] . ']'] = $channel['config_type']; require_once $channel['include']; // let the channel display their own settings below the "enable channel" // checkbox $result = call_user_func(array($channel['handler'], 'showSettings'), $chb); if ($result) { $store_values = array_merge($result, $store_values); } $form->addItem($chb); } /** * @todo dirty... */ $form->store_values = $store_values; return $form; }
public function addCustomSettingsToForm(ilPropertyFormGUI $a_form) { global $lng; $lng->loadLanguageModule("file"); require_once 'Services/WebDAV/classes/class.ilObjDiskQuotaSettings.php'; $disk_quota_obj = ilObjDiskQuotaSettings::getInstance(); // Enable disk quota reminder mail $cb_prop_reminder = new ilCheckboxInputGUI($lng->txt("enable_disk_quota_reminder_mail"), "enable_disk_quota_reminder_mail"); $cb_prop_reminder->setValue('1'); $cb_prop_reminder->setChecked($disk_quota_obj->isDiskQuotaReminderMailEnabled()); $cb_prop_reminder->setInfo($lng->txt('disk_quota_reminder_mail_desc')); $a_form->addItem($cb_prop_reminder); // Enable summary mail for certain users $cb_prop_summary = new ilCheckboxInputGUI($lng->txt("enable_disk_quota_summary_mail"), "enable_disk_quota_summary_mail"); $cb_prop_summary->setValue(1); $cb_prop_summary->setChecked($disk_quota_obj->isDiskQuotaSummaryMailEnabled()); $cb_prop_summary->setInfo($lng->txt('enable_disk_quota_summary_mail_desc')); $a_form->addItem($cb_prop_summary); // Edit disk quota recipients $summary_rcpt = new ilTextInputGUI($lng->txt("disk_quota_summary_rctp"), "disk_quota_summary_rctp"); $summary_rcpt->setValue($disk_quota_obj->getSummaryRecipients()); $summary_rcpt->setInfo($lng->txt('disk_quota_summary_rctp_desc')); $cb_prop_summary->addSubItem($summary_rcpt); }
/** * Init configuration form. * * @return object form object */ public function initConfigurationForm() { /** @var ilCtrl $ilCtrl */ global $lng, $ilCtrl; require_once 'Services/Form/classes/class.ilPropertyFormGUI.php'; $this->form = new ilPropertyFormGUI(); foreach ($this->checkboxes as $key => $cb) { if (!is_array($cb)) { $checkbox = new ilCheckboxInputGUI($this->getPluginObject()->txt($cb), $cb); $this->form->addItem($checkbox); } else { $checkbox = new ilCheckboxInputGUI($this->getPluginObject()->txt($key), $key); foreach ($cb as $field => $gui) { $sub = new $gui($this->getPluginObject()->txt($key . '_' . $field), $key . '_' . $field); $checkbox->addSubItem($sub); } $this->form->addItem($checkbox); } } $this->form->addCommandButton('save', $lng->txt('save')); $this->form->setTitle($this->getPluginObject()->txt('configuration')); $this->form->setFormAction($ilCtrl->getFormAction($this)); return $this->form; }
protected function addFieldsToEditForm(ilPropertyFormGUI $a_form) { // orientation $orientation = new ilRadioGroupInputGUI($this->lng->txt("orientation"), "orientation"); $orientation->setRequired(false); $orientation->addOption(new ilRadioOption($this->lng->txt('vertical'), 0)); $orientation->addOption(new ilRadioOption($this->lng->txt('horizontal'), 1)); $a_form->addItem($orientation); // minimum answers $minanswers = new ilCheckboxInputGUI($this->lng->txt("use_min_answers"), "use_min_answers"); $minanswers->setValue(1); $minanswers->setOptionTitle($this->lng->txt("use_min_answers_option")); $minanswers->setRequired(FALSE); $nranswers = new ilNumberInputGUI($this->lng->txt("nr_min_answers"), "nr_min_answers"); $nranswers->setSize(5); $nranswers->setDecimals(0); $nranswers->setRequired(false); $nranswers->setMinValue(1); $minanswers->addSubItem($nranswers); $nrmaxanswers = new ilNumberInputGUI($this->lng->txt("nr_max_answers"), "nr_max_answers"); $nrmaxanswers->setSize(5); $nrmaxanswers->setDecimals(0); $nrmaxanswers->setRequired(false); $nrmaxanswers->setMinValue(1); $minanswers->addSubItem($nrmaxanswers); $a_form->addItem($minanswers); // Answers include_once "./Modules/SurveyQuestionPool/classes/class.ilCategoryWizardInputGUI.php"; $answers = new ilCategoryWizardInputGUI($this->lng->txt("answers"), "answers"); $answers->setRequired(false); $answers->setAllowMove(true); $answers->setShowWizard(false); $answers->setShowSavePhrase(false); $answers->setUseOtherAnswer(true); $answers->setShowNeutralCategory(true); $answers->setNeutralCategoryTitle($this->lng->txt('svy_neutral_answer')); $answers->setDisabledScale(false); $a_form->addItem($answers); // values $orientation->setValue($this->object->getOrientation()); $minanswers->setChecked($this->object->use_min_answers); $nranswers->setValue($this->object->nr_min_answers); $nrmaxanswers->setValue($this->object->nr_max_answers); if (!$this->object->getCategories()->getCategoryCount()) { $this->object->getCategories()->addCategory(""); } $answers->setValues($this->object->getCategories()); }
/** * Init assignment form. * * @param int $a_mode "create"/"edit" */ public function initAssignmentForm($a_mode = "create") { global $lng, $ilCtrl, $ilSetting; // init form $lng->loadLanguageModule("form"); include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form = new ilPropertyFormGUI(); $this->form->setTableWidth("600px"); if ($a_mode == "edit") { $this->form->setTitle($lng->txt("exc_edit_assignment")); } else { $this->form->setTitle($lng->txt("exc_new_assignment")); } $this->form->setFormAction($ilCtrl->getFormAction($this)); // type include_once "./Modules/Exercise/classes/class.ilExAssignment.php"; $types = array(ilExAssignment::TYPE_UPLOAD => $this->lng->txt("exc_type_upload"), ilExAssignment::TYPE_UPLOAD_TEAM => $this->lng->txt("exc_type_upload_team"), ilExAssignment::TYPE_TEXT => $this->lng->txt("exc_type_text")); if (!$ilSetting->get('disable_wsp_blogs')) { $types[ilExAssignment::TYPE_BLOG] = $this->lng->txt("exc_type_blog"); } if ($ilSetting->get('user_portfolios')) { $types[ilExAssignment::TYPE_PORTFOLIO] = $this->lng->txt("exc_type_portfolio"); } if (sizeof($types) > 1) { $ty = new ilSelectInputGUI($this->lng->txt("exc_assignment_type"), "type"); $ty->setOptions($types); $ty->setRequired(true); } else { $ty = new ilHiddenInputGUI("type"); $ty->setValue(ilExAssignment::TYPE_UPLOAD); } $this->form->addItem($ty); // title $ti = new ilTextInputGUI($this->lng->txt("title"), "title"); $ti->setMaxLength(200); $ti->setRequired(true); $this->form->addItem($ti); // start time y/n $cb = new ilCheckboxInputGUI($this->lng->txt("exc_start_time"), "start_time_cb"); $this->form->addItem($cb); // start time $edit_date = new ilDateTimeInputGUI("", "start_time"); $edit_date->setShowTime(true); $cb->addSubItem($edit_date); // deadline y/n $dcb = new ilCheckboxInputGUI($this->lng->txt("exc_deadline"), "deadline_cb"); $dcb->setChecked(true); $this->form->addItem($dcb); // Deadline $edit_date = new ilDateTimeInputGUI($lng->txt(""), "deadline"); $edit_date->setShowTime(true); $dcb->addSubItem($edit_date); // mandatory $cb = new ilCheckboxInputGUI($this->lng->txt("exc_mandatory"), "mandatory"); $cb->setInfo($this->lng->txt("exc_mandatory_info")); $cb->setChecked(true); $this->form->addItem($cb); // Work Instructions $desc_input = new ilTextAreaInputGUI($lng->txt("exc_instruction"), "instruction"); $desc_input->setRows(20); $desc_input->setUseRte(true); $desc_input->setRteTagSet("mini"); $this->form->addItem($desc_input); // files if ($a_mode == "create") { $files = new ilFileWizardInputGUI($this->lng->txt('objs_file'), 'files'); $files->setFilenames(array(0 => '')); $this->form->addItem($files); } // peer review $peer = new ilCheckboxInputGUI($lng->txt("exc_peer_review"), "peer"); $peer->setInfo($this->lng->txt("exc_peer_review_ass_setting_info")); $this->form->addItem($peer); if ($a_mode == "create") { $peer->setInfo($lng->txt("exc_peer_review_info")); } $peer_min = new ilNumberInputGUI($lng->txt("exc_peer_review_min_number"), "peer_min"); $peer_min->setInfo($lng->txt("exc_peer_review_min_number_info")); $peer_min->setRequired(true); $peer_min->setValue(5); $peer_min->setSize(3); $peer_min->setValue(2); $peer->addSubItem($peer_min); $peer_dl = new ilDateTimeInputGUI($lng->txt("exc_peer_review_deadline"), "peer_dl"); $peer_dl->setInfo($lng->txt("exc_peer_review_deadline_info")); $peer_dl->enableDateActivation("", "peer_dl_tgl"); $peer_dl->setShowTime(true); $peer->addSubItem($peer_dl); $peer_file = new ilCheckboxInputGUI($lng->txt("exc_peer_review_file"), "peer_file"); $peer_file->setInfo($lng->txt("exc_peer_review_file_info")); $peer->addSubItem($peer_file); $peer_prsl = new ilCheckboxInputGUI($lng->txt("exc_peer_review_personal"), "peer_prsl"); $peer_prsl->setInfo($lng->txt("exc_peer_review_personal_info")); $peer->addSubItem($peer_prsl); if ($a_mode != "create" && $this->ass && $this->ass->getDeadline() && $this->ass->getDeadline() < time()) { $peer_prsl->setDisabled(true); } // global feedback $fb = new ilCheckboxInputGUI($lng->txt("exc_global_feedback_file"), "fb"); $this->form->addItem($fb); $fb_file = new ilFileInputGUI($lng->txt("file"), "fb_file"); // $fb_file->setRequired(true); $fb_file->setALlowDeletion(true); $fb->addSubItem($fb_file); $fb_date = new ilRadioGroupInputGUI($lng->txt("exc_global_feedback_file_date"), "fb_date"); $fb_date->setRequired(true); $fb_date->addOption(new ilRadioOption($lng->txt("exc_global_feedback_file_date_deadline"), ilExAssignment::FEEDBACK_DATE_DEADLINE)); $fb_date->addOption(new ilRadioOption($lng->txt("exc_global_feedback_file_date_upload"), ilExAssignment::FEEDBACK_DATE_SUBMISSION)); $fb->addSubItem($fb_date); $fb_cron = new ilCheckboxInputGUI($lng->txt("exc_global_feedback_file_cron"), "fb_cron"); $fb_cron->setInfo($lng->txt("exc_global_feedback_file_cron_info")); $fb->addSubItem($fb_cron); // save and cancel commands if ($a_mode == "create") { $this->form->addCommandButton("saveAssignment", $lng->txt("save")); $this->form->addCommandButton("listAssignments", $lng->txt("cancel")); } else { $this->form->addCommandButton("updateAssignment", $lng->txt("save")); $this->form->addCommandButton("listAssignments", $lng->txt("cancel")); } }
/** * Init form * * @return ilPropertyFormGUI */ public function initForm() { global $lng, $ilCtrl; /** @var $ilCtrl ilCtrl */ $ilCtrl = $ilCtrl; include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $item = new ilCustomInputGUI(); $item->setHtml($lng->txt('dcl_file_format_description')); $item->setTitle("Info"); $form->addItem($item); $file = new ilFileInputGUI($lng->txt("import_file"), "import_file"); $file->setRequired(true); $form->addItem($file); $cb = new ilCheckboxInputGUI($lng->txt("dcl_simulate_import"), "simulate"); $cb->setInfo($lng->txt("dcl_simulate_info")); $form->addItem($cb); $form->addCommandButton("importExcel", $lng->txt("save")); return $form; }
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); }
public function editPriceObject() { $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment'); $price_id = $_GET['price_id'] ? $_GET['price_id'] : $_POST['price_id']; $price = ilPaymentPrices::_getPrice($price_id); $this->ctrl->setParameter($this, 'pobject_id', (int) $_GET['pobject_id']); $tmp_pobject = ilPaymentObject::_getObjectData($_GET['pobject_id']); include_once 'Services/Form/classes/class.ilPropertyFormGUI.php'; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this)); $tmp_obj = ilObjectFactory::getInstanceByRefId($tmp_pobject['ref_id'], false); if ($tmp_obj) { $form->setTitle($tmp_obj->getTitle()); } else { $form->setTitle($this->lng->txt('object_not_found')); } //price_type $radio_group = new ilRadioGroupInputGUI('', 'price_type'); $radio_group->setTitle($this->lng->txt('duration')); $radio_group->setRequired(true); $radio_group->setValue($price['price_type']); $radio_group->setPostVar('price_type'); $radio_option_1 = new ilRadioOption($this->lng->txt('duration_month'), ilPaymentPrices::TYPE_DURATION_MONTH); // duration month $oDuration = new ilNumberInputGUI(); $oDuration->setTitle($this->lng->txt('paya_months')); $oDuration->setSize('20%'); $oDuration->setValue($price['duration']); $oDuration->setPostVar('duration_month'); $radio_option_1->addSubItem($oDuration); $radio_group->addOption($radio_option_1); $radio_option_3 = new ilRadioOption($this->lng->txt('duration_date'), ilPaymentPrices::TYPE_DURATION_DATE); // duration_date from $o_date_from = new ilDateTimeInputGUI(); $o_date_from->setTitle($this->lng->txt('cal_from')); $o_date_from->setDate(new ilDate($price['duration_from'], IL_CAL_DATE)); $o_date_from->setPostVar('duration_date_from'); $radio_option_3->addSubItem($o_date_from); // duration_date until $o_date_until = new ilDateTimeInputGUI(); $o_date_until->setTitle($this->lng->txt('cal_until')); $o_date_until->setDate(new ilDate($price['duration_until'], IL_CAL_DATE)); $o_date_until->setPostVar('duration_date_until'); $radio_option_3->addSubItem($o_date_until); $radio_group->addOption($radio_option_3); $radio_option_2 = new ilRadioOption($this->lng->txt('unlimited_duration'), ilPaymentPrices::TYPE_UNLIMITED_DURATION); $radio_group->addOption($radio_option_2); $form->addItem($radio_group); // description $oDescription = new ilTextAreaInputGUI($this->lng->txt('description'), 'description'); $oDescription->setRows(4); $oDescription->setCols(35); $oDescription->setValue($price['description']); $form->addItem($oDescription); // price $oPrice = new ilNumberInputGUI(); $oPrice->setTitle($this->lng->txt('price_a')); $oPrice->setSize('20%'); $oPrice->setRequired(true); $oPrice->setValue($price['price']); include_once './Services/Payment/classes/class.ilPaymentSettings.php'; $genSet = ilPaymentSettings::_getInstance(); $oPrice->setInfo($genSet->get('currency_unit')); $oPrice->setPostVar('price'); $oPrice->allowDecimals(true); $form->addItem($oPrice); //extension $oExtension = new ilCheckboxInputGUI($this->lng->txt('extension_price'), 'extension'); $oExtension->setChecked($price['extension']); $form->addItem($oExtension); $o_hidden_1 = new ilHiddenInputGUI('pobject_id'); $o_hidden_1->setValue((int) $_GET['pobject_id']); $o_hidden_1->setPostVar('pobject_id'); $o_hidden_2 = new ilHiddenInputGUI('price_id'); $o_hidden_2->setValue((int) $_GET['price_id']); $o_hidden_2->setPostVar('price_id'); $form->addItem($o_hidden_1); $form->addItem($o_hidden_2); $form->addCommandButton('updatePrice', $this->lng->txt('save')); $form->addCommandButton('editPrices', $this->lng->txt('cancel')); $this->tpl->setVariable('FORM', $form->getHTML()); }
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()); }
/** * Set the language settings */ function settingsObject() { global $ilSetting; $translate_key = "lang_translate_" . $this->object->key; // save and get the page translation setting if (!empty($_POST)) { $ilSetting->set($translate_key, (bool) $_POST["translation"]); ilUtil::sendSuccess($this->lng->txt("settings_saved")); } $translate = $ilSetting->get($translate_key, false); require_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this)); $form->setTitle($this->lng->txt("language_settings")); $form->setPreventDoubleSubmission(false); $form->addCommandButton('settings', $this->lng->txt("language_change_settings")); $ci = new ilCheckboxInputGUI($this->lng->txt("language_translation_enabled"), "translation"); $ci->setChecked((bool) $translate); $ci->setInfo($this->lng->txt("language_note_translation")); $form->addItem($ci); $this->tpl->setContent($form->getHTML()); }
/** * Init settings property form * * @access protected */ protected function initFormSettings() { if (is_object($this->form)) { return true; } include_once 'Services/Calendar/classes/class.ilCalendarUtil.php'; include_once 'Services/Form/classes/class.ilPropertyFormGUI.php'; $this->form = new ilPropertyFormGUI(); $this->form->setFormAction($this->ctrl->getFormAction($this)); $this->form->setTitle($this->lng->txt('cal_global_settings')); $this->form->addCommandButton('save', $this->lng->txt('save')); #$this->form->addCommandButton('cancel',$this->lng->txt('cancel')); $check = new ilCheckboxInputGUI($this->lng->txt('enable_calendar'), 'enable'); $check->setValue(1); $check->setChecked($this->settings->isEnabled() ? true : false); $this->form->addItem($check); $server_tz = new ilNonEditableValueGUI($this->lng->txt('cal_server_tz')); $server_tz->setValue(ilTimeZone::_getDefaultTimeZone()); $this->form->addItem($server_tz); $select = new ilSelectInputGUI($this->lng->txt('cal_def_timezone'), 'default_timezone'); $select->setOptions(ilCalendarUtil::_getShortTimeZoneList()); $select->setInfo($this->lng->txt('cal_def_timezone_info')); $select->setValue($this->settings->getDefaultTimeZone()); $this->form->addItem($select); $year = date("Y"); $select = new ilSelectInputGUI($this->lng->txt('cal_def_date_format'), 'default_date_format'); $select->setOptions(array(ilCalendarSettings::DATE_FORMAT_DMY => '31.10.' . $year, ilCalendarSettings::DATE_FORMAT_YMD => $year . "-10-31", ilCalendarSettings::DATE_FORMAT_MDY => "10/31/" . $year)); $select->setInfo($this->lng->txt('cal_def_date_format_info')); $select->setValue($this->settings->getDefaultDateFormat()); $this->form->addItem($select); $select = new ilSelectInputGUI($this->lng->txt('cal_def_time_format'), 'default_time_format'); $select->setOptions(array(ilCalendarSettings::TIME_FORMAT_24 => '13:00', ilCalendarSettings::TIME_FORMAT_12 => '1:00pm')); $select->setInfo($this->lng->txt('cal_def_time_format_info')); $select->setValue($this->settings->getDefaultTimeFormat()); $this->form->addItem($select); // Weekstart $radio = new ilRadioGroupInputGUI($this->lng->txt('cal_def_week_start'), 'default_week_start'); $radio->setValue($this->settings->getDefaultWeekStart()); $option = new ilRadioOption($this->lng->txt('l_su'), 0); $radio->addOption($option); $option = new ilRadioOption($this->lng->txt('l_mo'), 1); $radio->addOption($option); $this->form->addItem($radio); // Day start $day_start = new ilSelectInputGUI($this->lng->txt('cal_day_start'), 'dst'); $day_start->setOptions(ilCalendarUtil::getHourSelection($this->settings->getDefaultTimeFormat())); $day_start->setValue($this->settings->getDefaultDayStart()); $this->form->addItem($day_start); $day_end = new ilSelectInputGUI($this->lng->txt('cal_day_end'), 'den'); $day_end->setOptions(ilCalendarUtil::getHourSelection($this->settings->getDefaultTimeFormat())); $day_end->setValue($this->settings->getDefaultDayEnd()); $this->form->addItem($day_end); $sync = new ilCheckboxInputGUI($this->lng->txt('cal_webcal_sync'), 'webcal'); $sync->setValue(1); $sync->setChecked($this->settings->isWebCalSyncEnabled()); $sync->setInfo($this->lng->txt('cal_webcal_sync_info')); $sync_min = new ilNumberInputGUI('', 'webcal_hours'); $sync_min->setSize(2); $sync_min->setMaxLength(3); $sync_min->setValue($this->settings->getWebCalSyncHours()); $sync_min->setSuffix($this->lng->txt('hours')); $sync->addSubItem($sync_min); $this->form->addItem($sync); // enable milestone planning in groups $mil = new ilFormSectionHeaderGUI(); $mil->setTitle($this->lng->txt('cal_milestone_settings')); $this->form->addItem($mil); $checkm = new ilCheckboxInputGUI($this->lng->txt('cal_enable_group_milestones'), 'enable_grp_milestones'); $checkm->setValue(1); $checkm->setChecked($this->settings->getEnableGroupMilestones() ? true : false); $checkm->setInfo($this->lng->txt('cal_enable_group_milestones_desc')); $this->form->addItem($checkm); // Consultation hours $con = new ilFormSectionHeaderGUI(); $con->setTitle($this->lng->txt('cal_ch_form_header')); $this->form->addItem($con); $ch = new ilCheckboxInputGUI($this->lng->txt('cal_ch_form'), 'ch'); $ch->setInfo($this->lng->txt('cal_ch_form_info')); $ch->setValue(1); $ch->setChecked($this->settings->areConsultationHoursEnabled()); $this->form->addItem($ch); // repository visibility default $rep = new ilFormSectionHeaderGUI(); $rep->setTitle($GLOBALS['lng']->txt('cal_setting_global_vis_repos')); $this->form->addItem($rep); $crs = new ilCheckboxInputGUI($GLOBALS['lng']->txt('cal_setting_global_crs_vis'), 'visible_crs'); $crs->setInfo($GLOBALS['lng']->txt('cal_setting_global_crs_vis_info')); $crs->setValue(1); $crs->setInfo($GLOBALS['lng']->txt('cal_setting_global_crs_vis_info')); $crs->setChecked($this->settings->isCourseCalendarEnabled()); $this->form->addItem($crs); $grp = new ilCheckboxInputGUI($GLOBALS['lng']->txt('cal_setting_global_grp_vis'), 'visible_grp'); $grp->setInfo($GLOBALS['lng']->txt('cal_setting_global_grp_vis_info')); $grp->setValue(1); $grp->setInfo($GLOBALS['lng']->txt('cal_setting_global_grp_vis_info')); $grp->setChecked($this->settings->isGroupCalendarEnabled()); $this->form->addItem($grp); // Notifications $not = new ilFormSectionHeaderGUI(); $not->setTitle($this->lng->txt('notifications')); $this->form->addItem($not); $cgn = new ilCheckboxInputGUI($this->lng->txt('cal_notification'), 'cn'); $cgn->setOptionTitle($this->lng->txt('cal_notification_crsgrp')); $cgn->setValue(1); $cgn->setChecked($this->settings->isNotificationEnabled()); $cgn->setInfo($this->lng->txt('cal_adm_notification_info')); $this->form->addItem($cgn); $cnu = new ilCheckboxInputGUI('', 'cnu'); $cnu->setOptionTitle($this->lng->txt('cal_notification_users')); $cnu->setValue(1); $cnu->setChecked($this->settings->isUserNotificationEnabled()); $cnu->setInfo($this->lng->txt('cal_adm_notification_user_info')); $this->form->addItem($cnu); // Registration $book = new ilFormSectionHeaderGUI(); $book->setTitle($this->lng->txt('cal_registrations')); $this->form->addItem($book); $cgn = new ilCheckboxInputGUI($this->lng->txt('cal_cg_registrations'), 'cgr'); $cgn->setValue(1); $cgn->setChecked($this->settings->isCGRegistrationEnabled()); $cgn->setInfo($this->lng->txt('cal_cg_registration_info')); $this->form->addItem($cgn); // Synchronisation cache $sec = new ilFormSectionHeaderGUI(); $sec->setTitle($this->lng->txt('cal_cache_settings')); $this->form->addItem($sec); $cache = new ilRadioGroupInputGUI($this->lng->txt('cal_sync_cache'), 'sync_cache'); $cache->setValue((int) $this->settings->isSynchronisationCacheEnabled()); $cache->setInfo($this->lng->txt('cal_sync_cache_info')); $cache->setRequired(true); $sync_cache = new ilRadioOption($this->lng->txt('cal_sync_disabled'), 0); $cache->addOption($sync_cache); $sync_cache = new ilRadioOption($this->lng->txt('cal_sync_enabled'), 1); $cache->addOption($sync_cache); $cache_t = new ilNumberInputGUI('', 'sync_cache_time'); $cache_t->setValue($this->settings->getSynchronisationCacheMinutes()); $cache_t->setMinValue(0); $cache_t->setSize(3); $cache_t->setMaxLength(3); $cache_t->setSuffix($this->lng->txt('form_minutes')); $sync_cache->addSubItem($cache_t); $this->form->addItem($cache); // Calendar cache $cache = new ilRadioGroupInputGUI($this->lng->txt('cal_cache'), 'cache'); $cache->setValue((int) $this->settings->isCacheUsed()); $cache->setInfo($this->lng->txt('cal_cache_info')); $cache->setRequired(true); $sync_cache = new ilRadioOption($this->lng->txt('cal_cache_disabled'), 0); $cache->addOption($sync_cache); $sync_cache = new ilRadioOption($this->lng->txt('cal_cache_enabled'), 1); $cache->addOption($sync_cache); $cache_t = new ilNumberInputGUI('', 'cache_time'); $cache_t->setValue($this->settings->getCacheMinutes()); $cache_t->setMinValue(0); $cache_t->setSize(3); $cache_t->setMaxLength(3); $cache_t->setSuffix($this->lng->txt('form_minutes')); $sync_cache->addSubItem($cache_t); $this->form->addItem($cache); }
private function 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')); }