File modules/cms/action/page/PageEditAction.class.php
Last commit: Fri Mar 11 11:32:38 2022 +0100 dankert New: Edit all languages for a page element.
1 <?php 2 namespace cms\action\page; 3 use cms\action\Method; 4 use cms\action\PageAction; 5 use cms\model\Permission; 6 use cms\model\BaseObject; 7 use cms\model\Element; 8 use cms\model\Folder; 9 use cms\model\Page; 10 use cms\model\Project; 11 use cms\model\Template; 12 use cms\model\Value; 13 14 class PageEditAction extends PageAction implements Method { 15 16 17 public function view() { 18 19 $template = new Template( $this->page->templateid ); 20 $template->load(); 21 22 /** @var Element[] $elements */ 23 $elements = $template->getElements(); 24 25 $elements = array_filter(/** 26 * @param $element Element 27 * @return Element 28 */ $elements, function($element ) { 29 return $element->isWritable(); 30 } ); 31 32 $elements = array_map( function( $element ) { 33 return get_object_vars( $element ) + array('pageelementid'=>$this->page->objectid.'_'.$element->elementid,'typename'=>$element->getTypeName() ); 34 }, $elements); 35 36 $this->setTemplateVar('elements',$elements); 37 38 $project = $this->page->getProject(); 39 $languages = $project->getLanguages(); 40 41 $this->setTemplateVar('languages',$languages); 42 } 43 44 45 46 public function post() { 47 48 } 49 }
Downloadmodules/cms/action/page/PageEditAction.class.php
History Fri, 11 Mar 2022 11:32:38 +0100 dankert New: Edit all languages for a page element. Sun, 5 Dec 2021 20:33:24 +0100 dankert Cleanup: Removed unusable properties from class 'Value' and 'BaseObject'. Wed, 10 Mar 2021 23:51:22 +0100 Jan Dankert Refactoring: Cleaned the Request params. Fri, 26 Feb 2021 01:06:01 +0100 Jan Dankert Refactoring accessing the request parameter values. Thu, 25 Feb 2021 01:22:10 +0100 Jan Dankert New: Edit all page elements in 1 view. Mon, 4 Jan 2021 19:03:18 +0100 Jan Dankert Refactoring: ACL class is renamed to Permission, because most RBAC/DMAC concepts are calling it a permission. Thu, 19 Nov 2020 12:36:44 +0100 Jan Dankert Fix: nextSubAction() is depracated and should not be used. 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.