Skip to content

Commit

Permalink
Use section anchors in links when editing - pt 2.
Browse files Browse the repository at this point in the history
  • Loading branch information
gjb2048 committed Jul 24, 2024
1 parent 197752f commit 8fa0a97
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ protected function __construct($format, $courseid) {
parent::__construct($format, $courseid);

if ($courseid != 1) {
$currentsettings = $this->get_settings();
if (!empty($currentsettings['popup'])) {
if ($currentsettings['popup'] == 2) {
global $PAGE;
$context = context_course::instance($courseid);
if ($PAGE->user_is_editing() && has_capability('moodle/course:update', $context)) {
$this->coursedisplay = COURSE_DISPLAY_MULTIPAGE;
} else {
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 8fa0a97

Please sign in to comment.