Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.
/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

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

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.

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

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

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.

param: context $context
return: array

edit_instance_form($instance, MoodleQuickForm $mform, $context)   X-Ref
Add elements to the edit instance form.

param: stdClass $instance
param: MoodleQuickForm $mform
param: context $context
return: bool

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.

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
return: array of "element_name"=>"error_description" if there are errors,
return: void