"MDL-17747, add max category depth setting, merged from 1.9"

This commit is contained in:
dongsheng
2009-01-14 04:48:22 +00:00
parent 67b0b2c5f4
commit beeee4d21d
3 changed files with 12 additions and 5 deletions
+2 -1
View File
@@ -28,10 +28,11 @@ if (get_site()) { //do not use during installation
$temp->add(new admin_setting_courselist_frontpage(true)); // loggedin version of the setting
$options = array();
$options[] = get_string('unlimited');
for ($i=1; $i<100; $i++) {
$options[$i] = $i;
}
$temp->add(new admin_setting_configselect('max_category_depth', get_string('sitemaxcategorydepth','admin'), get_string('sitemaxcategorydepthhelp','admin'), 50, $options));
$temp->add(new admin_setting_configselect('maxcategorydepth', get_string('configsitemaxcategorydepth','admin'), get_string('configsitemaxcategorydepthhelp','admin'), 0, $options));
$temp->add(new admin_setting_sitesetcheckbox('numsections', get_string('sitesection'), get_string('sitesectionhelp','admin'), 1));
$temp->add(new admin_setting_sitesetselect('newsitems', get_string('newsitemsnumber'), '', 3,
+8 -2
View File
@@ -1943,7 +1943,8 @@ function make_categories_list(&$list, &$parents, $requiredcapability = '',
function print_whole_category_list($category=NULL, $displaylist=NULL, $parentslist=NULL, $depth=-1, $showcourses = true) {
global $CFG;
if (isset($CFG->max_category_depth) && ($depth >= $CFG->max_category_depth)) {
// maxcategorydepth == 0 meant no limit
if (!empty($CFG->maxcategorydepth) && $depth >= $CFG->maxcategorydepth) {
return;
}
@@ -2043,7 +2044,12 @@ function print_category_info($category, $depth, $showcourses = false) {
echo '<td class="category info">&nbsp;</td>';
echo '</tr>';
if ($courses && !(isset($CFG->max_category_depth)&&($depth>=$CFG->max_category_depth-1))) {
// does the depth exceed maxcategorydepth
// maxcategorydepth == 0 or unset meant no limit
$limit = !(isset($CFG->maxcategorydepth) && ($depth >= $CFG->maxcategorydepth-1));
if ($courses && ($limit || $CFG->maxcategorydepth == 0)) {
foreach ($courses as $course) {
$linkcss = $course->visible ? '' : ' class="dimmed" ';
echo '<tr><td valign="top">&nbsp;';
+2 -2
View File
@@ -172,8 +172,8 @@ $string['configlongtimenosee'] = 'If students haven\'t logged in for a very long
$string['configlookahead'] = 'Days to look ahead';
$string['configmailnewline'] = 'Newline characters used in mail messages. CRLF is required according to RFC 822bis, some mail servers do automatic conversion from LF to CRLF, other mail servers do incorrect conversion from CRLF to CRCRLF, yet others reject mails with bare LF (qmail for example). Try changing this setting if you are having problems with undelivered emails or double newlines.';
$string['configmaxbytes'] = 'This specifies a maximum size that uploaded files can be throughout the whole site. This setting is limited by the PHP settings post_max_size and upload_max_filesize, as well as the Apache setting LimitRequestBody. In turn, maxbytes limits the range of sizes that can be chosen at course level or module level. If \'Server Limit\' is chosen, the server maximum allowed by the server will be used.';
$string['sitemaxcategorydepth'] = 'Maximum Category Depth';
$string['sitemaxcategorydepthhelp'] = 'This specifies the maximum number of child categories shown';
$string['configsitemaxcategorydepth'] = 'Maximum Category Depth';
$string['configsitemaxcategorydepthhelp'] = 'This specifies the maximum depth of child categories shown';
$string['configmaxeditingtime'] = 'This specifies the amount of time people have to re-edit forum postings, glossary comments etc. Usually 30 minutes is a good value.';
$string['configmaxevents'] = 'Events to Lookahead';
$string['configmemcachedhosts'] = 'For memcached. Comma-separated list of hosts that are running the memcached daemon. Use IP addresses to avoid DNS latency. memcached does not behave well if you add/remove hosts on a running setup.';