Removed usages of deprecated function
This commit is contained in:
parent
516506e8f1
commit
60ba77d562
3 changed files with 4 additions and 4 deletions
4
lib.php
4
lib.php
|
@ -164,7 +164,7 @@ function customcert_delete_instance($id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete any files associated with the customcert.
|
// 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 = get_file_storage();
|
||||||
$fs->delete_area_files($context->id);
|
$fs->delete_area_files($context->id);
|
||||||
|
|
||||||
|
@ -768,7 +768,7 @@ function customcert_get_conditional_issues_sql($cm, $groupmode) {
|
||||||
global $CFG, $DB;
|
global $CFG, $DB;
|
||||||
|
|
||||||
// Get all users that can manage this customcert to exclude them from the report.
|
// 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 = '';
|
$conditionssql = '';
|
||||||
$conditionsparams = array();
|
$conditionsparams = array();
|
||||||
if ($certmanagers = array_keys(get_users_by_capability($context, 'mod/customcert:manage', 'u.id'))) {
|
if ($certmanagers = array_keys(get_users_by_capability($context, 'mod/customcert:manage', 'u.id'))) {
|
||||||
|
|
|
@ -49,7 +49,7 @@ $customcert = $DB->get_record('customcert', array('id' => $cm->instance), '*', M
|
||||||
require_course_login($course->id, false, $cm);
|
require_course_login($course->id, false, $cm);
|
||||||
|
|
||||||
// Check capabilities.
|
// Check capabilities.
|
||||||
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
|
$context = context_module::instance($cm->id);
|
||||||
require_capability('mod/customcert:manage', $context);
|
require_capability('mod/customcert:manage', $context);
|
||||||
|
|
||||||
// Get the users who have been issued.
|
// Get the users who have been issued.
|
||||||
|
|
2
view.php
2
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.
|
// Ensure the user is allowed to view this page.
|
||||||
require_login($course, true, $cm);
|
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);
|
require_capability('mod/customcert:view', $context);
|
||||||
|
|
||||||
// Initialise $PAGE.
|
// Initialise $PAGE.
|
||||||
|
|
Loading…
Reference in a new issue