diff --git a/course/edit_form.php b/course/edit_form.php index b04c866239b..fff5e6a3be3 100644 --- a/course/edit_form.php +++ b/course/edit_form.php @@ -199,10 +199,15 @@ class course_edit_form extends moodleform { $mform->addElement('select', 'lang', get_string('forcelanguage'), $languages); $mform->setDefault('lang', $courseconfig->lang); - $calendartypes = array(); - $calendartypes[''] = get_string('forceno'); - $calendartypes += \core_calendar\type_factory::get_list_of_calendar_types(); - $mform->addElement('select', 'calendartype', get_string('forcecalendartype', 'calendar'), $calendartypes); + // Multi-Calendar Support - see MDL-18375. + $calendartypes = \core_calendar\type_factory::get_list_of_calendar_types(); + // We do not want to show this option unless there is more than one calendar type to display. + if (count($calendartypes) > 1) { + $calendars = array(); + $calendars[''] = get_string('forceno'); + $calendars += $calendartypes; + $mform->addElement('select', 'calendartype', get_string('forcecalendartype', 'calendar'), $calendars); + } $options = range(0, 10); $mform->addElement('select', 'newsitems', get_string('newsitemsnumber'), $options); diff --git a/user/editlib.php b/user/editlib.php index b008728a512..32a4634532f 100644 --- a/user/editlib.php +++ b/user/editlib.php @@ -263,7 +263,11 @@ function useredit_shared_definition(&$mform, $editoroptions = null, $filemanager $mform->setDefault('lang', $CFG->lang); // Multi-Calendar Support - see MDL-18375. - $mform->addElement('select', 'calendartype', get_string('preferredcalendar', 'calendar'), \core_calendar\type_factory::get_list_of_calendar_types()); + $calendartypes = \core_calendar\type_factory::get_list_of_calendar_types(); + // We do not want to show this option unless there is more than one calendar type to display. + if (count($calendartypes) > 1) { + $mform->addElement('select', 'calendartype', get_string('preferredcalendar', 'calendar'), $calendartypes); + } if (!empty($CFG->allowuserthemes)) { $choices = array();