diff --git a/course/renderer.php b/course/renderer.php index 1cfce94f63f..784d6ee2a34 100644 --- a/course/renderer.php +++ b/course/renderer.php @@ -268,107 +268,129 @@ class core_course_renderer extends plugin_renderer_base { * @return string */ function course_section_add_cm_control($course, $section, $sectionreturn = null, $displayoptions = array()) { - global $CFG, $PAGE, $USER; + global $CFG, $USER; - $vertical = !empty($displayoptions['inblock']); + // The returned control HTML can be one of the following: + // - Only the non-ajax control (select menus of activities and resources) with a noscript fallback for non js clients. + // - Only the ajax control (the link which when clicked produces the activity chooser modal). No noscript fallback. + // - [Behat only]: The non-ajax control and optionally the ajax control (depending on site settings). If included, the link + // takes priority and the non-ajax control is wrapped in a