Skip to content
Snippets Groups Projects
Commit 4282898e authored by Frode Petterson's avatar Frode Petterson
Browse files

Implemented latest core changes

HFP-23
parent 5cff08e2
No related branches found
No related tags found
No related merge requests found
...@@ -179,23 +179,43 @@ class file_storage implements \H5PFileStorage { ...@@ -179,23 +179,43 @@ class file_storage implements \H5PFileStorage {
} }
/** /**
* Removes given export file * Get file object for given export file.
* *
* @param string $filename * @param string $filename
* @return stdClass Moodle file object
*/ */
public function deleteExport($filename) { private function getExportFile($filename) {
global $COURSE; global $COURSE;
$context = \context_course::instance($COURSE->id); $context = \context_course::instance($COURSE->id);
// Check if file exists. // Check if file exists.
$fs = get_file_storage(); $fs = get_file_storage();
$file = $fs->get_file($context->id, 'mod_hvp', 'exports', 0, '/', $filename); return $fs->get_file($context->id, 'mod_hvp', 'exports', 0, '/', $filename);
}
/**
* Removes given export file
*
* @param string $filename
*/
public function deleteExport($filename) {
$file = $this->getExportFile($filename);
if ($file) { if ($file) {
// Remove old export. // Remove old export.
$file->delete(); $file->delete();
} }
} }
/**
* Check if the given export file exists
*
* @param string $filename
* @return boolean
*/
public function hasExport($filename) {
return !! $this->getExportFile($filename);
}
/** /**
* Will concatenate all JavaScrips and Stylesheets into two files in order * Will concatenate all JavaScrips and Stylesheets into two files in order
* to improve page performance. * to improve page performance.
......
...@@ -1222,4 +1222,9 @@ class framework implements \H5PFrameworkInterface { ...@@ -1222,4 +1222,9 @@ class framework implements \H5PFrameworkInterface {
)); ));
} }
/**
* Implements afterExportCreated
*/
public function afterExportCreated() {
}
} }
Subproject commit 6b6d4cd109a0d187f6523fa1428a9a0440917c05 Subproject commit c9e5680e852ddc579e78b467504cb6bec40e0e0c
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment