Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
core_h5p\editor_ajax Class Reference

Moodle's implementation of the H5P Editor Ajax interface. More...

Inheritance diagram for core_h5p\editor_ajax:

Public Member Functions

 getAuthorsRecentlyUsedLibraries ()
 Gets recently used libraries for the current author. More...
 
 getContentTypeCache ($machinename=null)
 Get locally stored Content Type Cache. More...
 
 getLatestLibraryVersions ()
 Gets latest library versions that exists locally. More...
 
 getTranslations ($libraries, $languagecode)
 Get translations in one language for a list of libraries. More...
 
 validateEditorToken ($token)
 Checks if the provided token is valid for this endpoint. More...
 

Public Attributes

const EDITOR_AJAX_TOKEN = 'editorajax'
 The component for H5P.
 

Protected Member Functions

 get_missing_translations (array $missing, string $language)
 Get translation for $language for libraries in $missing. More...
 

Detailed Description

Moodle's implementation of the H5P Editor Ajax interface.

Makes it possible for the editor's core ajax functionality to communicate with the database used by Moodle.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ get_missing_translations()

core_h5p\editor_ajax::get_missing_translations ( array  $missing,
string  $language 
)
protected

Get translation for $language for libraries in $missing.

Parameters
array$missingAn array of libraries, in the form "<machineName> <majorVersion>.<minorVersion>
string$languageLanguage code
Return values
arrayTranslations in $language available for libraries $missing

◆ getAuthorsRecentlyUsedLibraries()

core_h5p\editor_ajax::getAuthorsRecentlyUsedLibraries ( )

Gets recently used libraries for the current author.

Return values
arraymachine names. The first element in the array is the most recently used.

◆ getContentTypeCache()

core_h5p\editor_ajax::getContentTypeCache (   $machinename = null)

Get locally stored Content Type Cache.

If machine name is provided it will only get the given content type from the cache.

Parameters
null | string$machinename
Return values
mixed|nullReturns results from querying the database

◆ getLatestLibraryVersions()

core_h5p\editor_ajax::getLatestLibraryVersions ( )

Gets latest library versions that exists locally.

Return values
arrayLatest version of all local libraries

◆ getTranslations()

core_h5p\editor_ajax::getTranslations (   $libraries,
  $languagecode 
)

Get translations in one language for a list of libraries.

Parameters
array$librariesAn array of libraries, in the form "<machineName> <majorVersion>.<minorVersion>
string$languagecodeLanguage code
Return values
arrayTranslations in $languagecode available for libraries $libraries

◆ validateEditorToken()

core_h5p\editor_ajax::validateEditorToken (   $token)

Checks if the provided token is valid for this endpoint.

Parameters
string$tokenThe token that will be validated for.
Return values
boolTrue if successful validation

The documentation for this class was generated from the following file: