Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 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.

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

Class for Moodle Mobile tools.

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