mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-34463 - lib - Alteration of the get_context_instance function to utilize the new function context_XXXX::instance().
This commit is contained in:
parent
3294034b80
commit
d40604724b
61 changed files with 95 additions and 100 deletions
|
@ -33,7 +33,7 @@ $id = optional_param('id', 0, PARAM_INT);
|
|||
$PAGE->set_url('/grade/edit/scale/edit.php', array('id' => $id, 'courseid' => $courseid));
|
||||
$PAGE->set_pagelayout('admin');
|
||||
|
||||
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
|
||||
$systemcontext = context_system::instance();
|
||||
$heading = '';
|
||||
|
||||
// a bit complex access control :-O
|
||||
|
@ -50,7 +50,7 @@ if ($id) {
|
|||
print_error('invalidcourseid');
|
||||
}
|
||||
require_login($course);
|
||||
$context = get_context_instance(CONTEXT_COURSE, $course->id);
|
||||
$context = context_course::instance($course->id);
|
||||
require_capability('moodle/course:managescales', $context);
|
||||
$courseid = $course->id;
|
||||
} else {
|
||||
|
@ -75,7 +75,7 @@ if ($id) {
|
|||
$scale_rec->standard = 0;
|
||||
$scale_rec->courseid = $courseid;
|
||||
require_login($course);
|
||||
$context = get_context_instance(CONTEXT_COURSE, $course->id);
|
||||
$context = context_course::instance($course->id);
|
||||
require_capability('moodle/course:managescales', $context);
|
||||
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue