Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Replaced deprecated get_system_context() with the new context_system:…

…:instance()
  • Loading branch information...
commit dd736a87ee510f5845b458ad25889c5f42c80a86 1 parent d6d341d
@mudrd8mz mudrd8mz authored
View
2  grade/grading/lib.php
@@ -518,7 +518,7 @@ public function create_shared_area($method) {
$name = $method . '_' . sha1(rand().uniqid($method, true));
// create new area record
$area = array(
- 'contextid' => get_system_context()->id,
+ 'contextid' => context_system::instance()->id,
'component' => 'core_grading',
'areaname' => $name,
'activemethod' => $method);
View
4 grade/grading/manage.php
@@ -99,7 +99,7 @@
// publish the form as a template
if (!empty($shareform)) {
- require_capability('moodle/grade:sharegradingforms', get_system_context());
+ require_capability('moodle/grade:sharegradingforms', context_system::instance());
$controller = $manager->get_controller($method);
$definition = $controller->get_definition();
if (!$confirmed) {
@@ -168,7 +168,7 @@
echo $output->management_action_icon(new moodle_url($PAGE->url, array('deleteform' => $definition->id)),
get_string('manageactiondelete', 'core_grading'), 'b/edit-delete');
// icon to save the form as a new template
- if (has_capability('moodle/grade:sharegradingforms', get_system_context())) {
+ if (has_capability('moodle/grade:sharegradingforms', context_system::instance())) {
if (empty($definition->copiedfromid)) {
$hasoriginal = false;
} else {
View
8 grade/grading/pick.php
@@ -56,8 +56,8 @@
require_capability('moodle/grade:managegradingforms', $context);
// user's capability in the templates bank
-$canshare = has_capability('moodle/grade:sharegradingforms', get_system_context());
-$canmanage = has_capability('moodle/grade:managesharedforms', get_system_context());
+$canshare = has_capability('moodle/grade:sharegradingforms', context_system::instance());
+$canmanage = has_capability('moodle/grade:managesharedforms', context_system::instance());
// setup the page
$PAGE->set_url(new moodle_url('/grade/grading/pick.php', array('targetid' => $targetid)));
@@ -158,13 +158,13 @@
if (!$includeownforms) {
// search for public templates only
$sql .= " AND ga.contextid = ? AND ga.component = 'core_grading'";
- $params[] = get_system_context()->id;
+ $params[] = context_system::instance()->id;
} else {
// search both templates and own forms in other areas
$sql .= " AND ((ga.contextid = ? AND ga.component = 'core_grading')
OR (gd.usercreated = ? AND gd.status = ?))";
- $params = array_merge($params, array(get_system_context()->id, $USER->id,
+ $params = array_merge($params, array(context_system::instance()->id, $USER->id,
gradingform_controller::DEFINITION_STATUS_READY));
}
Please sign in to comment.
Something went wrong with that request. Please try again.