MDL-74386 contentbank: Set the page context to frontpage
Sets the page context to frontpage when viewing or editing site contenbank files. This logic was already applied in contentbank/index.php, so this change will bring consistency in the contenbanks pages when it comes to setting the page context.
This commit is contained in:
@@ -93,7 +93,11 @@ if ($context->contextlevel == CONTEXT_COURSECAT) {
|
||||
}
|
||||
|
||||
$PAGE->set_url(new \moodle_url('/contentbank/edit.php', $values));
|
||||
$PAGE->set_context($context);
|
||||
if ($context->id == \context_system::instance()->id) {
|
||||
$PAGE->set_context(context_course::instance($context->id));
|
||||
} else {
|
||||
$PAGE->set_context($context);
|
||||
}
|
||||
if ($content) {
|
||||
$PAGE->navbar->add($content->get_name(), new \moodle_url('/contentbank/view.php', ['id' => $id]));
|
||||
}
|
||||
|
||||
@@ -66,7 +66,11 @@ if ($context->contextlevel == CONTEXT_COURSECAT) {
|
||||
}
|
||||
|
||||
$PAGE->set_url(new \moodle_url('/contentbank/view.php', ['id' => $id]));
|
||||
$PAGE->set_context($context);
|
||||
if ($context->id == \context_system::instance()->id) {
|
||||
$PAGE->set_context(context_course::instance($context->id));
|
||||
} else {
|
||||
$PAGE->set_context($context);
|
||||
}
|
||||
$PAGE->navbar->add($record->name);
|
||||
$title .= ": ".$record->name;
|
||||
$PAGE->set_title($title);
|
||||
|
||||
Reference in New Issue
Block a user