File modules/cms/action/file/FileRemoveAction.class.php
Last commit: Sat Mar 6 03:42:38 2021 +0100 Jan Dankert New: Better permission checks.
1 <?php 2 namespace cms\action\file; 3 use cms\action\FileAction; 4 use cms\action\Method; 5 use cms\model\Permission; 6 use language\Messages; 7 8 9 /** 10 * Removing a file. 11 */ 12 class FileRemoveAction extends FileAction implements Method { 13 14 public function getRequiredPermission() { 15 return Permission::ACL_DELETE; 16 } 17 18 19 public function view() { 20 $this->setTemplateVar( 'name',$this->file->filename ); 21 } 22 23 24 public function post() { 25 26 $this->file->delete(); 27 $this->addNoticeFor( $this->file, Messages::DELETED); 28 } 29 }
Downloadmodules/cms/action/file/FileRemoveAction.class.php
History Sat, 6 Mar 2021 03:42:38 +0100 Jan Dankert New: Better permission checks. Thu, 19 Nov 2020 14:49:58 +0100 Jan Dankert Fix: Action::addNotice() is replaced by Action::addNoticeFor() Tue, 17 Nov 2020 23:51:00 +0100 Jan Dankert Refactoring: Every Actionmethod has now its own class.