From 43d239c6f120170aad4894ba6cb02bc355d3d565 Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Tue, 27 May 2014 13:07:53 +0200 Subject: [PATCH] Temporarily disabled content development mode until we can work out how it should work. --- h5p.classes.php | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/h5p.classes.php b/h5p.classes.php index 16dabbb..0f15770 100644 --- a/h5p.classes.php +++ b/h5p.classes.php @@ -1358,26 +1358,25 @@ class H5PCore { ); unset($content['libraryId'], $content['libraryName'], $content['libraryEmbedTypes'], $content['libraryFullscreen']); - // TODO: Move to filterParameters? - if ($this->development_mode & H5PDevelopment::MODE_CONTENT) { - // TODO: Remove Drupal specific stuff - $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) { - $json_content = file_get_contents($json_content_path); - if (json_decode($json_content, TRUE) !== FALSE) { - drupal_set_message(t('Invalid json in json content'), 'warning'); - } - $content['params'] = $json_content; - } - } +// // TODO: Move to filterParameters? +// if ($this->development_mode & H5PDevelopment::MODE_CONTENT) { +// // TODO: Remove Drupal specific stuff +// $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) { +// $json_content = file_get_contents($json_content_path); +// if (json_decode($json_content, TRUE) !== FALSE) { +// drupal_set_message(t('Invalid json in json content'), 'warning'); +// } +// $content['params'] = $json_content; +// } +// } } return $content; } /** - * TODO: Add support for development modes. - * TODO: Should we regenerate export here as well? + * Filter content run parameters, rebuild content dependecy cache and export file. * * @param Object $content * @return Object NULL on failure. @@ -1402,6 +1401,8 @@ class H5PCore { $dependencies = $validator->getDependencies(); $this->h5pF->deleteLibraryUsage($content['id']); $this->h5pF->saveLibraryUsage($content['id'], $dependencies); + + // TODO: Create new export if enabled. // Cache. $this->h5pF->cacheSet('parameters', $content['id'], $params);