Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
|
Public Member Functions | |
__construct ($h5p, $storage, $ajaxInterface) | |
addPresaveFile (&$assets, $library, $prefix='') | |
Adds the path to the presave.js file to the list of dependency assets for the library. | |
canInstallContentType ($contentType) | |
findEditorLibraries ($machineName, $majorVersion, $minorVersion) | |
Return all libraries used by the given editor library. | |
getCachedLibsMap ($cached_library) | |
Extract library properties from cached library so they are ready to be returned as JSON. | |
getLatestGlobalLibrariesData () | |
Gets local and external libraries data with metadata to display all libraries that are currently available for the user. | |
getLibraries () | |
Get list of libraries. | |
getLibraryData ($machineName, $majorVersion, $minorVersion, $languageCode, $prefix='', $fileDir='', $defaultLanguage='') | |
Get all scripts, css and semantics data for a library. | |
getLibraryLanguage ($machineName, $majorVersion, $minorVersion, $languageCode) | |
TODO: Consider moving to core. | |
getTranslations ($libraries, $language_code) | |
Get translations for a language for a list of libraries. | |
getUserSpecificContentTypeCache () | |
Gets content type cache, applies user specific properties and formats as camelCase. | |
hasPresave ($libraryName) | |
Determine if a library has a presave.js file in the root folder. | |
mergeLocalLibsIntoCachedLibs ($local_libraries, &$cached_libraries) | |
Merge local libraries into cached libraries so that local libraries will get supplemented with the additional info from externally cached libraries. | |
processParameters ($content, $newLibrary, $newParameters, $oldLibrary=NULL, $oldParameters=NULL) | |
Move uploaded files, remove old files and update library usage. | |
Static Public Member Functions | |
static | buildCssPath ($matches, $base=NULL) |
This function will prefix all paths within a CSS file. | |
Public Attributes | |
$ajax | |
$ajaxInterface | |
$content | |
Static Public Attributes | |
static | $scripts |
static | $styles |
Moodle\H5peditor::addPresaveFile | ( | & | $assets, |
$library, | |||
$prefix = '' ) |
Adds the path to the presave.js file to the list of dependency assets for the library.
array | $assets | |
array | $library | |
string | $prefix |
|
static |
This function will prefix all paths within a CSS file.
Copied from Drupal 6.
@staticvar type $_base
type | $matches | |
type | $base |
type |
Moodle\H5peditor::findEditorLibraries | ( | $machineName, | |
$majorVersion, | |||
$minorVersion ) |
Return all libraries used by the given editor library.
string | $machineName | Library identfier part 1 |
int | $majorVersion | Library identfier part 2 |
int | $minorVersion | Library identfier part 3 |
Moodle\H5peditor::getCachedLibsMap | ( | $cached_library | ) |
Extract library properties from cached library so they are ready to be returned as JSON.
object | $cached_library | A single library from the content type cache |
array | A map containing the necessary properties for a cached library to send to the front-end |
Moodle\H5peditor::getLatestGlobalLibrariesData | ( | ) |
Gets local and external libraries data with metadata to display all libraries that are currently available for the user.
array\$libraries | Latest local and external libraries data with user specific permissions |
Moodle\H5peditor::getLibraries | ( | ) |
Get list of libraries.
array |
Moodle\H5peditor::getLibraryData | ( | $machineName, | |
$majorVersion, | |||
$minorVersion, | |||
$languageCode, | |||
$prefix = '', | |||
$fileDir = '', | |||
$defaultLanguage = '' ) |
Get all scripts, css and semantics data for a library.
string | $machineName | Library name |
int | $majorVersion | |
int | $minorVersion | |
string | $prefix | Optional part to add between URL and asset path |
string | $fileDir | Optional file dir to read files from |
array | Libraries that was requested |
Moodle\H5peditor::getTranslations | ( | $libraries, | |
$language_code ) |
Get translations for a language for a list of libraries.
array | $libraries | An array of libraries, in the form "<machineName> <majorVersion>.<minorVersion> |
string | $language_code |
array |
Moodle\H5peditor::getUserSpecificContentTypeCache | ( | ) |
Gets content type cache, applies user specific properties and formats as camelCase.
array\$libraries | Cached libraries from the H5P Hub with user specific permission properties |
Moodle\H5peditor::hasPresave | ( | $libraryName | ) |
Determine if a library has a presave.js file in the root folder.
string | $libraryName |
bool |
Moodle\H5peditor::mergeLocalLibsIntoCachedLibs | ( | $local_libraries, | |
& | $cached_libraries ) |
Merge local libraries into cached libraries so that local libraries will get supplemented with the additional info from externally cached libraries.
Also sets whether a given cached library is installed and up to date with the locally installed libraries
array | $local_libraries | Locally installed libraries |
array | $cached_libraries | Cached libraries from the H5P hub |
Moodle\H5peditor::processParameters | ( | $content, | |
$newLibrary, | |||
$newParameters, | |||
$oldLibrary = NULL, | |||
$oldParameters = NULL ) |
Move uploaded files, remove old files and update library usage.
stdClass | $content | |
array | $newLibrary | |
array | $newParameters | |
array | $oldLibrary | |
array | $oldParameters |
|
static |