1<?php
2/**
3 * DokuWiki Image Detail Page
4 *
5 * @author   Andreas Gohr <andi@splitbrain.org>
6 * @author   Anika Henke <anika@selfthinker.org>
7 * @license  GPL 2 (http://www.gnu.org/licenses/gpl.html)
8 */
9
10// must be run from within DokuWiki
11if (!defined('DOKU_INC')) die();
12
13?><!DOCTYPE html>
14<html lang="<?php echo $conf['lang']?>" dir="<?php echo $lang['direction'] ?>" class="no-js">
15<head>
16    <meta charset="utf-8" />
17    <!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /><![endif]-->
18    <title>
19        <?php echo hsc(tpl_img_getTag('IPTC.Headline',$IMG))?>
20        [<?php echo strip_tags($conf['title'])?>]
21    </title>
22    <script>(function(H){H.className=H.className.replace(/\bno-js\b/,'js')})(document.documentElement)</script>
23    <?php tpl_metaheaders()?>
24    <meta name="viewport" content="width=device-width,initial-scale=1" />
25    <?php echo tpl_favicon(array('favicon', 'mobile')) ?>
26    <?php tpl_includeFile('meta.html') ?>
27</head>
28
29<body>
30    <!--[if lte IE 7 ]><div id="IE7"><![endif]--><!--[if IE 8 ]><div id="IE8"><![endif]-->
31    <div id="dokuwiki__site"><div id="dokuwiki__top"
32        class="dokuwiki site mode_<?php echo $ACT ?>">
33
34        <?php include('tpl_header.php') ?>
35
36        <div class="wrapper group" id="dokuwiki__detail">
37
38            <!-- ********** CONTENT ********** -->
39            <div id="dokuwiki__content"><div class="pad group">
40
41                <?php if(!$ERROR): ?>
42                    <div class="pageId"><span><?php echo hsc(tpl_img_getTag('IPTC.Headline',$IMG)); ?></span></div>
43                <?php endif; ?>
44
45                <div class="page group">
46                    <?php tpl_flush() ?>
47                    <?php tpl_includeFile('pageheader.html') ?>
48                    <!-- detail start -->
49                    <?php
50                    if($ERROR):
51                        echo '<h1>'.$ERROR.'</h1>';
52                    else: ?>
53
54                        <h1><?php echo nl2br(hsc(tpl_img_getTag('simple.title'))); ?></h1>
55
56                        <?php tpl_img(900,700); /* parameters: maximum width, maximum height (and more) */ ?>
57
58                        <div class="img_detail">
59                            <dl>
60                                <?php
61                                    // @todo: logic should be transferred to backend
62                                    $config_files = getConfigFiles('mediameta');
63                                    foreach ($config_files as $config_file) {
64                                        if(@file_exists($config_file)) {
65                                            include($config_file);
66                                        }
67                                    }
68
69                                    foreach($fields as $key => $tag){
70                                        $t = array();
71                                        if (!empty($tag[0])) {
72                                            $t = array($tag[0]);
73                                        }
74                                        if(array_key_exists(3, $tag) && is_array($tag[3])) {
75                                            $t = array_merge($t,$tag[3]);
76                                        }
77                                        $value = tpl_img_getTag($t);
78                                        if ($value) {
79                                            echo '<dt>'.$lang[$tag[1]].':</dt><dd>';
80                                            if ($tag[2] == 'date') {
81                                                echo dformat($value);
82                                            } else {
83                                                echo hsc($value);
84                                            }
85                                            echo '</dd>';
86                                        }
87                                    }
88                                ?>
89                            </dl>
90                        </div>
91                        <?php //Comment in for Debug// dbg(tpl_img_getTag('Simple.Raw'));?>
92                    <?php endif; ?>
93                </div>
94                <!-- detail stop -->
95                <?php tpl_includeFile('pagefooter.html') ?>
96                <?php tpl_flush() ?>
97
98                <?php /* doesn't make sense like this; @todo: maybe add tpl_imginfo()?
99                <div class="docInfo"><?php tpl_pageinfo(); ?></div>
100                */ ?>
101
102            </div></div><!-- /content -->
103
104            <hr class="a11y" />
105
106            <!-- PAGE ACTIONS -->
107            <?php if (!$ERROR): ?>
108                <div id="dokuwiki__pagetools">
109                    <h3 class="a11y"><?php echo $lang['page_tools']; ?></h3>
110                    <div class="tools">
111                        <ul>
112                            <?php // View in media manager; @todo: transfer logic to backend
113                                $imgNS = getNS($IMG);
114                                $authNS = auth_quickaclcheck("$imgNS:*");
115                                if (($authNS >= AUTH_UPLOAD) && function_exists('media_managerURL')) {
116                                    $mmURL = media_managerURL(array('ns' => $imgNS, 'image' => $IMG));
117                                    echo '<li><a href="'.$mmURL.'" class="mediaManager"><span>'.$lang['btn_media'].'</span></a></li>';
118                                }
119                            ?>
120                            <?php // Back to [ID]; @todo: transfer logic to backend
121                                echo '<li><a href="'.wl($ID).'" class="back"><span>'.$lang['btn_img_backto'].' '.$ID.'</span></a></li>';
122                            ?>
123                        </ul>
124                    </div>
125                </div>
126            <?php endif; ?>
127        </div><!-- /wrapper -->
128
129        <?php include('tpl_footer.php') ?>
130    </div></div><!-- /site -->
131
132    <!--[if ( lte IE 7 | IE 8 ) ]></div><![endif]-->
133</body>
134</html>
135