Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

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

Class for Moodle Mobile tools.

Copyright: 2016 Juan Leyva
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 824 lines (40 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: api  - X-Ref

API exposed by tool_mobile, to be used mostly by external functions and the plugin settings.

get_plugins_supporting_mobile()   X-Ref
Returns a list of Moodle plugins supporting the mobile app.

return: array an array of objects containing the plugin information

get_public_config()   X-Ref
Returns a list of the site public settings, those not requiring authentication.

return: array with the settings and warnings

get_config($section)   X-Ref
Returns a list of site configurations, filtering by section.

param: string $section section name
return: stdClass object containing the settings

check_autologin_prerequisites($userid)   X-Ref
No description

get_autologin_key()   X-Ref
Creates an auto-login key for the current user, this key is restricted by time and ip address.
This key is used for automatically login the user in the site when the Moodle app opens the site in a mobile browser.

return: string the key

get_qrlogin_key(stdClass $mobilesettings)   X-Ref
Creates a QR login key for the current user, this key is restricted by time and ip address.
This key is used for automatically login the user in the site when the user scans a QR code in the Moodle app.

param: stdClass $mobilesettings  mobile app plugin settings
return: string the key

get_features_list()   X-Ref
Get a list of the Mobile app features.

return: array array with the features grouped by theirs ubication in the app.

get_potential_config_issues()   X-Ref
This function check the current site for potential configuration issues that may prevent the mobile app to work.

return: array list of potential issues

generate_login_qrcode(stdClass $mobilesettings)   X-Ref
Generates a QR code with the site URL or for automatic login from the mobile app.

param: stdClass $mobilesettings tool_mobile settings
return: string base64 data image contents, null if qr disabled

get_subscription_information()   X-Ref
Gets Moodle app plan subscription information for the current site as it is returned by the Apps Portal.

return: array Subscription information