MDL-27171 messages: admin settings reordering
[moodle.git] / mod / forum / settings.php
CommitLineData
1adbd2c3 1<?php
220a90c5 2
8f685009
SH
3// This file is part of Moodle - http://moodle.org/
4//
5// Moodle is free software: you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// Moodle is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
17
18/**
19 * @package mod-forum
20 * @copyright 2009 Petr Skoda (http://skodak.org)
21 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
22 */
23
dbf9e4ba 24defined('MOODLE_INTERNAL') || die;
220a90c5 25
dbf9e4ba
PS
26if ($ADMIN->fulltree) {
27 require_once($CFG->dirroot.'/mod/forum/lib.php');
220a90c5 28
dbf9e4ba
PS
29 $settings->add(new admin_setting_configselect('forum_displaymode', get_string('displaymode', 'forum'),
30 get_string('configdisplaymode', 'forum'), FORUM_MODE_NESTED, forum_get_layout_modes()));
220a90c5 31
dbf9e4ba
PS
32 $settings->add(new admin_setting_configcheckbox('forum_replytouser', get_string('replytouser', 'forum'),
33 get_string('configreplytouser', 'forum'), 1));
220a90c5 34
dbf9e4ba
PS
35 // Less non-HTML characters than this is short
36 $settings->add(new admin_setting_configtext('forum_shortpost', get_string('shortpost', 'forum'),
37 get_string('configshortpost', 'forum'), 300, PARAM_INT));
220a90c5 38
dbf9e4ba
PS
39 // More non-HTML characters than this is long
40 $settings->add(new admin_setting_configtext('forum_longpost', get_string('longpost', 'forum'),
41 get_string('configlongpost', 'forum'), 600, PARAM_INT));
220a90c5 42
dbf9e4ba
PS
43 // Number of discussions on a page
44 $settings->add(new admin_setting_configtext('forum_manydiscussions', get_string('manydiscussions', 'forum'),
45 get_string('configmanydiscussions', 'forum'), 100, PARAM_INT));
220a90c5 46
dbf9e4ba
PS
47 if (isset($CFG->maxbytes)) {
48 $settings->add(new admin_setting_configselect('forum_maxbytes', get_string('maxattachmentsize', 'forum'),
49 get_string('configmaxbytes', 'forum'), 512000, get_max_upload_sizes($CFG->maxbytes)));
50 }
30a9aff5 51
dbf9e4ba
PS
52 // Default number of attachments allowed per post in all forums
53 $settings->add(new admin_setting_configtext('forum_maxattachments', get_string('maxattachments', 'forum'),
3db7b878 54 get_string('configmaxattachments', 'forum'), 9, PARAM_INT));
220a90c5 55
dbf9e4ba
PS
56 // Default whether user needs to mark a post as read
57 $settings->add(new admin_setting_configcheckbox('forum_trackreadposts', get_string('trackforum', 'forum'),
58 get_string('configtrackreadposts', 'forum'), 1));
220a90c5 59
dbf9e4ba
PS
60 // Default number of days that a post is considered old
61 $settings->add(new admin_setting_configtext('forum_oldpostdays', get_string('oldpostdays', 'forum'),
62 get_string('configoldpostdays', 'forum'), 14, PARAM_INT));
220a90c5 63
dbf9e4ba
PS
64 // Default whether user needs to mark a post as read
65 $settings->add(new admin_setting_configcheckbox('forum_usermarksread', get_string('usermarksread', 'forum'),
66 get_string('configusermarksread', 'forum'), 0));
220a90c5 67
dbf9e4ba
PS
68 // Default time (hour) to execute 'clean_read_records' cron
69 $options = array();
70 for ($i=0; $i<24; $i++) {
71 $options[$i] = $i;
72 }
73 $settings->add(new admin_setting_configselect('forum_cleanreadtime', get_string('cleanreadtime', 'forum'),
74 get_string('configcleanreadtime', 'forum'), 2, $options));
220a90c5 75
2f2137fc
RK
76 for ($i = 0; $i < 23; $i++) {
77 $options[$i] = sprintf("%02d",$i);
78 }
79 $settings->add(new admin_setting_configselect('digestmailtime', get_string('digestmailtime', 'forum'), get_string('configdigestmailtime', 'forum'), 17, $options));
220a90c5 80
dbf9e4ba
PS
81 if (empty($CFG->enablerssfeeds)) {
82 $options = array(0 => get_string('rssglobaldisabled', 'admin'));
83 $str = get_string('configenablerssfeeds', 'forum').'<br />'.get_string('configenablerssfeedsdisabled2', 'admin');
220a90c5 84
dbf9e4ba
PS
85 } else {
86 $options = array(0=>get_string('no'), 1=>get_string('yes'));
87 $str = get_string('configenablerssfeeds', 'forum');
88 }
89 $settings->add(new admin_setting_configselect('forum_enablerssfeeds', get_string('enablerssfeeds', 'admin'),
90 $str, 0, $options));
220a90c5 91
dbf9e4ba
PS
92 $settings->add(new admin_setting_configcheckbox('forum_enabletimedposts', get_string('timedposts', 'forum'),
93 get_string('configenabletimedposts', 'forum'), 0));
dbf9e4ba 94}
1adbd2c3 95