File modules/cms/action/pageelement/PageelementEditAction.class.php
Last commit: Sun Dec 5 15:33:29 2021 +0100 dankert Cleanup: Removed unusable properties from class 'Value'.
1 <?php 2 namespace cms\action\pageelement; 3 use cms\action\Method; 4 use cms\action\PageelementAction; 5 use cms\model\PageContent; 6 use cms\model\Value; 7 8 class PageelementEditAction extends PageelementAction implements Method { 9 public function view() { 10 11 $this->element->load(); 12 $this->setTemplateVar('name' ,$this->element->label ); 13 $this->setTemplateVar('description',$this->element->desc ); 14 $this->setTemplateVar('elementid' ,$this->element->elementid ); 15 $this->setTemplateVar('type' ,$this->element->getTypeName() ); 16 17 $languages = array(); 18 19 foreach ( $this->page->getProject()->getLanguages() as $languageId=>$languageName ) 20 { 21 $pageContent = new PageContent(); 22 $pageContent->pageId = $this->page->pageid; 23 $pageContent->languageid = $languageId; 24 $pageContent->elementId = $this->element->elementid; 25 $pageContent->load(); 26 27 $value = new Value(); 28 $value->contentid = $pageContent->contentId; 29 $value->load(); 30 31 $languages[$languageId] = array( 32 'languageid' => $languageId, 33 'languagename' => $languageName, 34 'text' => $this->calculateValue($value, $this->element->typeid), 35 'number' => $value->number, 36 'date' => $value->date, 37 'linkObjectId' => $value->linkToObjectId, 38 ); 39 } 40 41 $this->setTemplateVar('languages',$languages); 42 } 43 44 45 public function post() { 46 } 47 }
Downloadmodules/cms/action/pageelement/PageelementEditAction.class.php
History 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.