Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

Differences Between: [Versions 39 and 402]

Base class for library handlers.

Copyright: 2019 Sara Arjona <sara@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 180 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: handler  - X-Ref

Base class for library handlers.

If a new H5P libraries handler plugin has to be created, it has to define class
PLUGINNAME\local\library\handler that extends \core_h5p\local\library\handler.

get_h5p_library_base()   X-Ref
Get the base path for the H5P Libraries.

return: null|string

get_h5p_core_library_base(?string $filepath = null)   X-Ref
Get the base path for the current H5P Core Library.

param: string $filepath The path within the H5P root
return: null|string

get_h5p_editor_library_base(?string $filepath = null)   X-Ref
Get the base path for the current H5P Editor Library.

param: null|string $filepath The path within the H5P root.
return: string Path to a file in the H5P Editor library.

register()   X-Ref
Register the H5P autoloader.


autoload($classname)   X-Ref
SPL Autoloading function for H5P.

param: string $classname The name of the class to load

get_h5p_core_library_url(?string $filepath = null, ?array $params = null)   X-Ref
Get a URL for the current H5P Core Library.

param: string $filepath The path within the h5p root
param: array $params these params override current params or add new
return: null|\moodle_url

get_h5p_editor_library_url(?string $filepath = null, ?array $params = null)   X-Ref
Get a URL for the current H5P Editor Library.

param: string $filepath The path within the h5p root.
param: array $params These params override current params or add new.
return: null|\moodle_url The moodle_url to a file in the H5P Editor library.

get_h5p_string(string $identifier, string $language)   X-Ref
Returns a localized string, if it exists in the h5plib plugin and the value it's different from the English version.

param: string $identifier The key identifier for the localized string
param: string $language Language to get the localized string.
return: string|null The localized string or null if it doesn't exist in this H5P library plugin.

get_class_list()   X-Ref
Return the list of classes with their location within the joubel directory.

return: array