1<?php
2
3/**
4 * Image detail page
5 *
6 * See "detail.php" if you don't know how this is getting included within the
7 * "main.php".
8 *
9 * NOTE: Based on the detail.php out of the "starter" template by Anika Henke.
10 *
11 *
12 * LICENSE: This file is open source software (OSS) and may be copied under
13 *          certain conditions. See COPYING file for details or try to contact
14 *          the author(s) of this file in doubt.
15 *
16 * @license GPLv2 (http://www.gnu.org/licenses/gpl2.html)
17 * @author ARSAVA <dokuwiki@dev.arsava.com>
18 * @link https://www.dokuwiki.org/template:vector
19 * @link https://www.dokuwiki.org/devel:templates
20 */
21
22//check if we are running within the DokuWiki environment
23if (!defined("DOKU_INC")){
24    die();
25}
26?>
27
28<div id="dokuwiki__detail" class="container py-4">
29    <?php html_msgarea() ?>
30
31    <?php if($ERROR){ print $ERROR; }else{ ?>
32        <div class="card">
33            <div class="card-body">
34                <h1 class="card-title"><?php echo hsc(tpl_img_getTag('IPTC.Headline',$IMG))?></h1>
35
36                <div class="content">
37                    <div class="text-center mb-4">
38                        <?php tpl_img(900,700); ?>
39                    </div>
40
41                    <div class="img_detail">
42                        <h2><?php print nl2br(hsc(tpl_img_getTag('simple.title'))); ?></h2>
43
44                        <dl class="row">
45                            <?php
46                                $config_files = getConfigFiles('mediameta');
47                                foreach ($config_files as $config_file) {
48                                    if(@file_exists($config_file)) {
49                                        include($config_file);
50                                    }
51                                }
52
53                                foreach($fields as $key => $tag){
54                                    $t = array();
55                                    if (!empty($tag[0])) {
56                                        $t = array($tag[0]);
57                                    }
58                                    if(is_array($tag[3])) {
59                                        $t = array_merge($t,$tag[3]);
60                                    }
61                                    $value = tpl_img_getTag($t);
62                                    if ($value) {
63                                        echo '<dt class="col-sm-3">'.$lang[$tag[1]].':</dt><dd class="col-sm-9">';
64                                        if ($tag[2] == 'date') {
65                                            echo dformat($value);
66                                        } else {
67                                            echo hsc($value);
68                                        }
69                                        echo '</dd>';
70                                    }
71                                }
72
73                                $t_array = media_inuse(tpl_img_getTag('IPTC.File.Name',$IMG));
74                                if (isset($t_array[0])) {
75                                    echo '<dt class="col-sm-3">'.$lang['reference'].':</dt>';
76                                    foreach ($t_array as $t) {
77                                        echo '<dd class="col-sm-9">'.html_wikilink($t,$t).'</dd>';
78                                    }
79                                }
80                            ?>
81                        </dl>
82                    </div>
83                </div>
84
85                <div class="mt-4">
86                    <a href="<?php echo wl($ID)?>" class="btn btn-primary">
87                        &larr; <?php echo $lang['img_backto']?> <?php tpl_pagetitle()?>
88                    </a>
89                </div>
90            </div>
91        </div>
92    <?php } ?>
93</div>
94
95