1<?php 2 3namespace dokuwiki\Ui\Media; 4 5use dokuwiki\Media\MediaFile; 6 7/** 8 * Display a MediaFile in the FullScreen MediaManager 9 */ 10class DisplayTile extends Display 11{ 12 /** @var string URL to open this file in the media manager */ 13 protected $mmUrl; 14 15 /** @inheritDoc */ 16 public function __construct(MediaFile $mediaFile) 17 { 18 parent::__construct($mediaFile); 19 20 // FIXME we may want to integrate this function here or in another class 21 $this->mmUrl = media_managerURL([ 22 'image' => $this->mediaFile->getId(), 23 'ns' => getNS($this->mediaFile->getId()), 24 'tab_details' => 'view', 25 ]); 26 } 27 28 /** 29 * Display the tile 30 */ 31 public function show() 32 { 33 echo '<dl title="' . $this->mediaFile->getDisplayName() . '">'; 34 echo '<dt>'; 35 echo '<a id="l_:' . $this->mediaFile->getId() . '" class="image thumb" href="' . $this->mmUrl . '">'; 36 echo $this->getPreviewHtml(90, 90); 37 echo '</a>'; 38 echo '</dt>'; 39 40 echo '<dd class="name">'; 41 echo '<a href="' . $this->mmUrl . '" id="h_:' . $this->mediaFile->getId() . '">' . 42 $this->mediaFile->getDisplayName() . 43 '</a>'; 44 echo '</dd>'; 45 46 echo '<dd class="size">' . $this->formatDimensions() . '</dd>'; 47 echo '<dd class="date">' . $this->formatDate() . '</dd>'; 48 echo '<dd class="filesize">' . $this->formatFileSize() . '</dd>'; 49 50 echo '</dl>'; 51 } 52} 53