Skip to content

Commit

Permalink
Use section anchors in links when editing.
Browse files Browse the repository at this point in the history
  • Loading branch information
gjb2048 committed Jul 24, 2024
1 parent 24d20bb commit 193841d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
----------------------------
Expand Down
14 changes: 10 additions & 4 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
}
Expand Down

0 comments on commit 193841d

Please sign in to comment.