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.
   1  <?php
   2  // This file is part of Moodle - http://moodle.org/
   3  //
   4  // Moodle is free software: you can redistribute it and/or modify
   5  // it under the terms of the GNU General Public License as published by
   6  // the Free Software Foundation, either version 3 of the License, or
   7  // (at your option) any later version.
   8  //
   9  // Moodle is distributed in the hope that it will be useful,
  10  // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12  // GNU General Public License for more details.
  13  //
  14  // You should have received a copy of the GNU General Public License
  15  // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
  16  
  17  /**
  18   * Moodle Mobile tools webservice definitions.
  19   *
  20   *
  21   * @package    tool_mobile
  22   * @copyright  2016 Juan Leyva
  23   * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  24   */
  25  
  26  $functions = array(
  27  
  28      'tool_mobile_get_plugins_supporting_mobile' => array(
  29          'classname'   => 'tool_mobile\external',
  30          'methodname'  => 'get_plugins_supporting_mobile',
  31          'description' => 'Returns a list of Moodle plugins supporting the mobile app.',
  32          'type'        => 'read',
  33          'services'    => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
  34          'ajax'          => true,
  35          'loginrequired' => false,
  36      ),
  37  
  38      'tool_mobile_get_public_config' => array(
  39          'classname'   => 'tool_mobile\external',
  40          'methodname'  => 'get_public_config',
  41          'description' => 'Returns a list of the site public settings, those not requiring authentication.',
  42          'type'        => 'read',
  43          'services'    => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
  44          'ajax'          => true,
  45          'loginrequired' => false,
  46      ),
  47  
  48      'tool_mobile_get_config' => array(
  49          'classname'   => 'tool_mobile\external',
  50          'methodname'  => 'get_config',
  51          'description' => 'Returns a list of the site configurations, filtering by section.',
  52          'type'        => 'read',
  53          'services'    => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
  54      ),
  55  
  56      'tool_mobile_get_autologin_key' => array(
  57          'classname'   => 'tool_mobile\external',
  58          'methodname'  => 'get_autologin_key',
  59          'description' => 'Creates an auto-login key for the current user.
  60                              Is created only in https sites and is restricted by time, ip address and only works if the request
  61                              comes from the Moodle mobile or desktop app.',
  62          'type'        => 'write',
  63          'services'    => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
  64      ),
  65  
  66      'tool_mobile_get_content' => array(
  67          'classname'   => 'tool_mobile\external',
  68          'methodname'  => 'get_content',
  69          'description' => 'Returns a piece of content to be displayed in the Mobile app.',
  70          'type'        => 'read',
  71          'services'    => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
  72      ),
  73  
  74      'tool_mobile_call_external_functions' => array(
  75          'classname'   => 'tool_mobile\external',
  76          'methodname'  => 'call_external_functions',
  77          'description' => 'Call multiple external functions and return all responses.',
  78          'type'        => 'write',
  79          'services'    => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
  80      ),
  81  
  82      'tool_mobile_validate_subscription_key' => array(
  83          'classname'   => 'tool_mobile\external',
  84          'methodname'  => 'validate_subscription_key',
  85          'description' => 'Check if the given site subscription key is valid.',
  86          'type'        => 'write',
  87          'services'    => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
  88          'ajax'          => true,
  89          'loginrequired' => false,
  90      ),
  91  
  92      'tool_mobile_get_tokens_for_qr_login' => array(
  93          'classname'   => 'tool_mobile\external',
  94          'methodname'  => 'get_tokens_for_qr_login',
  95          'description' => 'Returns a WebService token (and private token) for QR login.',
  96          'type'        => 'read',
  97          'services'    => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
  98          'ajax'          => true,
  99          'loginrequired' => false,
 100      ),
 101  );