From 7aef0628100cdf0dbc860320868a871c8be4802f Mon Sep 17 00:00:00 2001 From: Svein-Tore Griff With Date: Mon, 18 Nov 2013 17:57:32 +0100 Subject: [PATCH] Clean up deletion and make sure export is deleted when node is deleted --- h5p.classes.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/h5p.classes.php b/h5p.classes.php index 987868c..2298fcd 100644 --- a/h5p.classes.php +++ b/h5p.classes.php @@ -1155,6 +1155,14 @@ Class H5PExport { return str_replace(DIRECTORY_SEPARATOR, '/', $zipPath); } + + public function deleteExport($contentId) { + $h5pDir = $this->h5pF->getH5pPath() . DIRECTORY_SEPARATOR; + $zipPath = $h5pDir . 'exports' . DIRECTORY_SEPARATOR . $contentId . '.h5p'; + if (file_exists($zipPath)) { + file_delete($zipPath); + } + } private function addEditorLibraries($libraries, $editorLibraries) { foreach ($editorLibraries as $editorLibrary) {