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

All enrol plugins should be based on this class, this is also the main source of documentation.
Definition at line 977 of file enrollib.php.
| add_course_navigation | ( | $ | instancesnode, |
| stdClass $ | instance | ||
| ) |
Adds navigation links into course admin block.
By defaults looks for manage links only.
| navigation_node | $instancesnode | |
| stdClass | $instance |
Reimplemented in enrol_self_plugin, enrol_manual_plugin, and enrol_paypal_plugin.
Definition at line 1640 of file enrollib.php.
| add_default_instance | ( | $ | course | ) |
Add new instance of enrol plugin with default settings, called when adding new instance manually or when adding new course.
Not all plugins support this.
| object | $course |
Reimplemented in enrol_guest_plugin, enrol_self_plugin, and enrol_manual_plugin.
Definition at line 1564 of file enrollib.php.

| add_instance | ( | $ | course, |
| array $ | fields = NULL |
||
| ) |
Add new instance of enrol plugin.
| object | $course | |
| array | instance fields |
Reimplemented in enrol_guest_plugin, and enrol_manual_plugin.
Definition at line 1527 of file enrollib.php.


| allow_enrol | ( | stdClass $ | instance | ) |
Does this plugin allow manual enrolments?
| stdClass | $instance | course enrol instance All plugins allowing this must implement 'enrol/xxx:enrol' capability |
Reimplemented in enrol_manual_plugin.
Definition at line 1090 of file enrollib.php.
| allow_manage | ( | stdClass $ | instance | ) |
Does this plugin allow manual changes in user_enrolments table?
All plugins allowing this must implement 'enrol/xxx:manage' capability
| stdClass | $instance | course enrol instance |
Reimplemented in enrol_self_plugin, enrol_paypal_plugin, and enrol_manual_plugin.
Definition at line 1129 of file enrollib.php.
| allow_unenrol | ( | stdClass $ | instance | ) |
Does this plugin allow manual unenrolment of all users? All plugins allowing this must implement 'enrol/xxx:unenrol' capability
| stdClass | $instance | course enrol instance |
Reimplemented in enrol_self_plugin, enrol_paypal_plugin, and enrol_manual_plugin.
Definition at line 1101 of file enrollib.php.

| allow_unenrol_user | ( | stdClass $ | instance, |
| stdClass $ | ue | ||
| ) |
Does this plugin allow manual unenrolment of a specific user? All plugins allowing this must implement 'enrol/xxx:unenrol' capability
This is useful especially for synchronisation plugins that do suspend instead of full unenrolment.
| stdClass | $instance | course enrol instance |
| stdClass | $ue | record from user_enrolments table, specifies user |
Reimplemented in enrol_meta_plugin.
Definition at line 1117 of file enrollib.php.


| 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 in enrol_guest_plugin.
Definition at line 1489 of file enrollib.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 in enrol_guest_plugin.
Definition at line 1501 of file enrollib.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 in enrol_guest_plugin, enrol_cohort_plugin, enrol_meta_plugin, and enrol_category_plugin.
Definition at line 1513 of file enrollib.php.

| cron | ( | ) |
Called for all enabled enrol plugins that returned true from is_cron_required().
Reimplemented in enrol_self_plugin, enrol_meta_plugin, enrol_cohort_plugin, enrol_category_plugin, enrol_imsenterprise_plugin, and enrol_flatfile_plugin.
Definition at line 1680 of file enrollib.php.
| delete_instance | ( | $ | instance | ) |
Delete course enrol plugin instance, unenrol all users.
| object | $instance |
Definition at line 1593 of file enrollib.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 in enrol_self_plugin, enrol_paypal_plugin, and enrol_guest_plugin.
Definition at line 1627 of file enrollib.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 in enrol_guest_plugin.
Definition at line 1185 of file enrollib.php.


| get_action_icons | ( | stdClass $ | instance | ) |
Returns edit icons for the page with list of instances
| stdClass | $instance |
Reimplemented in enrol_self_plugin, enrol_manual_plugin, and enrol_paypal_plugin.
Definition at line 1649 of file enrollib.php.
Return an array of enrol_bulk_enrolment_operation objects that define the bulk actions that can be performed on user enrolments by the plugin.
Definition at line 1745 of file enrollib.php.
| get_config | ( | $ | name, |
| $ | default = NULL |
||
| ) |
Returns plugin config value
| string | $name | |
| string | $default | value if config does not exist yet |
Definition at line 1052 of file enrollib.php.


| get_description_text | ( | $ | instance | ) |
Returns optional enrolment instance description text.
This is used in detailed course information.
| object | $instance |
Definition at line 1031 of file enrollib.php.
| 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 in enrol_paypal_plugin, enrol_self_plugin, and enrol_guest_plugin.
Definition at line 1018 of file enrollib.php.
| get_instance_name | ( | $ | instance | ) |
Returns localised name of enrol instance
| object | $instance | (null is accepted too) |
Reimplemented in enrol_self_plugin, enrol_cohort_plugin, enrol_meta_plugin, and enrol_mnet_plugin.
Definition at line 996 of file enrollib.php.


