Merge branch 'wip-MDL-36795-master' of git://github.com/abgreeve/moodle

This commit is contained in:
Sam Hemelryk 2012-11-27 11:22:08 +13:00
commit a28e3a6007
3 changed files with 11 additions and 3 deletions

View File

@ -213,8 +213,12 @@ class format_topics extends format_base {
}
if ($foreditform && !isset($courseformatoptions['coursedisplay']['label'])) {
$courseconfig = get_config('moodlecourse');
$max = $courseconfig->maxsections;
if (!isset($max) || !is_numeric($max)) {
$max = 52;
}
$sectionmenu = array();
for ($i = 0; $i <= $courseconfig->maxsections; $i++) {
for ($i = 0; $i <= $max; $i++) {
$sectionmenu[$i] = "$i";
}
$courseformatoptionsedit = array(

View File

@ -219,7 +219,11 @@ class format_weeks extends format_base {
if ($foreditform && !isset($courseformatoptions['coursedisplay']['label'])) {
$courseconfig = get_config('moodlecourse');
$sectionmenu = array();
for ($i = 0; $i <= $courseconfig->maxsections; $i++) {
$max = $courseconfig->maxsections;
if (!isset($max) || !is_numeric($max)) {
$max = 52;
}
for ($i = 0; $i <= $max; $i++) {
$sectionmenu[$i] = "$i";
}
$courseformatoptionsedit = array(

View File

@ -3818,7 +3818,7 @@ class admin_settings_num_course_sections extends admin_setting_configselect {
/** Lazy-load the available choices for the select box */
public function load_choices() {
$max = get_config('moodlecourse', 'maxsections');
if (empty($max)) {
if (!isset($max) || !is_numeric($max)) {
$max = 52;
}
for ($i = 0; $i <= $max; $i++) {