Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is 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