[ Index ] |
PHP Cross Reference of moodle-2.8 |
[Source view] [Print] [Project Stats]
Self enrolment plugin.
Copyright: | 2010 Petr Skoda {@link http://skodak.org} |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 672 lines (26 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
enrol_self_plugin:: (25 methods):
get_info_icons()
get_instance_name()
roles_protected()
allow_unenrol()
allow_manage()
show_enrolme_link()
add_course_navigation()
get_action_icons()
get_newinstance_link()
enrol_self()
enrol_page_hook()
can_self_enrol()
get_enrol_info()
add_default_instance()
get_instance_defaults()
email_welcome_message()
cron()
sync()
get_enroller()
get_user_enrolment_actions()
restore_instance()
restore_user_enrolment()
restore_role_assignment()
can_delete_instance()
can_hide_show_instance()
Class: enrol_self_plugin - X-Ref
Self enrolment plugin implementation.get_info_icons(array $instances) X-Ref |
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. param: array $instances all enrol instances of this type in one course return: array of pix_icon |
get_instance_name($instance) X-Ref |
Returns localised name of enrol instance param: stdClass $instance (null is accepted too) return: string |
roles_protected() X-Ref |
No description |
allow_unenrol(stdClass $instance) X-Ref |
No description |
allow_manage(stdClass $instance) X-Ref |
No description |
show_enrolme_link(stdClass $instance) X-Ref |
No description |
add_course_navigation($instancesnode, stdClass $instance) X-Ref |
Sets up navigation entries. param: stdClass $instancesnode param: stdClass $instance return: void |
get_action_icons(stdClass $instance) X-Ref |
Returns edit icons for the page with list of instances param: stdClass $instance return: array |
get_newinstance_link($courseid) X-Ref |
Returns link to page which may be used to add new instance of enrolment plugin in course. param: int $courseid return: moodle_url page url |
enrol_self(stdClass $instance, $data = null) X-Ref |
Self enrol user to course param: stdClass $instance enrolment instance param: stdClass $data data needed for enrolment. return: bool|array true if enroled else eddor code and messege |
enrol_page_hook(stdClass $instance) X-Ref |
Creates course enrol form, checks if form submitted and enrols user if necessary. It can also redirect. param: stdClass $instance return: string html text, usually a form in a text box |
can_self_enrol(stdClass $instance, $checkuserenrolment = true) X-Ref |
Checks if user can self enrol. param: stdClass $instance enrolment instance param: bool $checkuserenrolment if true will check if user enrolment is inactive. return: bool|string true if successful, else error message or false. |
get_enrol_info(stdClass $instance) X-Ref |
Return information for enrolment instance containing list of parameters required for enrolment, name of enrolment plugin etc. param: stdClass $instance enrolment instance return: stdClass instance info. |
add_default_instance($course) X-Ref |
Add new instance of enrol plugin with default settings. param: stdClass $course return: int id of new instance |
get_instance_defaults() X-Ref |
Returns defaults for new instances. return: array |
email_welcome_message($instance, $user) X-Ref |
Send welcome email to specified user. param: stdClass $instance param: stdClass $user user record return: void |
cron() X-Ref |
Enrol self cron support. return: void |
sync(progress_trace $trace, $courseid = null) X-Ref |
Sync all meta course links. param: progress_trace $trace param: int $courseid one course, empty mean all return: int 0 means ok, 1 means error, 2 means plugin disabled |
get_enroller($instanceid) X-Ref |
Returns the user who is responsible for self enrolments in given instance. Usually it is the first editing teacher - the person with "highest authority" as defined by sort_by_roleassignment_authority() having 'enrol/self:manage' capability. param: int $instanceid enrolment instance id return: stdClass user record |
get_user_enrolment_actions(course_enrolment_manager $manager, $ue) X-Ref |
Gets an array of the user enrolment actions. param: course_enrolment_manager $manager param: stdClass $ue A user enrolment object return: array An array of user_enrolment_actions |
restore_instance(restore_enrolments_structure_step $step, stdClass $data, $course, $oldid) X-Ref |
Restore instance and map settings. param: restore_enrolments_structure_step $step param: stdClass $data param: stdClass $course param: int $oldid |
restore_user_enrolment(restore_enrolments_structure_step $step, $data, $instance, $userid, $oldinstancestatus) X-Ref |
Restore user enrolment. param: restore_enrolments_structure_step $step param: stdClass $data param: stdClass $instance param: int $oldinstancestatus param: int $userid |
restore_role_assignment($instance, $roleid, $userid, $contextid) X-Ref |
Restore role assignment. param: stdClass $instance param: int $roleid param: int $userid param: int $contextid |
can_delete_instance($instance) X-Ref |
Is it possible to delete enrol instance via standard UI? param: stdClass $instance return: bool |
can_hide_show_instance($instance) X-Ref |
Is it possible to hide/show enrol instance via standard UI? param: stdClass $instance return: bool |
Generated: Fri Nov 28 20:29:05 2014 | Cross-referenced by PHPXref 0.7.1 |