1 | <?php |
||
7 | class Display |
||
8 | { |
||
9 | /** @var MediaFile */ |
||
10 | protected $mediaFile; |
||
11 | |||
12 | /** @var string should IDs be shown relative to this namespace? Used in search results */ |
||
13 | protected $relativeDisplay = null; |
||
14 | |||
15 | /** @var bool scroll to this file on display? */ |
||
16 | protected $scrollIntoView = false; |
||
17 | |||
18 | /** |
||
19 | * Display constructor. |
||
20 | * @param MediaFile $mediaFile |
||
21 | */ |
||
22 | public function __construct(MediaFile $mediaFile) |
||
26 | |||
27 | /** |
||
28 | * Get the HTML to display a preview image if possible, otherwise show an icon |
||
29 | * |
||
30 | * @param int $w bounding box width to resize pixel based images to |
||
31 | * @param int $h bounding box height to resize pixel based images to |
||
32 | * @return string |
||
33 | */ |
||
34 | public function getPreviewHtml($w, $h) |
||
44 | |||
45 | /** |
||
46 | * Return the URL to the icon for this file |
||
47 | * |
||
48 | * @return string |
||
49 | */ |
||
50 | public function getIconUrl() |
||
56 | |||
57 | /** |
||
58 | * Show IDs relative to this namespace |
||
59 | * |
||
60 | * @param string|null $ns Use null to disable |
||
61 | */ |
||
62 | public function relativeDisplay($ns) |
||
66 | |||
67 | /** |
||
68 | * Scroll to this file on display? |
||
69 | * |
||
70 | * @param bool $set |
||
71 | */ |
||
72 | public function scrollIntoView($set = true) |
||
76 | |||
77 | /** @return string */ |
||
78 | protected function formatDate() |
||
82 | |||
83 | /** |
||
84 | * Output the image dimension if any |
||
85 | * |
||
86 | * @param string $empty what to show when no dimensions are available |
||
87 | * @return string |
||
88 | */ |
||
89 | protected function formatDimensions($empty = ' ') |
||
99 | |||
100 | /** @return string */ |
||
101 | protected function formatFileSize() |
||
105 | |||
106 | /** @return string */ |
||
107 | protected function formatDisplayName() |
||
119 | } |
||
120 |