Temporarily disabled content development mode until we can work out how it should work.

namespaces
Frode Petterson 2014-05-27 13:07:53 +02:00
parent c5b32fb621
commit 43d239c6f1
1 changed files with 15 additions and 14 deletions

View File

@ -1358,26 +1358,25 @@ class H5PCore {
); );
unset($content['libraryId'], $content['libraryName'], $content['libraryEmbedTypes'], $content['libraryFullscreen']); unset($content['libraryId'], $content['libraryName'], $content['libraryEmbedTypes'], $content['libraryFullscreen']);
// TODO: Move to filterParameters? // // TODO: Move to filterParameters?
if ($this->development_mode & H5PDevelopment::MODE_CONTENT) { // if ($this->development_mode & H5PDevelopment::MODE_CONTENT) {
// TODO: Remove Drupal specific stuff // // TODO: Remove Drupal specific stuff
$json_content_path = file_create_path(file_directory_path() . '/' . variable_get('h5p_default_path', 'h5p') . '/content/' . $id . '/content.json'); // $json_content_path = file_create_path(file_directory_path() . '/' . variable_get('h5p_default_path', 'h5p') . '/content/' . $id . '/content.json');
if (file_exists($json_content_path) === TRUE) { // if (file_exists($json_content_path) === TRUE) {
$json_content = file_get_contents($json_content_path); // $json_content = file_get_contents($json_content_path);
if (json_decode($json_content, TRUE) !== FALSE) { // if (json_decode($json_content, TRUE) !== FALSE) {
drupal_set_message(t('Invalid json in json content'), 'warning'); // drupal_set_message(t('Invalid json in json content'), 'warning');
} // }
$content['params'] = $json_content; // $content['params'] = $json_content;
} // }
} // }
} }
return $content; return $content;
} }
/** /**
* TODO: Add support for development modes. * Filter content run parameters, rebuild content dependecy cache and export file.
* TODO: Should we regenerate export here as well?
* *
* @param Object $content * @param Object $content
* @return Object NULL on failure. * @return Object NULL on failure.
@ -1402,6 +1401,8 @@ class H5PCore {
$dependencies = $validator->getDependencies(); $dependencies = $validator->getDependencies();
$this->h5pF->deleteLibraryUsage($content['id']); $this->h5pF->deleteLibraryUsage($content['id']);
$this->h5pF->saveLibraryUsage($content['id'], $dependencies); $this->h5pF->saveLibraryUsage($content['id'], $dependencies);
// TODO: Create new export if enabled.
// Cache. // Cache.
$this->h5pF->cacheSet('parameters', $content['id'], $params); $this->h5pF->cacheSet('parameters', $content['id'], $params);