Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 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 39 and 310] [Versions 39 and 311] [Versions 39 and 400] [Versions 39 and 401] [Versions 39 and 402] [Versions 39 and 403]

   1  <?php
   2  
   3  
   4  /**
   5   * Handles Ajax functionality that must be implemented separately for each of the
   6   * H5P plugins
   7   */
   8  interface H5PEditorAjaxInterface {
   9  
  10    /**
  11     * Gets latest library versions that exists locally
  12     *
  13     * @return array Latest version of all local libraries
  14     */
  15    public function getLatestLibraryVersions();
  16  
  17    /**
  18     * Get locally stored Content Type Cache. If machine name is provided
  19     * it will only get the given content type from the cache
  20     *
  21     * @param $machineName
  22     *
  23     * @return array|object|null Returns results from querying the database
  24     */
  25    public function getContentTypeCache($machineName = NULL);
  26  
  27    /**
  28     * Gets recently used libraries for the current author
  29     *
  30     * @return array machine names. The first element in the array is the
  31     * most recently used.
  32     */
  33    public function getAuthorsRecentlyUsedLibraries();
  34  
  35    /**
  36     * Checks if the provided token is valid for this endpoint
  37     *
  38     * @param string $token The token that will be validated for.
  39     *
  40     * @return bool True if successful validation
  41     */
  42    public function validateEditorToken($token);
  43  
  44    /**
  45     * Get translations for a language for a list of libraries
  46     *
  47     * @param array $libraries An array of libraries, in the form "<machineName> <majorVersion>.<minorVersion>
  48     * @param string $language_code
  49     * @return array
  50     */
  51    public function getTranslations($libraries, $language_code);
  52  }