1<?php
2/**
3 * DokuWiki Hacker Template: Image Detail Page
4 *
5 * @link     https://www.dokuwiki.org/template:hacker.css
6 * @author   Lionel PLAIS <lionel.plais@ilp-web.net>
7 * @license  MIT License (https://opensource.org/license/MIT)
8 */
9
10// Must be run within DokuWiki
11if (!defined('DOKU_INC')) die();
12
13// Include hook for template functions
14@require_once(dirname(__FILE__) . '/tpl_functions.php');
15?>
16<!DOCTYPE html>
17<html
18	xmlns="http://www.w3.org/1999/xhtml"
19	xml:lang="<?php echo $conf['lang'] ?>"
20	lang="<?php echo $conf['lang'] ?>"
21	dir="<?php echo $lang['direction'] ?>"
22	class="no-js">
23<head>
24	<meta charset="UTF-8" />
25	<title>
26		<?php
27			echo hsc(tpl_img_getTag('IPTC.Headline', $IMG));
28		?>
29		[<?php
30			echo strip_tags($conf['title']);
31			?>]
32	</title>
33	<script>
34		(function(H) {
35			H.className = H.className.replace(/\bno-js\b/, 'js')
36		})(
37			document.documentElement
38		);
39	</script>
40	<?php
41		tpl_metaheaders();
42		_tpl_font_headers();
43	?>
44	<meta name="viewport" content="width=device-width,initial-scale=1" />
45	<?php
46		$favicon = tpl_favicon(array(
47			'favicon',
48			'mobile'
49		));
50		echo $favicon;
51	?>
52	<?php tpl_includeFile('meta.html') ?>
53</head>
54
55<body>
56	<!-- DETAIL -->
57	<div id="dokuwiki__detail" class="<?php echo tpl_classes(); ?>">
58		<?php
59			html_msgarea();
60		?>
61
62		<?php
63			if ($ERROR):
64				print $ERROR;
65			else:
66		?>
67
68			<!-- CONTENT -->
69			<main class="content group">
70				<?php
71					if ($REV) echo p_locale_xhtml('showrev');
72				?>
73				<h1>
74					<?php
75						echo hsc(tpl_img_getTag('IPTC.Headline', $IMG));
76					?>
77				</h1>
78
79				<?php
80					/* the image; parameters: maximum width, maximum height (and more) */
81					tpl_img(900, 700);
82				?>
83
84				<div class="img_detail">
85					<h2>
86						<?php
87							print nl2br(hsc(tpl_img_getTag('simple.title')));
88						?>
89					</h2>
90
91					<?php
92						if (function_exists('tpl_img_meta')):
93							tpl_img_meta();
94						else:
95					?>
96						<dl>
97							<?php
98								$config_files = getConfigFiles('mediameta');
99
100								foreach ($config_files as $config_file) {
101									if (@file_exists($config_file)) {
102										include($config_file);
103									}
104								}
105
106								foreach ($fields as $key   => $tag) {
107									$t = array();
108
109									if (!empty($tag[0])) {
110										$t     = array(
111											$tag[0]
112										);
113									}
114
115									if (is_array($tag[3])) {
116										$t     = array_merge($t, $tag[3]);
117									}
118
119									$value = tpl_img_getTag($t);
120									if ($value) {
121										echo '<dt>' . $lang[$tag[1]] . ':</dt><dd>';
122
123										if ($tag[2] == 'date') {
124											echo dformat($value);
125										} else {
126											echo hsc($value);
127										}
128
129										echo '</dd>';
130									}
131								}
132							?>
133						</dl>
134					<?php
135						endif;
136					?>
137				</div>
138			</main>
139			<!-- /CONTENT -->
140
141			<nav>
142				<ul>
143					<?php
144						if (file_exists(DOKU_INC . 'inc/Menu/DetailMenu.php')) {
145							echo (new \dokuwiki\Menu\DetailMenu())->getListItems('action ', false);
146						}
147						else {
148							_tpl_detailtools();
149						}
150					?>
151				</ul>
152			</nav>
153
154		<?php
155			// End Error
156			endif;
157		?>
158	</div>
159	<!-- /DETAIL -->
160</body>
161
162</html>