File modules/cms/action/pageelement/PageelementAdvancedAction.class.php
Last commit: Wed Feb 15 00:22:28 2023 +0100 Jan Dankert Fix: Changing the Longtext format was not possible.
1 <?php 2 namespace cms\action\pageelement; 3 use cms\action\Method; 4 use cms\action\PageelementAction; 5 use cms\model\Element; 6 use cms\model\PageContent; 7 use cms\model\Value; 8 9 class PageelementAdvancedAction extends PageelementAction implements Method { 10 public function view() { 11 12 $this->element->load(); 13 $this->setTemplateVar('name' ,$this->element->label ); 14 $this->setTemplateVar('description',$this->element->desc ); 15 $this->setTemplateVar('elementid' ,$this->element->elementid ); 16 $this->setTemplateVar('type' ,$this->element->getTypeName() ); 17 $this->setTemplateVar('pageelementid',$this->page->objectid.'_'.$this->element->elementid ); 18 $languages = array(); 19 20 foreach ( $this->page->getProject()->getLanguages() as $languageId=>$languageName ) 21 { 22 $pageContent = new PageContent(); 23 $pageContent->pageId = $this->page->pageid; 24 $pageContent->languageid = $languageId; 25 $pageContent->elementId = $this->element->elementid; 26 $pageContent->load(); 27 28 $value = new Value(); 29 $value->contentid = $pageContent->contentId; 30 $value->load(); 31 32 $languages[$languageId] = array( 33 'languageid' => $languageId, 34 'languagename' => $languageName, 35 'text' => $this->calculateValue($value, $this->element->typeid), 36 'number' => $value->number, 37 'date' => $value->date, 38 'linkObjectId' => $value->linkToObjectId, 39 'editors' => Element::getAvailableFormats() 40 ); 41 } 42 43 $this->setTemplateVar('languages',$languages); 44 } 45 public function post() { 46 } 47 }
Downloadmodules/cms/action/pageelement/PageelementAdvancedAction.class.php
History Wed, 15 Feb 2023 00:22:28 +0100 Jan Dankert Fix: Changing the Longtext format was not possible. Sun, 5 Dec 2021 15:33:29 +0100 dankert Cleanup: Removed unusable properties from class 'Value'. Sat, 27 Nov 2021 00:11:56 +0100 Jan Dankert New: History for files and templates. Tue, 17 Nov 2020 23:51:00 +0100 Jan Dankert Refactoring: Every Actionmethod has now its own class.