Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.
/enrol/mnet/ -> lib.php (source)

MNet enrolment plugin

Copyright: 2010 David Mudrak <david@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 213 lines (8 kb)
Included or required: 1 time
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: enrol_mnet_plugin  - X-Ref

MNet enrolment plugin implementation for Moodle 2.x enrolment framework

get_instance_name($instance)   X-Ref
Returns localised name of enrol instance

return: string
param: object|null $instance enrol_mnet instance

can_add_instance($courseid)   X-Ref
Returns true if a new instance can be added to this course.

The link is returned only if there are some MNet peers that we publish enrolment service to.

return: boolean
param: int $courseid id of the course to add the instance to

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

get_valid_hosts_options()   X-Ref
Return an array of valid options for the hosts property.

return: array

get_valid_roles_options($context)   X-Ref
Return an array of valid options for the roles property.

return: array
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

use_standard_editing_ui()   X-Ref
We are a good plugin and don't invent our own UI/validation code path.

return: boolean

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