diff --git a/Changes.md b/Changes.md index 2692866a..514666c5 100644 --- a/Changes.md +++ b/Changes.md @@ -5,6 +5,7 @@ Version 403.1.3 - In development -------------------------------- 1. Fix updating of course when adding or removing sections. Note: Known issue of the section not looking as it should. 2. Fix 'Unable to update defaultimageresizemethod setting' - #211. +3. Use section anchors in links when editing. Version 403.1.2 - 08/04/2024 ---------------------------- diff --git a/lib.php b/lib.php index 88eb507c..ea03b1ce 100755 --- a/lib.php +++ b/lib.php @@ -56,10 +56,16 @@ protected function __construct($format, $courseid) { parent::__construct($format, $courseid); if ($courseid != 1) { - $currentsettings = $this->get_settings(); - if (!empty($currentsettings['popup'])) { - if ($currentsettings['popup'] == 2) { - $this->coursedisplay = COURSE_DISPLAY_SINGLEPAGE; + global $USER; + $context = context_course::instance($courseid); + if (!empty($USER->editing) && has_capability('moodle/course:update', $context)) { + $this->coursedisplay = COURSE_DISPLAY_SINGLEPAGE; + } else { + $currentsettings = $this->get_settings(); + if (!empty($currentsettings['popup'])) { + if ($currentsettings['popup'] == 2) { + $this->coursedisplay = COURSE_DISPLAY_SINGLEPAGE; + } } } }