Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/mod/forum/settings.php
Go to the documentation of this file.
00001 <?php
00002 
00003 // This file is part of Moodle - http://moodle.org/
00004 //
00005 // Moodle is free software: you can redistribute it and/or modify
00006 // it under the terms of the GNU General Public License as published by
00007 // the Free Software Foundation, either version 3 of the License, or
00008 // (at your option) any later version.
00009 //
00010 // Moodle is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU General Public License
00016 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
00017 
00024 defined('MOODLE_INTERNAL') || die;
00025 
00026 if ($ADMIN->fulltree) {
00027     require_once($CFG->dirroot.'/mod/forum/lib.php');
00028 
00029     $settings->add(new admin_setting_configselect('forum_displaymode', get_string('displaymode', 'forum'),
00030                        get_string('configdisplaymode', 'forum'), FORUM_MODE_NESTED, forum_get_layout_modes()));
00031 
00032     $settings->add(new admin_setting_configcheckbox('forum_replytouser', get_string('replytouser', 'forum'),
00033                        get_string('configreplytouser', 'forum'), 1));
00034 
00035     // Less non-HTML characters than this is short
00036     $settings->add(new admin_setting_configtext('forum_shortpost', get_string('shortpost', 'forum'),
00037                        get_string('configshortpost', 'forum'), 300, PARAM_INT));
00038 
00039     // More non-HTML characters than this is long
00040     $settings->add(new admin_setting_configtext('forum_longpost', get_string('longpost', 'forum'),
00041                        get_string('configlongpost', 'forum'), 600, PARAM_INT));
00042 
00043     // Number of discussions on a page
00044     $settings->add(new admin_setting_configtext('forum_manydiscussions', get_string('manydiscussions', 'forum'),
00045                        get_string('configmanydiscussions', 'forum'), 100, PARAM_INT));
00046 
00047     if (isset($CFG->maxbytes)) {
00048         $settings->add(new admin_setting_configselect('forum_maxbytes', get_string('maxattachmentsize', 'forum'),
00049                            get_string('configmaxbytes', 'forum'), 512000, get_max_upload_sizes($CFG->maxbytes)));
00050     }
00051 
00052     // Default number of attachments allowed per post in all forums
00053     $settings->add(new admin_setting_configtext('forum_maxattachments', get_string('maxattachments', 'forum'),
00054                        get_string('configmaxattachments', 'forum'), 9, PARAM_INT));
00055 
00056     // Default whether user needs to mark a post as read
00057     $settings->add(new admin_setting_configcheckbox('forum_trackreadposts', get_string('trackforum', 'forum'),
00058                        get_string('configtrackreadposts', 'forum'), 1));
00059 
00060     // Default number of days that a post is considered old
00061     $settings->add(new admin_setting_configtext('forum_oldpostdays', get_string('oldpostdays', 'forum'),
00062                        get_string('configoldpostdays', 'forum'), 14, PARAM_INT));
00063 
00064     // Default whether user needs to mark a post as read
00065     $settings->add(new admin_setting_configcheckbox('forum_usermarksread', get_string('usermarksread', 'forum'),
00066                        get_string('configusermarksread', 'forum'), 0));
00067 
00068     $options = array();
00069     for ($i = 0; $i < 24; $i++) {
00070         $options[$i] = sprintf("%02d",$i);
00071     }
00072     // Default time (hour) to execute 'clean_read_records' cron
00073     $settings->add(new admin_setting_configselect('forum_cleanreadtime', get_string('cleanreadtime', 'forum'),
00074                        get_string('configcleanreadtime', 'forum'), 2, $options));
00075 
00076     // Default time (hour) to send digest email
00077     $settings->add(new admin_setting_configselect('digestmailtime', get_string('digestmailtime', 'forum'),
00078                        get_string('configdigestmailtime', 'forum'), 17, $options));
00079 
00080     if (empty($CFG->enablerssfeeds)) {
00081         $options = array(0 => get_string('rssglobaldisabled', 'admin'));
00082         $str = get_string('configenablerssfeeds', 'forum').'<br />'.get_string('configenablerssfeedsdisabled2', 'admin');
00083 
00084     } else {
00085         $options = array(0=>get_string('no'), 1=>get_string('yes'));
00086         $str = get_string('configenablerssfeeds', 'forum');
00087     }
00088     $settings->add(new admin_setting_configselect('forum_enablerssfeeds', get_string('enablerssfeeds', 'admin'),
00089                        $str, 0, $options));
00090 
00091     $settings->add(new admin_setting_configcheckbox('forum_enabletimedposts', get_string('timedposts', 'forum'),
00092                        get_string('configenabletimedposts', 'forum'), 0));
00093 }
00094 
 All Data Structures Namespaces Files Functions Variables Enumerations