mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
Support course idnumber as a way to call courses
http://moodle.org/mod/forum/discuss.php?d=18442
This commit is contained in:
parent
e256e3ac78
commit
816acb46d3
1 changed files with 5 additions and 0 deletions
|
@ -8,6 +8,7 @@
|
|||
|
||||
$id = optional_param('id', 0, PARAM_INT);
|
||||
$name = optional_param('name');
|
||||
$idnumber = optional_param('idnumber');
|
||||
$blockaction = optional_param('blockaction');
|
||||
|
||||
if (empty($id) && empty($name)) {
|
||||
|
@ -18,6 +19,10 @@
|
|||
if (! ($course = get_record('course', 'shortname', $name)) ) {
|
||||
error('Invalid short course name');
|
||||
}
|
||||
} else if (!empty($idnumber)) {
|
||||
if (! ($course = get_record('course', 'idnumber', $idnumber)) ) {
|
||||
error('Invalid course idnumber');
|
||||
}
|
||||
} else {
|
||||
if (! ($course = get_record('course', 'id', $id)) ) {
|
||||
error('Invalid course id');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue