Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 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/lti/ -> lib.php (source)

Differences Between: [Versions 39 and 311] [Versions 39 and 400] [Versions 39 and 401] [Versions 39 and 402] [Versions 39 and 403]

LTI enrolment plugin main library file.

Copyright: 2016 Mark Nelson <markn@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 417 lines (17 kb)
Included or required:0 times
Referenced: 1 time
Includes or requires: 0 files

Defines 1 class


Class: enrol_lti_plugin  - X-Ref

LTI enrolment plugin class.

can_add_instance($courseid)   X-Ref
Return true if we can add a new instance to this course.

param: int $courseid
return: boolean

can_delete_instance($instance)   X-Ref
Is it possible to delete enrol instance via standard UI?

param: object $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

allow_unenrol(stdClass $instance)   X-Ref
Returns true if it's possible to unenrol users.

param: stdClass $instance course enrol instance
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

add_instance($course, array $fields = null)   X-Ref
Add new instance of enrol plugin.

param: object $course
param: array $fields instance fields
return: int id of new instance, null if can not be created

update_instance($instance, $data)   X-Ref
Update instance of enrol plugin.

param: stdClass $instance
param: stdClass $data modified instance fields
return: boolean

delete_instance($instance)   X-Ref
Delete plugin specific information.

param: stdClass $instance
return: void

unenrol_user(stdClass $instance, $userid)   X-Ref
Handles un-enrolling a user.

param: stdClass $instance
param: int $userid
return: void

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

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

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

enrol_lti_extend_navigation_course($navigation, $course, $context)   X-Ref
Display the LTI link in the course administration menu.

param: settings_navigation $navigation The settings navigation object
param: stdClass $course The course
param: stdclass $context Course context