Differences Between: [Versions 310 and 400] [Versions 400 and 401] [Versions 400 and 402] [Versions 400 and 403]
Fee enrolment plugin. This plugin allows you to set up paid courses.
Copyright: | 2019 Shamim Rezaie <shamim@moodle.com> |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 435 lines (16 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
enrol_fee_plugin:: (20 methods):
get_possible_currencies()
get_info_icons()
roles_protected()
allow_unenrol()
allow_manage()
show_enrolme_link()
can_add_instance()
use_standard_editing_ui()
add_instance()
update_instance()
enrol_page_hook()
restore_instance()
restore_user_enrolment()
get_status_options()
get_roleid_options()
edit_instance_form()
edit_instance_validation()
sync()
can_delete_instance()
can_hide_show_instance()
Class: enrol_fee_plugin - X-Ref
Fee enrolment plugin implementation.get_possible_currencies() X-Ref |
Returns the list of currencies that the payment subsystem supports and therefore we can work with. return: array[currencycode => currencyname] |
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. return: array of pix_icon param: array $instances all enrol instances of this type in one course |
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 |
can_add_instance($courseid) X-Ref |
Returns true if the user can add a new instance in this course. return: boolean param: int $courseid |
use_standard_editing_ui() X-Ref |
We are a good plugin and don't invent our own UI/validation code path. return: boolean |
add_instance($course, array $fields = null) X-Ref |
Add new instance of enrol plugin. return: int id of new instance, null if can not be created param: object $course param: array $fields instance fields |
update_instance($instance, $data) X-Ref |
Update instance of enrol plugin. return: boolean param: stdClass $instance param: stdClass $data modified instance fields |
enrol_page_hook(stdClass $instance) X-Ref |
Creates course enrol form, checks if form submitted and enrols user if necessary. It can also redirect. return: string html text, usually a form in a text box param: stdClass $instance |
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 |
get_status_options() X-Ref |
Return an array of valid options for the status. return: array |
get_roleid_options($instance, $context) X-Ref |
Return an array of valid options for the roleid. return: array param: stdClass $instance param: context $context |
edit_instance_form($instance, MoodleQuickForm $mform, $context) X-Ref |
Add elements to the edit instance form. return: bool param: stdClass $instance param: MoodleQuickForm $mform param: context $context |
edit_instance_validation($data, $files, $instance, $context) X-Ref |
Perform custom validation of the data used to edit the instance. return: array of "element_name"=>"error_description" if there are errors, return: void param: array $data array of ("fieldname"=>value) of submitted data param: array $files array of uploaded files "element_name"=>tmp_file_path param: object $instance The instance loaded from the DB param: context $context The context of the instance we are editing |
sync(progress_trace $trace) X-Ref |
Execute synchronisation. return: int exit code, 0 means ok param: progress_trace $trace |
can_delete_instance($instance) X-Ref |
Is it possible to delete enrol instance via standard UI? return: bool param: stdClass $instance |
can_hide_show_instance($instance) X-Ref |
Is it possible to hide/show enrol instance via standard UI? return: bool param: stdClass $instance |