File modules/cms/action/folder/FolderCreatefolderAction.class.php

Last commit: Sun Dec 5 20:33:24 2021 +0100	dankert	Cleanup: Removed unusable properties from class 'Value' and 'BaseObject'.
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\Folder; 7 use cms\model\Permission; 8 use language\Messages; 9 10 11 class FolderCreatefolderAction extends FolderAction implements Method { 12 public function getRequiredPermission() { 13 return Permission::ACL_CREATE_FOLDER; 14 } 15 16 public function view() { 17 $this->setTemplateVar('objectid' ,$this->folder->objectid ); 18 } 19 20 21 public function post() { 22 $name = $this->request->getText('name'); 23 $description = $this->request->getText('description'); 24 25 $f = new Folder(); 26 $f->projectid = $this->folder->projectid; 27 $f->filename = BaseObject::urlify( $name ); 28 $f->parentid = $this->folder->objectid; 29 30 $f->persist(); 31 $f->setNameForAllLanguages( $name,$description ); 32 33 $this->addNoticeFor($f, Messages::ADDED); 34 // Die neue Folder-Id (wichtig für API-Aufrufe). 35 $this->setTemplateVar('objectid',$f->objectid); 36 37 $this->folder->setTimestamp(); // Zeitstempel setzen. 38 } 39 }
Download modules/cms/action/folder/FolderCreatefolderAction.class.php
History Sun, 5 Dec 2021 20:33:24 +0100 dankert Cleanup: Removed unusable properties from class 'Value' and 'BaseObject'. 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.