MDL-14679 converted some count_records

This commit is contained in:
skodak
2008-06-02 21:47:31 +00:00
parent a5d424df7c
commit c7da43571b
14 changed files with 55 additions and 46 deletions
+2 -1
View File
@@ -2481,6 +2481,7 @@ class admin_setting_courselist_frontpage extends admin_setting {
}
function load_choices() {
global $DB;
if (is_array($this->choices)) {
return true;
}
@@ -2489,7 +2490,7 @@ class admin_setting_courselist_frontpage extends admin_setting {
FRONTPAGECATEGORYNAMES => get_string('frontpagecategorynames'),
FRONTPAGECATEGORYCOMBO => get_string('frontpagecategorycombo'),
'none' => get_string('none'));
if ($this->name == 'frontpage' and count_records('course') > FRONTPAGECOURSELIMIT) {
if ($this->name == 'frontpage' and $DB->count_records('course') > FRONTPAGECOURSELIMIT) {
unset($this->choices[FRONTPAGECOURSELIST]);
}
return true;