From 60ba77d562db9a7e74acb0482ff203adeb45f34c Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Tue, 28 May 2013 17:00:07 +0800 Subject: [PATCH] Removed usages of deprecated function --- lib.php | 4 ++-- report.php | 2 +- view.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib.php b/lib.php index 86c0a77..67d2c8c 100644 --- a/lib.php +++ b/lib.php @@ -164,7 +164,7 @@ function customcert_delete_instance($id) { } // Delete any files associated with the customcert. - $context = get_context_instance(CONTEXT_MODULE, $cm->id); + $context = context_module::instance($cm->id); $fs = get_file_storage(); $fs->delete_area_files($context->id); @@ -768,7 +768,7 @@ function customcert_get_conditional_issues_sql($cm, $groupmode) { global $CFG, $DB; // Get all users that can manage this customcert to exclude them from the report. - $context = get_context_instance(CONTEXT_MODULE, $cm->id); + $context = context_module::instance($cm->id); $conditionssql = ''; $conditionsparams = array(); if ($certmanagers = array_keys(get_users_by_capability($context, 'mod/customcert:manage', 'u.id'))) { diff --git a/report.php b/report.php index d12a9c7..d9c6a4c 100644 --- a/report.php +++ b/report.php @@ -49,7 +49,7 @@ $customcert = $DB->get_record('customcert', array('id' => $cm->instance), '*', M require_course_login($course->id, false, $cm); // Check capabilities. -$context = get_context_instance(CONTEXT_MODULE, $cm->id); +$context = context_module::instance($cm->id); require_capability('mod/customcert:manage', $context); // Get the users who have been issued. diff --git a/view.php b/view.php index 5a87c15..76c4c56 100644 --- a/view.php +++ b/view.php @@ -35,7 +35,7 @@ $customcert = $DB->get_record('customcert', array('id' => $cm->instance), '*', M // Ensure the user is allowed to view this page. require_login($course, true, $cm); -$context = get_context_instance(CONTEXT_MODULE, $cm->id); +$context = context_module::instance($cm->id); require_capability('mod/customcert:view', $context); // Initialise $PAGE.