From fdb21fe7e3d32442fad6c8acf6639de2ec055e37 Mon Sep 17 00:00:00 2001 From: Simon Cozens Date: Tue, 10 Apr 2007 00:59:43 +0000 Subject: [PATCH] I can't believe we didn't have a delete method. git-svn-id: http://svn.simon-cozens.org/memories/trunk@59 041978f6-d955-411f-a9d7-1d8545c9c3c7 --- Memories/Photo.pm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Memories/Photo.pm b/Memories/Photo.pm index 5ce8d95..939af00 100644 --- a/Memories/Photo.pm +++ b/Memories/Photo.pm @@ -211,6 +211,14 @@ sub comment :Exported {} sub tagedit :Exported {} sub similar :Exported {} sub sized :Exported {} +sub delete :Exported { + my ($self, $r, $photo) = @_; + if ($photo and $photo->uploader == $r->user) { + $photo->delete; + $r->message("Photo deleted!"); + } + $r->template("frontpage"); +} use Class::DBI::Plugin::Pager; use Class::DBI::Plugin::AbstractCount; -- 2.39.5