Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
core_h5p\editor_ajax Class Reference

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

Inheritance diagram for core_h5p\editor_ajax:
Moodle\H5PEditorAjaxInterface

Public Member Functions

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

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.
 

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.

Implements Moodle\H5PEditorAjaxInterface.

◆ 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

Implements Moodle\H5PEditorAjaxInterface.

◆ getLatestLibraryVersions()

core_h5p\editor_ajax::getLatestLibraryVersions ( )

Gets latest library versions that exists locally.

Return values
arrayLatest version of all local libraries

Implements Moodle\H5PEditorAjaxInterface.

◆ 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

Implements Moodle\H5PEditorAjaxInterface.

◆ 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

Implements Moodle\H5PEditorAjaxInterface.


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