| get_manual_enrol_button | ( | course_enrolment_manager $ | manager | ) |
Returns an enrol_user_button that takes the user to a page where they are able to enrol users into the managers course through this plugin.
Optional: If the plugin supports manual enrolments it can choose to override this otherwise it shouldn't
| course_enrolment_manager | $manager |
Reimplemented in enrol_manual_plugin, and enrol_cohort_plugin.
Definition at line 1714 of file enrollib.php.
| get_manual_enrol_link | ( | $ | instance | ) |
Returns link to manual enrol UI if exists. Does the access control tests automatically.
| object | $instance |
Reimplemented in enrol_manual_plugin.
Definition at line 1433 of file enrollib.php.
| get_name | ( | ) |
Returns name of this enrol plugin
Definition at line 984 of file enrollib.php.

| get_newinstance_link | ( | $ | courseid | ) |
Returns link to page which may be used to add new instance of enrolment plugin in course.
| int | $courseid |
Reimplemented in enrol_self_plugin, enrol_manual_plugin, enrol_paypal_plugin, enrol_guest_plugin, enrol_mnet_plugin, enrol_cohort_plugin, enrol_meta_plugin, and enrol_category_plugin.
Definition at line 1411 of file enrollib.php.
| get_unenrolself_link | ( | $ | instance | ) |
Returns list of unenrol links for all enrol instances in course.
| int | $instance |
Definition at line 1443 of file enrollib.php.

| get_user_enrolment_actions | ( | course_enrolment_manager $ | manager, |
| $ | ue | ||
| ) |
Gets an array of the user enrolment actions
| course_enrolment_manager | $manager | |
| stdClass | $ue |
Reimplemented in enrol_self_plugin, enrol_manual_plugin, and enrol_meta_plugin.
Definition at line 1725 of file enrollib.php.
Returns true if the plugin has one or more bulk operations that can be performed on user enrolments.
Definition at line 1735 of file enrollib.php.
| instance_deleteable | ( | $ | instance | ) |
Is it possible to delete enrol instance via standard UI?
| object | $instance |
Reimplemented in enrol_ldap_plugin, enrol_category_plugin, and enrol_database_plugin.
Definition at line 1422 of file enrollib.php.
| is_cron_required | ( | ) |
Reads version.php and determines if it is necessary to execute the cron job now.
Definition at line 1658 of file enrollib.php.

| load_config | ( | ) | [protected] |
Makes sure config is loaded and cached.
Definition at line 1039 of file enrollib.php.


| roles_protected | ( | ) |
Does this plugin assign protected roles are can they be manually removed?
Reimplemented in enrol_self_plugin, enrol_paypal_plugin, and enrol_manual_plugin.
Definition at line 1078 of file enrollib.php.

| set_config | ( | $ | name, |
| $ | value | ||
| ) |
Sets plugin config value
| string | $name | name of config |
| string | $value | string config value, null means delete |
Definition at line 1063 of file enrollib.php.


| show_enrolme_link | ( | stdClass $ | instance | ) |
Does this plugin support some way to user to self enrol?
| stdClass | $instance | course enrol instance |
Reimplemented in enrol_self_plugin, and enrol_paypal_plugin.
Definition at line 1140 of file enrollib.php.
| sync_user_enrolments | ( | $ | user | ) |
Forces synchronisation of user enrolments.
This is important especially for external enrol plugins, this function is called for all enabled enrol plugins right after every user login.
| object | $user | user record |
Reimplemented in enrol_ldap_plugin, and enrol_database_plugin.
Definition at line 1402 of file enrollib.php.
| try_autoenrol | ( | stdClass $ | instance | ) |
Attempt to automatically enrol current user in course without any interaction, calling code has to make sure the plugin and instance are active.
This should return either a timestamp in the future or false.
| stdClass | $instance | course enrol instance |
Definition at line 1153 of file enrollib.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.
This should return either a timestamp in the future or false.
| stdClass | $instance | course enrol instance |
Reimplemented in enrol_guest_plugin.
Definition at line 1168 of file enrollib.php.
| unenrol_user | ( | stdClass $ | instance, |
| $ | userid | ||
| ) |
Unenrol user from course, the last unenrolment removes all remaining roles.
| stdClass | $instance | |
| int | $userid |
Reimplemented in enrol_guest_plugin.
Definition at line 1326 of file enrollib.php.


| update_status | ( | $ | instance, |
| $ | newstatus | ||
| ) |
Update instance status
Override when plugin needs to do some action when enabled or disabled.
| stdClass | $instance | |
| int | $newstatus | ENROL_INSTANCE_ENABLED, ENROL_INSTANCE_DISABLED |
Reimplemented in enrol_meta_plugin.
Definition at line 1577 of file enrollib.php.
| update_user_enrol | ( | stdClass $ | instance, |
| $ | userid, | ||
| $ | status = NULL, |
||
| $ | timestart = NULL, |
||
| $ | timeend = NULL |
||
| ) |
Store user_enrolments changes and trigger event.
| stdClass | $instance | |
| int | $userid | |
| int | $status | |
| int | $timestart | |
| int | $timeend |
Definition at line 1275 of file enrollib.php.


| user_delete | ( | $ | user | ) |
Called when user is about to be deleted
| object | $user |
Definition at line 1688 of file enrollib.php.

$config = null [protected] |
Definition at line 978 of file enrollib.php.