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 400] [Versions 310 and 401] [Versions 310 and 402] [Versions 310 and 403]

   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   * External tool external functions and service definitions.
  19   *
  20   * @package    mod_lti
  21   * @category   external
  22   * @copyright  2015 Juan Leyva <juan@moodle.com>
  23   * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  24   * @since      Moodle 3.0
  25   */
  26  
  27  defined('MOODLE_INTERNAL') || die;
  28  
  29  $functions = array(
  30  
  31      'mod_lti_get_tool_launch_data' => array(
  32          'classname'     => 'mod_lti_external',
  33          'methodname'    => 'get_tool_launch_data',
  34          'description'   => 'Return the launch data for a given external tool.',
  35          'type'          => 'read',
  36          'capabilities'  => 'mod/lti:view',
  37          'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
  38      ),
  39  
  40      'mod_lti_get_ltis_by_courses' => array(
  41          'classname'     => 'mod_lti_external',
  42          'methodname'    => 'get_ltis_by_courses',
  43          'description'   => 'Returns a list of external tool instances in a provided set of courses, if
  44                              no courses are provided then all the external tool instances the user has access to will be returned.',
  45          'type'          => 'read',
  46          'capabilities'  => 'mod/lti:view',
  47          'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
  48      ),
  49  
  50      'mod_lti_view_lti' => array(
  51          'classname'     => 'mod_lti_external',
  52          'methodname'    => 'view_lti',
  53          'description'   => 'Trigger the course module viewed event and update the module completion status.',
  54          'type'          => 'read',
  55          'capabilities'  => 'mod/lti:view',
  56          'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
  57      ),
  58  
  59      'mod_lti_get_tool_proxies' => array(
  60          'classname'     => 'mod_lti_external',
  61          'methodname'    => 'get_tool_proxies',
  62          'description'   => 'Get a list of the tool proxies',
  63          'type'          => 'read',
  64          'capabilities'  => 'moodle/site:config',
  65          'ajax'          => true
  66      ),
  67  
  68      'mod_lti_create_tool_proxy' => array(
  69          'classname'     => 'mod_lti_external',
  70          'methodname'    => 'create_tool_proxy',
  71          'description'   => 'Create a tool proxy',
  72          'type'          => 'write',
  73          'capabilities'  => 'moodle/site:config',
  74          'ajax'          => true
  75      ),
  76  
  77      'mod_lti_delete_tool_proxy' => array(
  78          'classname'     => 'mod_lti_external',
  79          'methodname'    => 'delete_tool_proxy',
  80          'description'   => 'Delete a tool proxy',
  81          'type'          => 'write',
  82          'capabilities'  => 'moodle/site:config',
  83          'ajax'          => true
  84      ),
  85  
  86      'mod_lti_get_tool_proxy_registration_request' => array(
  87          'classname'     => 'mod_lti_external',
  88          'methodname'    => 'get_tool_proxy_registration_request',
  89          'description'   => 'Get a registration request for a tool proxy',
  90          'type'          => 'read',
  91          'capabilities'  => 'moodle/site:config',
  92          'ajax'          => true
  93      ),
  94  
  95      'mod_lti_get_tool_types' => array(
  96          'classname'     => 'mod_lti_external',
  97          'methodname'    => 'get_tool_types',
  98          'description'   => 'Get a list of the tool types',
  99          'type'          => 'read',
 100          'capabilities'  => 'moodle/site:config',
 101          'ajax'          => true
 102      ),
 103  
 104      'mod_lti_create_tool_type' => array(
 105          'classname'     => 'mod_lti_external',
 106          'methodname'    => 'create_tool_type',
 107          'description'   => 'Create a tool type',
 108          'type'          => 'write',
 109          'capabilities'  => 'moodle/site:config',
 110          'ajax'          => true
 111      ),
 112  
 113      'mod_lti_update_tool_type' => array(
 114          'classname'     => 'mod_lti_external',
 115          'methodname'    => 'update_tool_type',
 116          'description'   => 'Update a tool type',
 117          'type'          => 'write',
 118          'capabilities'  => 'moodle/site:config',
 119          'ajax'          => true
 120      ),
 121  
 122      'mod_lti_delete_tool_type' => array(
 123          'classname'     => 'mod_lti_external',
 124          'methodname'    => 'delete_tool_type',
 125          'description'   => 'Delete a tool type',
 126          'type'          => 'write',
 127          'capabilities'  => 'moodle/site:config',
 128          'ajax'          => true
 129      ),
 130  
 131      'mod_lti_is_cartridge' => array(
 132          'classname'     => 'mod_lti_external',
 133          'methodname'    => 'is_cartridge',
 134          'description'   => 'Determine if the given url is for a cartridge',
 135          'type'          => 'read',
 136          'capabilities'  => 'moodle/site:config',
 137          'ajax'          => true
 138      ),
 139  );