1<?php
2
3/**
4 * DokuWiki Image Detail Page
5 *
6 * @author   Andreas Gohr <andi@splitbrain.org>
7 * @author   Anika Henke <anika@selfthinker.org>
8 * @license  GPL 2 (http://www.gnu.org/licenses/gpl.html)
9 */
10
11// must be run from within DokuWiki
12if (!defined('DOKU_INC')) die();
13
14?><!DOCTYPE html>
15<html lang="<?php echo $conf['lang']?>" dir="<?php echo $lang['direction'] ?>" class="no-js">
16<head>
17    <meta charset="utf-8" />
18    <title>
19        <?php echo hsc(tpl_img_getTag('IPTC.Headline', $IMG))?>
20        [<?php echo strip_tags($conf['title'])?>]
21    </title>
22    <?php tpl_metaheaders()?>
23    <meta name="viewport" content="width=device-width,initial-scale=1" />
24    <?php echo tpl_favicon(['favicon', 'mobile']) ?>
25    <?php tpl_includeFile('meta.html') ?>
26</head>
27
28<body>
29    <div id="dokuwiki__site"><div id="dokuwiki__top" class="site <?php echo tpl_classes(); ?>">
30
31        <?php include(__DIR__ . '/tpl_header.php') ?>
32
33        <div class="wrapper group" id="dokuwiki__detail">
34
35            <!-- ********** CONTENT ********** -->
36            <main id="dokuwiki__content"><div class="pad group">
37                <?php html_msgarea() ?>
38
39                <?php if (!$ERROR) : ?>
40                    <div class="pageId"><span><?php echo hsc(tpl_img_getTag('IPTC.Headline', $IMG)); ?></span></div>
41                <?php endif; ?>
42
43                <div class="page group">
44                    <?php tpl_flush() ?>
45                    <?php tpl_includeFile('pageheader.html') ?>
46                    <!-- detail start -->
47                    <?php
48                    if ($ERROR) :
49                        echo '<h1>' . $ERROR . '</h1>';
50                    else : ?>
51                        <?php if ($REV) echo p_locale_xhtml('showrev');?>
52                        <h1><?php echo nl2br(hsc(tpl_img_getTag('simple.title'))); ?></h1>
53
54                        <?php tpl_img(900, 700); /* parameters: maximum width, maximum height (and more) */ ?>
55
56                        <div class="img_detail">
57                            <?php tpl_img_meta(); ?>
58                            <dl>
59                            <?php
60                            echo '<dt>' . $lang['reference'] . ':</dt>';
61                            $media_usage = ft_mediause($IMG, true);
62                            if ($media_usage !== []) {
63                                foreach ($media_usage as $path) {
64                                    echo '<dd>' . html_wikilink($path) . '</dd>';
65                                }
66                            } else {
67                                echo '<dd>' . $lang['nothingfound'] . '</dd>';
68                            }
69                            ?>
70                            </dl>
71                            <p><?php echo $lang['media_acl_warning']; ?></p>
72                        </div>
73                        <?php //Comment in for Debug// dbg(tpl_img_getTag('Simple.Raw'));?>
74                    <?php endif; ?>
75                </div>
76                <!-- detail stop -->
77                <?php tpl_includeFile('pagefooter.html') ?>
78                <?php tpl_flush() ?>
79
80                <?php /* doesn't make sense like this; @todo: maybe add tpl_imginfo()?
81                <div class="docInfo"><?php tpl_pageinfo(); ?></div>
82                */ ?>
83
84            </div></main><!-- /content -->
85
86            <hr class="a11y" />
87
88            <!-- PAGE ACTIONS -->
89            <?php if (!$ERROR) : ?>
90                <nav id="dokuwiki__pagetools" aria-labelledby="dokuwiki__pagetools__heading">
91                    <h3 class="a11y" id="dokuwiki__pagetools__heading"><?php echo $lang['page_tools']; ?></h3>
92                    <div class="tools">
93                        <ul>
94                            <?php echo (new \dokuwiki\Menu\DetailMenu())->getListItems(); ?>
95                        </ul>
96                    </div>
97                </nav>
98            <?php endif; ?>
99        </div><!-- /wrapper -->
100
101        <?php include(__DIR__ . '/tpl_footer.php') ?>
102    </div></div><!-- /site -->
103</body>
104</html>
105