From 7bb4b6029df8b17ef8a2ba9c8ce8d6c7b3e015c3 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 3 Dec 2008 22:39:57 +0000 Subject: Add a MY_file class that extends the file helper by creating an unlink method that deletes a file or an album directory. Modify Items_Controller::_delete to call this new helper method when deleting an item --- core/controllers/items.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'core/controllers') diff --git a/core/controllers/items.php b/core/controllers/items.php index 6cf27fbf..6ba7db65 100644 --- a/core/controllers/items.php +++ b/core/controllers/items.php @@ -100,7 +100,9 @@ class Items_Controller extends REST_Controller { $parent = $item->parent(); if ($parent->id) { module::event("{$item->type}_before_delete", $item); + $item->delete(); + file::unlink($item->file_path()); } url::redirect("{$parent->type}s/{$parent->id}"); -- cgit v1.2.3