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 | /** |
||
16 | * Display constructor. |
||
17 | * @param MediaFile $mediaFile |
||
18 | */ |
||
19 | public function __construct(MediaFile $mediaFile) |
||
23 | |||
24 | /** |
||
25 | * Get the HTML to display a preview image if possible, otherwise show an icon |
||
26 | * |
||
27 | * @param int $w bounding box width to resize pixel based images to |
||
28 | * @param int $h bounding box height to resize pixel based images to |
||
29 | * @return string |
||
30 | */ |
||
31 | public function getPreviewHtml($w, $h) |
||
41 | |||
42 | /** |
||
43 | * Return the URL to the icon for this file |
||
44 | * |
||
45 | * @return string |
||
46 | */ |
||
47 | public function getIconUrl() |
||
53 | |||
54 | /** |
||
55 | * Show IDs relative to this namespace |
||
56 | * |
||
57 | * @param string|null $ns Use null to disable |
||
58 | */ |
||
59 | public function relativeDisplay($ns) |
||
63 | |||
64 | /** @return string */ |
||
65 | protected function formatDate() |
||
69 | |||
70 | /** |
||
71 | * Output the image dimension if any |
||
72 | * |
||
73 | * @param string $empty what to show when no dimensions are available |
||
74 | * @return string |
||
75 | */ |
||
76 | protected function formatDimensions($empty = ' ') |
||
86 | |||
87 | /** @return string */ |
||
88 | protected function formatFileSize() |
||
92 | |||
93 | /** @return string */ |
||
94 | protected function formatDisplayName() |
||
106 | } |
||
107 |