|
Moodle
2.2.1
http://www.collinsharper.com
|


Public Member Functions | |
| get_info_icons (array $instances) | |
| enrol_user (stdClass $instance, $userid, $roleid=NULL, $timestart=0, $timeend=0, $status=NULL) | |
| unenrol_user (stdClass $instance, $userid) | |
| try_guestaccess (stdClass $instance) | |
| get_newinstance_link ($courseid) | |
| enrol_page_hook (stdClass $instance) | |
| course_edit_form ($instance, MoodleQuickForm $mform, $data, $context) | |
| course_edit_validation ($instance, array $data, $context) | |
| course_updated ($inserted, $course, $data) | |
| add_instance ($course, array $fields=NULL) | |
| add_default_instance ($course) | |
| add_default_instance | ( | $ | course | ) |
Add new instance of enrol plugin with default settings.
| object | $course |
Reimplemented from enrol_plugin.
Definition at line 359 of file lib.php.

| add_instance | ( | $ | course, |
| array $ | fields = NULL |
||
| ) |
Add new instance of enrol plugin.
| object | $course | |
| array | instance fields |
Reimplemented from enrol_plugin.
| course_edit_form | ( | $ | instance, |
| MoodleQuickForm $ | mform, | ||
| $ | data, | ||
| $ | context | ||
| ) |
Adds enrol instance UI to course edit form
| object | $instance | enrol instance or null if does not exist yet |
| MoodleQuickForm | $mform | |
| object | $data | |
| object | $context | context of existing course or parent category if course does not exist |
Reimplemented from enrol_plugin.
Definition at line 178 of file lib.php.

| course_edit_validation | ( | $ | instance, |
| array $ | data, | ||
| $ | context | ||
| ) |
Validates course edit form data
| object | $instance | enrol instance or null if does not exist yet |
| array | $data | |
| object | $context | context of existing course or parent category if course does not exist |
Reimplemented from enrol_plugin.
Definition at line 227 of file lib.php.

| course_updated | ( | $ | inserted, |
| $ | course, | ||
| $ | data | ||
| ) |
Called after updating/inserting course.
| bool | $inserted | true if course just inserted |
| object | $course | |
| object | $data | form data |
Reimplemented from enrol_plugin.
Definition at line 280 of file lib.php.

| enrol_page_hook | ( | stdClass $ | instance | ) |
Creates course enrol form, checks if form submitted and enrols user if necessary. It can also redirect.
| stdClass | $instance |
Reimplemented from enrol_plugin.
Definition at line 124 of file lib.php.

| enrol_user | ( | stdClass $ | instance, |
| $ | userid, | ||
| $ | roleid = NULL, |
||
| $ | timestart = 0, |
||
| $ | timeend = 0, |
||
| $ | status = NULL |
||
| ) |
Enrol user into course via enrol instance.
| stdClass | $instance | |
| int | $userid | |
| int | $roleid | optional role id |
| int | $timestart | 0 means unknown |
| int | $timeend | 0 means forever |
| int | $status | default to ENROL_USER_ACTIVE for new enrolments, no change by default in updates |
Reimplemented from enrol_plugin.
| get_info_icons | ( | array $ | instances | ) |
Returns optional enrolment information icons.
This is used in course list for quick overview of enrolment options.
We are not using single instance parameter because sometimes we might want to prevent icon repetition when multiple instances of one type exist. One instance may also produce several icons.
| array | $instances | all enrol instances of this type in one course |
Reimplemented from enrol_plugin.
| get_newinstance_link | ( | $ | courseid | ) |
Returns link to page which may be used to add new instance of enrolment plugin in course.
| int | $courseid |
Reimplemented from enrol_plugin.
Definition at line 101 of file lib.php.

| try_guestaccess | ( | stdClass $ | instance | ) |
Attempt to automatically gain temporary guest access to course, calling code has to make sure the plugin and instance are active.
| stdClass | $instance | course enrol instance |
Reimplemented from enrol_plugin.
Definition at line 72 of file lib.php.

| unenrol_user | ( | stdClass $ | instance, |
| $ | userid | ||
| ) |
Unenrol user from course, the last unenrolment removes all remaining roles.
| stdClass | $instance | |
| int | $userid |
Reimplemented from enrol_plugin.