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:monobook
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="dokuwiki">
29        <?php html_msgarea() ?>
30
31        <?php if($ERROR){ print $ERROR; }else{ ?>
32
33            <h1><?php echo hsc(tpl_img_getTag('IPTC.Headline',$IMG))?></h1>
34
35            <div class="content">
36                <?php tpl_img(900,700); /* parameters: maximum width, maximum height (and more) */ ?>
37
38                <div class="img_detail">
39                    <h2><?php print nl2br(hsc(tpl_img_getTag('simple.title'))); ?></h2>
40
41                    <dl>
42                        <?php
43                            $config_files = getConfigFiles('mediameta');
44                            foreach ($config_files as $config_file) {
45                                if(@file_exists($config_file)) {
46                                    include($config_file);
47                                }
48                            }
49
50                            foreach($fields as $key => $tag){
51                                $t = array();
52                                if (!empty($tag[0])) {
53                                    $t = array($tag[0]);
54                                }
55                                if(is_array($tag[3])) {
56                                    $t = array_merge($t,$tag[3]);
57                                }
58                                $value = tpl_img_getTag($t);
59                                if ($value) {
60                                    echo '<dt>'.$lang[$tag[1]].':</dt><dd>';
61                                    if ($tag[2] == 'date') {
62                                        echo dformat($value);
63                                    } else {
64                                        echo hsc($value);
65                                    }
66                                    echo '</dd>';
67                                }
68                            }
69
70                            $t_array = media_inuse(tpl_img_getTag('IPTC.File.Name',$IMG));
71                            if (isset($t_array[0])) {
72                                echo '<dt>'.$lang['reference'].':</dt>';
73                                foreach ($t_array as $t) {
74                                    echo '<dd>'.html_wikilink($t,$t).'</dd>';
75                                }
76                            }
77                        ?>
78                    </dl>
79                    <?php //Comment in for Debug// dbg(tpl_img_getTag('Simple.Raw'));?>
80                </div>
81                <div class="clearer"></div>
82            </div><!-- /.content -->
83
84            <p class="back">
85                <?php
86                    $imgNS = getNS($IMG);
87                    $authNS = auth_quickaclcheck("$imgNS:*");
88                    if (($authNS >= AUTH_UPLOAD) && function_exists('media_managerURL')) {
89                        $mmURL = media_managerURL(array('ns' => $imgNS, 'image' => $IMG));
90                        echo '<a href="'.$mmURL.'">'.$lang['img_manager'].'</a><br />';
91                    }
92                ?>
93                &larr; <?php echo $lang['img_backto']?> <?php tpl_pagelink($ID)?>
94            </p>
95
96        <?php } ?>
97    </div>
98
99