File modules/cms/action/folder/FolderCreateurlAction.class.php
Last commit: Sat Mar 6 03:42:38 2021 +0100 Jan Dankert New: Better permission checks.
1 <?php 2 namespace cms\action\folder; 3 use cms\action\FolderAction; 4 use cms\action\Method; 5 use cms\model\BaseObject; 6 use cms\model\Permission; 7 use cms\model\Url; 8 use language\Messages; 9 10 11 class FolderCreateurlAction extends FolderAction implements Method { 12 public function getRequiredPermission() { 13 return Permission::ACL_CREATE_LINK; // todo maybe we need a special permission flag for this? 14 } 15 16 public function view() { 17 } 18 public function post() { 19 $description = $this->request->getText('description'); 20 $filename = $this->request->getText('filename' ); 21 $name = $this->request->getText('name' ); 22 23 $url = new Url(); 24 $url->filename = BaseObject::urlify( $name ); 25 $url->parentid = $this->folder->objectid; 26 $url->projectid = $this->folder->projectid; 27 28 $url->url = $this->request->getText('url'); 29 30 $url->persist(); 31 $url->setNameForAllLanguages( $name,$description ); 32 33 $this->addNoticeFor( $url, Messages::ADDED ); 34 $this->setTemplateVar('objectid',$url->objectid); 35 36 $this->folder->setTimestamp(); 37 } 38 }
Downloadmodules/cms/action/folder/FolderCreateurlAction.class.php
History Sat, 6 Mar 2021 03:42:38 +0100 Jan Dankert New: Better permission checks. Fri, 26 Feb 2021 01:06:01 +0100 Jan Dankert Refactoring accessing the request parameter values. Wed, 18 Nov 2020 01:46:36 +0100 Jan Dankert Refactoring of model classes: New method persist() and some other cleanups. Tue, 17 Nov 2020 23:51:00 +0100 Jan Dankert Refactoring: Every Actionmethod has now its own class.