MDL-34471 libraries: Replace all uses of get_context_instance() with respective context_XXXX::instance() method
This commit is contained in:
@@ -50,7 +50,7 @@
|
||||
user_accesstime_log();
|
||||
}
|
||||
|
||||
$hassiteconfig = has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
|
||||
$hassiteconfig = has_capability('moodle/site:config', context_system::instance());
|
||||
|
||||
/// If the site is currently under maintenance, then print a message
|
||||
if (!empty($CFG->maintenance_enabled) and !$hassiteconfig) {
|
||||
@@ -128,7 +128,7 @@
|
||||
echo '</font></p>';
|
||||
}
|
||||
|
||||
$context = get_context_instance(CONTEXT_COURSE, SITEID);
|
||||
$context = context_course::instance(SITEID);
|
||||
$summarytext = file_rewrite_pluginfile_urls($section->summary, 'pluginfile.php', $context->id, 'course', 'section', $section->id);
|
||||
$summaryformatoptions = new stdClass();
|
||||
$summaryformatoptions->noclean = true;
|
||||
@@ -176,7 +176,7 @@
|
||||
|
||||
// fetch news forum context for proper filtering to happen
|
||||
$newsforumcm = get_coursemodule_from_instance('forum', $newsforum->id, $SITE->id, false, MUST_EXIST);
|
||||
$newsforumcontext = get_context_instance(CONTEXT_MODULE, $newsforumcm->id, MUST_EXIST);
|
||||
$newsforumcontext = context_module::instance($newsforumcm->id, MUST_EXIST);
|
||||
|
||||
$forumname = format_string($newsforum->name, true, array('context' => $newsforumcontext));
|
||||
echo html_writer::tag('a', get_string('skipa', 'access', textlib::strtolower(strip_tags($forumname))), array('href'=>'#skipsitenews', 'class'=>'skip-block'));
|
||||
|
||||
Reference in New Issue
Block a user