MDL-11561 admin tree improvements and bugfixing
[moodle.git] / mod / forum / settings.php
CommitLineData
220a90c5 1<?php //$Id$
2
3require_once($CFG->dirroot.'/mod/forum/lib.php');
4
5global $FORUM_LAYOUT_MODES; // make sure we have the pesky global
6
7$settings->add(new admin_setting_configselect('forum_displaymode', get_string('displaymode', 'forum'),
8 get_string('configdisplaymode', 'forum'), FORUM_MODE_NESTED, $FORUM_LAYOUT_MODES));
9
10$settings->add(new admin_setting_configcheckbox('forum_replytouser', get_string('replytouser', 'forum'),
11 get_string('configreplytouser', 'forum'), 1));
12
13// Less non-HTML characters than this is short
14$settings->add(new admin_setting_configtext('forum_shortpost', get_string('shortpost', 'forum'),
15 get_string('configshortpost', 'forum'), 300, PARAM_INT));
16
17// More non-HTML characters than this is long
18$settings->add(new admin_setting_configtext('forum_longpost', get_string('longpost', 'forum'),
19 get_string('configlongpost', 'forum'), 600, PARAM_INT));
20
21// Number of discussions on a page
22$settings->add(new admin_setting_configtext('forum_manydiscussions', get_string('manydiscussions', 'forum'),
23 get_string('configmanydiscussions', 'forum'), 100, PARAM_INT));
24
25$settings->add(new admin_setting_configselect('forum_maxbytes', get_string('maxattachmentsize', 'forum'),
26 get_string('configmaxbytes', 'forum'), 512000, get_max_upload_sizes($CFG->maxbytes)));
27
28// Default whether user needs to mark a post as read
29$settings->add(new admin_setting_configcheckbox('forum_trackreadposts', get_string('trackforum', 'forum'),
30 get_string('configtrackreadposts', 'forum'), 1));
31
32// Default number of days that a post is considered old
33$settings->add(new admin_setting_configtext('forum_oldpostdays', get_string('oldpostdays', 'forum'),
34 get_string('configoldpostdays', 'forum'), 14, PARAM_INT));
35
36// Default whether user needs to mark a post as read
37$settings->add(new admin_setting_configcheckbox('forum_usermarksread', get_string('usermarksread', 'forum'),
38 get_string('configusermarksread', 'forum'), 0));
39
40// Default time (hour) to execute 'clean_read_records' cron
41$options = array();
42for ($i=0; $i<24; $i++) {
43 $options[$i] = $i;
44}
45$settings->add(new admin_setting_configselect('forum_cleanreadtime', get_string('cleanreadtime', 'forum'),
46 get_string('configcleanreadtime', 'forum'), 2, $options));
47
48
49if (empty($CFG->enablerssfeeds)) {
50 $options = array(0 => get_string('rssglobaldisabled', 'admin'));
51 $str = get_string('configenablerssfeeds', 'forum').'<br />'.get_string('configenablerssfeedsdisabled2', 'admin');
52
53} else {
54 $options = array(0=>get_string('no'), 1=>get_string('yes'));
55 $str = get_string('configenablerssfeeds', 'forum');
56}
57$settings->add(new admin_setting_configselect('forum_enablerssfeeds', get_string('enablerssfeeds', 'admin'),
58 $str, 0, $options));
59
60$settings->add(new admin_setting_configcheckbox('forum_enabletimedposts', get_string('timedposts', 'forum'),
61 get_string('configenabletimedposts', 'forum'), 0));
62
63?>