Moodle PHP Documentation 4.4
Moodle 4.4.1 (Build: 20240610) (db07c09afc5)
|
Public Member Functions | |
__construct ($H5PFramework, $H5PCore) | |
Constructor for the H5PContentValidator. | |
addon ($library) | |
Add Addon library. | |
filterParams (&$params, $whitelist) | |
Check params for a whitelist of allowed properties. | |
getCopyrightSemantics () | |
getDependencies () | |
Get the flat dependency tree. | |
getMetadataSemantics () | |
validateAudio (&$audio, $semantics) | |
Validate given audio data. | |
validateBoolean (&$bool) | |
Validate given value against boolean semantics. | |
validateContentFiles ($contentPath, $isLibrary=FALSE) | |
Validates content files. | |
validateFile (&$file, $semantics) | |
Validate given file data. | |
validateGroup (&$group, $semantics, $flatten=TRUE) | |
Validate given group value against group semantics. | |
validateImage (&$image, $semantics) | |
Validate given image data. | |
validateLibrary (&$value, $semantics) | |
Validate given library value against library semantics. | |
validateList (&$list, $semantics) | |
Validate given list value against list semantics. | |
validateMetadata ($metadata) | |
Validate metadata. | |
validateNumber (&$number, $semantics) | |
Validate given value against number semantics. | |
validateSelect (&$select, $semantics) | |
Validate select values. | |
validateText (&$text, $semantics) | |
Validate given text value against text semantics. | |
validateVideo (&$video, $semantics) | |
Validate given video data. | |
Public Attributes | |
$h5pC | |
$h5pF | |
return | $uri |
Protected Attributes | |
bool | $allowedStyles |
Allowed styles status. | |
Moodle\H5PContentValidator::__construct | ( | $H5PFramework, | |
$H5PCore ) |
Constructor for the H5PContentValidator.
object | $H5PFramework | The frameworks implementation of the H5PFrameworkInterface |
object | $H5PCore | The main H5PCore instance |
Moodle\H5PContentValidator::filterParams | ( | & | $params, |
$whitelist ) |
Check params for a whitelist of allowed properties.
array/object | $params | |
array | $whitelist |
Moodle\H5PContentValidator::getDependencies | ( | ) |
Get the flat dependency tree.
array |
Moodle\H5PContentValidator::validateAudio | ( | & | $audio, |
$semantics ) |
Validate given audio data.
$audio | |
$semantics |
Moodle\H5PContentValidator::validateBoolean | ( | & | $bool | ) |
Validate given value against boolean semantics.
$bool |
bool |
Moodle\H5PContentValidator::validateContentFiles | ( | $contentPath, | |
$isLibrary = FALSE ) |
Validates content files.
string | $contentPath | The path containing content files to validate. |
bool | $isLibrary |
bool | TRUE if all files are valid TRUE if all files are valid FALSE if one or more files fail validation. Error message should be set accordingly by validator. |
Moodle\H5PContentValidator::validateFile | ( | & | $file, |
$semantics ) |
Validate given file data.
$file | |
$semantics |
Moodle\H5PContentValidator::validateGroup | ( | & | $group, |
$semantics, | |||
$flatten = TRUE ) |
Validate given group value against group semantics.
Will recurse into validating each group member.
$group | ||
$semantics | ||
bool | $flatten |
Moodle\H5PContentValidator::validateImage | ( | & | $image, |
$semantics ) |
Validate given image data.
$image | |
$semantics |
Moodle\H5PContentValidator::validateLibrary | ( | & | $value, |
$semantics ) |
Validate given library value against library semantics.
Check if provided library is within allowed options.
Will recurse into validating the library's semantics too.
$value | |
$semantics |
Moodle\H5PContentValidator::validateList | ( | & | $list, |
$semantics ) |
Validate given list value against list semantics.
Will recurse into validating each item in the list according to the type.
$list | |
$semantics |
Moodle\H5PContentValidator::validateMetadata | ( | $metadata | ) |
Validate metadata.
array | $metadata |
array | Validated & filtered |
Moodle\H5PContentValidator::validateNumber | ( | & | $number, |
$semantics ) |
Validate given value against number semantics.
$number | |
$semantics |
Moodle\H5PContentValidator::validateSelect | ( | & | $select, |
$semantics ) |
Validate select values.
$select | |
$semantics |
Moodle\H5PContentValidator::validateText | ( | & | $text, |
$semantics ) |
Validate given text value against text semantics.
$text | |
$semantics |
Moodle\H5PContentValidator::validateVideo | ( | & | $video, |
$semantics ) |
Validate given video data.
$video | |
$semantics |