File modules/cms/action/file/FileHistoryAction.class.php
Last commit: Sat Nov 27 00:11:56 2021 +0100 Jan Dankert New: History for files and templates.
1 <?php 2 namespace cms\action\file; 3 use cms\action\FileAction; 4 use cms\action\Method; 5 use cms\model\Content; 6 use cms\model\Project; 7 use cms\model\Value; 8 9 10 class FileHistoryAction extends FileAction implements Method { 11 12 public function view() { 13 14 $project = new Project( $this->file->projectid ); 15 $values = []; 16 17 /** @var Content */ 18 $content = new Content( $this->file->contentid ); 19 20 foreach( $content->getVersionList() as $valueId ) { 21 22 $value = new Value(); 23 $value->loadWithId( $valueId ); 24 25 $values[] = [ 26 'text' => '', 27 'active' => $value->active, 28 'publish' => $value->publish, 29 'user' => $value->lastchangeUserName, 30 'date' => $value->lastchangeTimeStamp, 31 'id' => $value->getId(), 32 'usable' => ! $value->active, 33 'releasable' => $value->active && ! $value->publish, 34 'comparable' => false, 35 ]; 36 } 37 38 $this->setTemplateVar('values',$values ); 39 } 40 41 public function post() 42 { 43 } 44 }
Downloadmodules/cms/action/file/FileHistoryAction.class.php
History Sat, 27 Nov 2021 00:11:56 +0100 Jan Dankert New: History for files and templates.