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
This commit is contained in:
Tim Almdal
2008-12-03 22:39:57 +00:00
parent d8511f2fde
commit 7bb4b6029d
3 changed files with 85 additions and 0 deletions

View File

@@ -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}");