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.

Differences Between: [Versions 310 and 400] [Versions 311 and 400] [Versions 39 and 400] [Versions 400 and 401] [Versions 400 and 402] [Versions 400 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: 798 lines (39 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.

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

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.

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

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.

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

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