File modules/cms/action/taglist/TaglistAddAction.class.php

Last commit: Thu Feb 16 22:57:35 2023 +0100	Jan Dankert	New: More functions (adding, deleting) for tags.
1 <?php 2 namespace cms\action\taglist; 3 use cms\action\Action; 4 use cms\action\Method; 5 use cms\action\ProjectlistAction; 6 use cms\action\TaglistAction; 7 use cms\base\Configuration; 8 use cms\model\Element; 9 use cms\model\Folder; 10 use cms\model\Language; 11 use cms\model\Model; 12 use cms\model\Page; 13 use cms\model\PageContent; 14 use cms\model\Permission; 15 use cms\model\Project; 16 use cms\model\Tag; 17 use cms\model\Template; 18 use cms\model\Text; 19 use cms\model\Value; 20 use configuration\Config; 21 use language\Messages; 22 use util\exception\SecurityException; 23 24 class TaglistAddAction extends TaglistAction implements Method { 25 26 public function view() { 27 28 } 29 30 31 /** 32 * Add a new project. 33 */ 34 public function post() { 35 36 $name = $this->request->getRequiredText('name'); 37 38 $tag = new Tag(); 39 $tag->name = $name; 40 $tag->projectid = $this->project->projectid; 41 $tag->persist(); 42 43 $this->addNoticeFor( $tag,Messages::ADDED ); 44 } 45 46 public function checkAccess() 47 { 48 $rootFolder = new Folder( $this->project->getRootObjectId() ); 49 50 if ( ! $rootFolder->hasRight(Permission::ACL_PROP) ) 51 throw new SecurityException(); 52 } 53 }
Download modules/cms/action/taglist/TaglistAddAction.class.php
History Thu, 16 Feb 2023 22:57:35 +0100 Jan Dankert New: More functions (adding, deleting) for tags.