Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

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

Class for Moodle Mobile tools.

Copyright: 2016 Juan Leyva
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 785 lines (38 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()   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

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