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

Last commit: Wed Oct 14 01:46:43 2026 +0200	Jan Dankert	PHP 8: Fix: Method signature must match the interface.
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(): int 13 { 14 return Permission::ACL_CREATE_FOLDER; 15 } 16 17 public function view() { 18 $this->setTemplateVar('objectid' ,$this->folder->objectid ); 19 } 20 21 22 public function post() { 23 $name = $this->request->getText('name'); 24 $description = $this->request->getText('description'); 25 26 $f = new Folder(); 27 $f->projectid = $this->folder->projectid; 28 $f->filename = BaseObject::urlify( $name ); 29 $f->parentid = $this->folder->objectid; 30 31 $f->persist(); 32 $f->setNameForAllLanguages( $name,$description ); 33 34 $this->addNoticeFor($f, Messages::ADDED); 35 // Die neue Folder-Id (wichtig für API-Aufrufe). 36 $this->setTemplateVar('objectid',$f->objectid); 37 38 $this->folder->setTimestamp(); // Zeitstempel setzen. 39 } 40 }
Download modules/cms/action/folder/FolderCreatefolderAction.class.php
History Wed, 14 Oct 2026 01:46:43 +0200 Jan Dankert PHP 8: Fix: Method signature must match the interface. 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.