File modules/cms/generator/FileHistoryGenerator.class.php

Last commit: Sun Feb 13 20:14:39 2022 +0100	dankert	Refactoring: removed duplicate code, use inheritance ;)
1 <?php 2 3 4 namespace cms\generator; 5 6 7 use cms\generator\filter\AbstractFilter; 8 use cms\model\File; 9 use cms\model\Value; 10 use logger\Logger; 11 use util\exception\GeneratorException; 12 13 class FileHistoryGenerator extends FileGenerator 14 { 15 /** 16 * @param $fileContext FileHistoryContext 17 */ 18 public function __construct($fileContext ) 19 { 20 parent::__construct( $fileContext ); 21 } 22 23 24 /** 25 * Generate value in the wished version. 26 * @return string 27 */ 28 protected function generate() 29 { 30 $value = new Value(); 31 $value->loadWithId( $this->context->valueId); 32 33 return $value->file; // Should we filter here? 34 } 35 36 37 /** 38 * Not useful: FileHistory will only be used in the preview. 39 * @return null 40 */ 41 public function getPublicFilename() 42 { 43 return null; 44 } 45 }
Download modules/cms/generator/FileHistoryGenerator.class.php
History Sun, 13 Feb 2022 20:14:39 +0100 dankert Refactoring: removed duplicate code, use inheritance ;) Mon, 6 Dec 2021 01:00:00 +0100 dankert New: Show a version from file history; New: Text history.