Beispiel #1
0
 public function action_delete()
 {
     $this->template->title = 'Remove a gift';
     $this->template->subtitle = 'Confirm you want to remove this gift from your list';
     $gift_id = $this->request->param('id');
     $gift = new Model_Gift($gift_id);
     $this->redirect_if_not_owner();
     $list_id = $gift->list->id;
     if (arr::get($_POST, 'delete')) {
         $gift->delete();
         Message::add('success', Kohana::message('gift', 'deleted'));
         Request::current()->redirect('list/mine/' . $list_id);
     }
     $view = View::factory('gift/delete');
     $view->gift = $gift;
     $this->template->content = $view;
 }