$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,
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;
}
echo '<td class="category info"> </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"> ';
$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.';