File modules/cms/action/image/ImagePreviewAction.class.php

Last commit: Sun Feb 13 23:40:54 2022 +0100	dankert	Fix: Missing Preview-Output-Parameter.
1 <?php 2 namespace cms\action\image; 3 use cms\action\ImageAction; 4 use cms\action\Method; 5 use cms\model\Value; 6 use util\exception\SecurityException; 7 use util\Html; 8 9 class ImagePreviewAction extends ImageAction implements Method { 10 11 public function view() { 12 $params = [ 13 'output' => 'preview', 14 ]; 15 16 $valueid = $this->request->getNumber('valueid'); 17 18 if ( $valueid ) { 19 20 $value = new Value(); 21 $value->loadWithId( $valueid ); 22 if ( $value->contentid != $this->image->contentid ) 23 throw new SecurityException('content '.$value->contentid.' does not belong to this file which has content-id '.$this->image->contentid); 24 25 $params[ 'valueid' ] = $valueid; 26 $this->setTemplateVar('lastchange_date', $value->lastchangeTimeStamp); 27 }else { 28 $this->setTemplateVar('lastchange_date', $this->image->lastchangeDate); 29 } 30 31 $this->setTemplateVar('url', Html::url('image','show',$this->image->objectid,$params ) ); 32 } 33 34 35 public function post() { 36 } 37 }
Download modules/cms/action/image/ImagePreviewAction.class.php
History Sun, 13 Feb 2022 23:40:54 +0100 dankert Fix: Missing Preview-Output-Parameter. Mon, 6 Dec 2021 01:00:00 +0100 dankert New: Show a version from file history; New: Text history. Wed, 10 Feb 2021 00:00:21 +0100 Jan Dankert Using only fullscreen views; Navigate to parent instead of complete breadcrumb. Tue, 17 Nov 2020 23:51:00 +0100 Jan Dankert Refactoring: Every Actionmethod has now its own class.