NOMDL MNet: Remote application like Mahara does not send user's lang attribute
[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
220a90c5 24require_once($CFG->dirroot.'/mod/forum/lib.php');
25
220a90c5 26$settings->add(new admin_setting_configselect('forum_displaymode', get_string('displaymode', 'forum'),
65bcf17b 27 get_string('configdisplaymode', 'forum'), FORUM_MODE_NESTED, forum_get_layout_modes()));
220a90c5 28
29$settings->add(new admin_setting_configcheckbox('forum_replytouser', get_string('replytouser', 'forum'),
30 get_string('configreplytouser', 'forum'), 1));
31
32// Less non-HTML characters than this is short
33$settings->add(new admin_setting_configtext('forum_shortpost', get_string('shortpost', 'forum'),
34 get_string('configshortpost', 'forum'), 300, PARAM_INT));
35
36// More non-HTML characters than this is long
37$settings->add(new admin_setting_configtext('forum_longpost', get_string('longpost', 'forum'),
38 get_string('configlongpost', 'forum'), 600, PARAM_INT));
39
40// Number of discussions on a page
41$settings->add(new admin_setting_configtext('forum_manydiscussions', get_string('manydiscussions', 'forum'),
42 get_string('configmanydiscussions', 'forum'), 100, PARAM_INT));
43
e3ea4a75 44if (isset($CFG->maxbytes)) {
45 $settings->add(new admin_setting_configselect('forum_maxbytes', get_string('maxattachmentsize', 'forum'),
46 get_string('configmaxbytes', 'forum'), 512000, get_max_upload_sizes($CFG->maxbytes)));
47}
220a90c5 48
30a9aff5 49// Default number of attachments allowed per post in all forums
50$settings->add(new admin_setting_configtext('forum_maxattachments', get_string('maxattachments', 'forum'),
a47ee516 51 get_string('configmaxattachments', 'forum'), 100, PARAM_INT));
30a9aff5 52
220a90c5 53// Default whether user needs to mark a post as read
54$settings->add(new admin_setting_configcheckbox('forum_trackreadposts', get_string('trackforum', 'forum'),
55 get_string('configtrackreadposts', 'forum'), 1));
56
57// Default number of days that a post is considered old
58$settings->add(new admin_setting_configtext('forum_oldpostdays', get_string('oldpostdays', 'forum'),
59 get_string('configoldpostdays', 'forum'), 14, PARAM_INT));
60
61// Default whether user needs to mark a post as read
62$settings->add(new admin_setting_configcheckbox('forum_usermarksread', get_string('usermarksread', 'forum'),
63 get_string('configusermarksread', 'forum'), 0));
64
65// Default time (hour) to execute 'clean_read_records' cron
66$options = array();
67for ($i=0; $i<24; $i++) {
68 $options[$i] = $i;
69}
70$settings->add(new admin_setting_configselect('forum_cleanreadtime', get_string('cleanreadtime', 'forum'),
71 get_string('configcleanreadtime', 'forum'), 2, $options));
72
73
74if (empty($CFG->enablerssfeeds)) {
75 $options = array(0 => get_string('rssglobaldisabled', 'admin'));
76 $str = get_string('configenablerssfeeds', 'forum').'<br />'.get_string('configenablerssfeedsdisabled2', 'admin');
77
78} else {
79 $options = array(0=>get_string('no'), 1=>get_string('yes'));
80 $str = get_string('configenablerssfeeds', 'forum');
81}
82$settings->add(new admin_setting_configselect('forum_enablerssfeeds', get_string('enablerssfeeds', 'admin'),
83 $str, 0, $options));
84
85$settings->add(new admin_setting_configcheckbox('forum_enabletimedposts', get_string('timedposts', 'forum'),
86 get_string('configenabletimedposts', 'forum'), 0));
87
f4528bdc 88$settings->add(new admin_setting_configcheckbox('forum_logblocked', get_string('logblocked', 'forum'),
89 get_string('configlogblocked', 'forum'), 1));
90
63e87951
AD
91//no using the central ajax setting for ratings. MDL-21657
92//$settings->add(new admin_setting_configcheckbox('forum_ajaxrating', get_string('ajaxrating', 'forum'),
93// get_string('configajaxrating', 'forum'), 0));
12f6d016 94
1adbd2c3 95