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/**
11 * MindTheDark theme settings ******************************************************
12 */
13$configUserChoice = tpl_getConf('userChoice');
14$configAutoDark = tpl_getConf('autoDark');
15$theme = tpl_getConf('theme');
16
17if ($configUserChoice) {
18
19    if (isset($_COOKIE["theme"])) {
20        $theme = $_COOKIE["theme"];
21    }
22    else {
23        // If the cookie has never been set and both options are enabled,
24        // then the auto mode will be used until the user makes a choice
25        if ($configAutoDark) {
26            $theme = "auto";
27        }
28        else {
29            $theme = "light";
30        }
31    }
32}
33
34if ($configAutoDark and !$configUserChoice) {
35    $theme = "auto";
36}
37
38// must be run from within DokuWiki
39if (!defined('DOKU_INC')) die();
40header('X-UA-Compatible: IE=edge,chrome=1');
41
42?><!DOCTYPE html>
43<html lang="<?php echo $conf['lang']?>"
44    dir="<?php echo $lang['direction'] ?>"
45    class="no-js"
46    theme="<?php echo $theme ?>">
47
48<head>
49    <meta charset="utf-8" />
50    <title>
51        <?php echo hsc(tpl_img_getTag('IPTC.Headline',$IMG))?>
52        [<?php echo strip_tags($conf['title'])?>]
53    </title>
54    <script>(function(H){H.className=H.className.replace(/\bno-js\b/,'js')})(document.documentElement)</script>
55    <?php tpl_metaheaders()?>
56    <meta name="viewport" content="width=device-width,initial-scale=1" />
57    <meta name="configUserChoice" id="configUserChoice" content="<?php echo $configUserChoice ?>" />
58    <?php echo tpl_favicon(array('favicon', 'mobile')) ?>
59    <?php tpl_includeFile('meta.html') ?>
60</head>
61
62<body>
63    <div id="dokuwiki__site"><div id="dokuwiki__top" class="site <?php echo tpl_classes(); ?>">
64
65        <?php include('tpl_header.php') ?>
66
67        <div class="wrapper group" id="dokuwiki__detail">
68
69            <!-- ********** CONTENT ********** -->
70            <div id="dokuwiki__content"><div class="pad group">
71                <?php html_msgarea() ?>
72
73                <?php if(!$ERROR): ?>
74                    <div class="pageId"><span><?php echo hsc(tpl_img_getTag('IPTC.Headline',$IMG)); ?></span></div>
75                <?php endif; ?>
76
77                <div class="page group">
78                    <?php tpl_flush() ?>
79                    <?php tpl_includeFile('pageheader.html') ?>
80                    <!-- detail start -->
81                    <?php
82                    if($ERROR):
83                        echo '<h1>'.$ERROR.'</h1>';
84                    else: ?>
85                        <?php if($REV) echo p_locale_xhtml('showrev');?>
86                        <h1><?php echo nl2br(hsc(tpl_img_getTag('simple.title'))); ?></h1>
87
88                        <?php tpl_img(900,700); /* parameters: maximum width, maximum height (and more) */ ?>
89
90                        <div class="img_detail">
91                            <?php tpl_img_meta(); ?>
92                            <dl>
93                            <?php
94                            echo '<dt>'.$lang['reference'].':</dt>';
95                            $media_usage = ft_mediause($IMG,true);
96                            if(count($media_usage) > 0){
97                                foreach($media_usage as $path){
98                                    echo '<dd>'.html_wikilink($path).'</dd>';
99                                }
100                            }else{
101                                echo '<dd>'.$lang['nothingfound'].'</dd>';
102                            }
103                            ?>
104                            </dl>
105                            <p><?php echo $lang['media_acl_warning']; ?></p>
106                        </div>
107                        <?php //Comment in for Debug// dbg(tpl_img_getTag('Simple.Raw'));?>
108                    <?php endif; ?>
109                </div>
110                <!-- detail stop -->
111                <?php tpl_includeFile('pagefooter.html') ?>
112                <?php tpl_flush() ?>
113
114                <?php /* doesn't make sense like this; @todo: maybe add tpl_imginfo()?
115                <div class="docInfo"><?php tpl_pageinfo(); ?></div>
116                */ ?>
117
118            </div></div><!-- /content -->
119
120            <hr class="a11y" />
121
122            <!-- PAGE ACTIONS -->
123            <?php if (!$ERROR): ?>
124                <div id="dokuwiki__pagetools">
125                    <h3 class="a11y"><?php echo $lang['page_tools']; ?></h3>
126                    <div class="tools">
127                        <ul>
128                            <?php echo (new \dokuwiki\Menu\DetailMenu())->getListItems(); ?>
129                        </ul>
130                    </div>
131                </div>
132            <?php endif; ?>
133        </div><!-- /wrapper -->
134
135        <?php include('tpl_footer.php') ?>
136    </div></div><!-- /site -->
137</body>
138</html>
139