Exemple #1
0
 public function action_imgedit()
 {
     $file = ORM::factory('file', $this->request->param('id'));
     if (!$file->loaded()) {
         notes::add('error', 'Filen blev ikke fundet!');
         cms::redirect('files');
     }
     $this->load_css('media/libs/jcrop/css/jquery.Jcrop.min.css');
     $this->load_script('media/libs/jcrop/js/jquery.Jcrop.min.js');
     $this->bind('file', $file);
 }
 public function action_delete()
 {
     $content = ORM::factory('Content', $this->request->param('id'));
     if (!$content->loaded()) {
         notes::error('Indholdet blev ikke fundet. Er det allerede blevet slettet?');
         cms::redirect('');
     }
     try {
         $type = $content->contenttype_id;
         $content->delete();
         cms::redirect('content/index/' . $type);
     } catch (HTTP_Exception_Redirect $e) {
         throw $e;
     } catch (exception $e) {
         notes::error('Der opstod en fejl og indholdet kunne ikke slettes: ' . $e->getMessage());
         cms::redirect('content/index/' . $content->id);
     }
 }