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