Add the schema to the database
parent
784d5caeb3
commit
905afe7dde
|
@ -300,6 +300,20 @@ class h5pValidator {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// validate json if a schema file is provided
|
||||||
|
$schemaPath = $file_path . DIRECTORY_SEPARATOR . 'schema.json';
|
||||||
|
if (file_exists($schemaPath)) {
|
||||||
|
$schema = $this->getJsonData($schemaPath);
|
||||||
|
if ($schema === FALSE) {
|
||||||
|
$this->h5pF->setErrorMessage($this->h5pF->t('Invalid schema.json file has been included in the library %name', array('%name' => $file)));
|
||||||
|
$valid = FALSE;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$h5pData->schema = $schema;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$validLibrary = $this->isValidH5pData($h5pData, $file, $this->libraryRequired, $this->libraryOptional);
|
$validLibrary = $this->isValidH5pData($h5pData, $file, $this->libraryRequired, $this->libraryOptional);
|
||||||
|
|
||||||
if (isset($h5pData['preloadedJs'])) {
|
if (isset($h5pData['preloadedJs'])) {
|
||||||
|
|
Loading…
Reference in New Issue