MDL-34463 - lib - Alteration of the get_context_instance function to utilize the new function context_XXXX::instance().

This commit is contained in:
Adrian Greeve 2012-07-24 14:04:40 +08:00
parent 3294034b80
commit d40604724b
61 changed files with 95 additions and 100 deletions

View file

@ -40,7 +40,7 @@ if ($courseid) {
print_error('nocourseid');
}
require_login($course);
$context = get_context_instance(CONTEXT_COURSE, $course->id);
$context = context_course::instance($course->id);
if (empty($CFG->enableoutcomes)) {
redirect('../../index.php?id='.$courseid);
@ -49,7 +49,7 @@ if ($courseid) {
} else {
require_once $CFG->libdir.'/adminlib.php';
admin_externalpage_setup('outcomes');
$context = get_context_instance(CONTEXT_SYSTEM);
$context = context_system::instance();
}
require_capability('moodle/grade:manageoutcomes', $context);
@ -79,7 +79,7 @@ if (!$upload_form->save_file('userfile', $imported_file, true)) {
if (isset($courseid) && ($scope == 'custom')) {
// custom scale
$local_scope = true;
} elseif (($scope == 'global') && has_capability('moodle/grade:manage', get_context_instance(CONTEXT_SYSTEM))) {
} elseif (($scope == 'global') && has_capability('moodle/grade:manage', context_system::instance())) {
// global scale
$local_scope = false;
} else {