mirror of
https://github.com/moodle/moodle.git
synced 2025-08-07 18:06:51 +02:00
MDL-15114 resource mod converted
This commit is contained in:
parent
1b81b0a412
commit
5f5cd33c1d
6 changed files with 61 additions and 71 deletions
|
@ -7,7 +7,7 @@
|
|||
$r = optional_param('r', 0, PARAM_INT); // Resource
|
||||
|
||||
if ($r) { // Two ways to specify the resource
|
||||
if (! $resource = get_record('resource', 'id', $r)) {
|
||||
if (! $resource = $DB->get_record('resource', array('id'=>$r))) {
|
||||
print_error('Resource ID was incorrect');
|
||||
}
|
||||
|
||||
|
@ -20,14 +20,14 @@
|
|||
print_error('Course Module ID was incorrect');
|
||||
}
|
||||
|
||||
if (! $resource = get_record('resource', 'id', $cm->instance)) {
|
||||
if (! $resource = $DB->get_record('resource', array('id'=>$cm->instance))) {
|
||||
print_error('Resource ID was incorrect');
|
||||
}
|
||||
} else {
|
||||
print_error('No valid parameters!!');
|
||||
}
|
||||
|
||||
if (! $course = get_record('course', 'id', $cm->course)) {
|
||||
if (! $course = $DB->get_record('course', array('id'=>$cm->course))) {
|
||||
print_error('Incorrect course id');
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue