mirror of
https://github.com/moodle/moodle.git
synced 2025-03-03 15:29:08 +01:00
Merge branch 'wip-MDL-42577-master' of git://github.com/marinaglancy/moodle
This commit is contained in:
commit
8e23283cbb
@ -79,8 +79,25 @@ if ($displaytype == RESOURCELIB_DISPLAY_OPEN) {
|
||||
if ($redirect) {
|
||||
// coming from course page or url index page,
|
||||
// the redirection is needed for completion tracking and logging
|
||||
$fullurl = url_get_full_url($url, $cm, $course);
|
||||
redirect(str_replace('&', '&', $fullurl));
|
||||
$fullurl = str_replace('&', '&', url_get_full_url($url, $cm, $course));
|
||||
|
||||
if (!course_get_format($course)->has_view_page()) {
|
||||
// If course format does not have a view page, add redirection delay with a link to the edit page.
|
||||
// Otherwise teacher is redirected to the external URL without any possibility to edit activity or course settings.
|
||||
$editurl = null;
|
||||
if (has_capability('moodle/course:manageactivities', $context)) {
|
||||
$editurl = new moodle_url('/course/modedit.php', array('update' => $cm->id));
|
||||
$edittext = get_string('editthisactivity');
|
||||
} else if (has_capability('moodle/course:update', $context->get_course_context())) {
|
||||
$editurl = new moodle_url('/course/edit.php', array('id' => $course->id));
|
||||
$edittext = get_string('editcoursesettings');
|
||||
}
|
||||
if ($editurl) {
|
||||
redirect($fullurl, html_writer::link($editurl, $edittext)."<br/>".
|
||||
get_string('pageshouldredirect'), 10);
|
||||
}
|
||||
}
|
||||
redirect($fullurl);
|
||||
}
|
||||
|
||||
switch ($displaytype) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user