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();
12header('X-UA-Compatible: IE=edge,chrome=1');
13
14$showSidebar = page_findnearest($conf['sidebar']) && ($ACT=='show');
15?><!DOCTYPE html>
16<html lang="<?php echo $conf['lang']?>" dir="<?php echo $lang['direction'] ?>" class="no-js">
17<head>
18    <meta charset="utf-8" />
19    <title>
20        <?php echo hsc(tpl_img_getTag('IPTC.Headline',$IMG))?>
21        [<?php echo strip_tags($conf['title'])?>]
22    </title>
23    <script>(function(H){H.className=H.className.replace(/\bno-js\b/,'js')})(document.documentElement)</script>
24    <?php tpl_metaheaders()?>
25    <meta name="viewport" content="width=device-width,initial-scale=1" />
26    <?php echo tpl_favicon(array('favicon', 'mobile')) ?>
27    <?php tpl_includeFile('meta.html') ?>
28</head>
29
30<body>
31    <div class="wrapper">
32      <script>console.log(<?php
33        echo json_encode($conf['sidebar']);
34      ?>);</script>
35        <?php
36            // render the content into buffer for later use
37            ob_start();
38            tpl_content(false);
39            $buffer = ob_get_clean();
40        ?>
41        <?php include('tpl_header.php') ?>
42
43        <div class="wrapper-content">
44            <div class="sidebar fl">
45                <aside class="sidebar-aside">
46                    <?php if(!$ERROR): ?>
47                      <h3 class="sidebar-title"><?php echo nl2br(hsc(tpl_img_getTag('simple.title'))); ?></h3>
48                    <?php endif; ?>
49
50                    <div class="sidebar-breadcrumbs">
51                        <?php if($conf['breadcrumbs'] || $conf['youarehere']): ?>
52                            <div class="breadcrumbs">
53                                <?php if($conf['youarehere']): ?>
54                                    <div class="youarehere"><?php tpl_youarehere() ?></div>
55                                <?php endif ?>
56                                <?php if($conf['breadcrumbs']): ?>
57                                    <div class="trace"><?php tpl_breadcrumbs() ?></div>
58                                <?php endif ?>
59                            </div>
60                        <?php endif ?>
61                    </div>
62                    <div class="sidebar-page">
63                      <?php if ($showSidebar): ?>
64                        <?php tpl_includeFile('sidebarheader.html') ?>
65                        <?php tpl_include_page($conf['sidebar'], 1, 1) /* includes the nearest sidebar page */ ?>
66                        <?php tpl_includeFile('sidebarfooter.html') ?>
67                      <?php endif; ?>
68                    </div>
69                </aside>
70            </div>
71            <div class="main fr">
72                <div class="detail-wrapper">
73                    <?php tpl_flush() ?>
74                    <?php
75                    if($ERROR):
76                        echo '<h1>'.$ERROR.'</h1>';
77                    else: ?>
78                        <?php if($REV) echo p_locale_xhtml('showrev');?>
79                        <h2><?php echo hsc(tpl_img_getTag('IPTC.Headline',$IMG)); ?></h2>
80
81                        <div class="detail-img">
82                          <?php tpl_img(); /* parameters: maximum width, maximum height (and more) */ ?>
83                        </div>
84
85                        <div class="detail-meta">
86                            <?php tpl_img_meta(); ?>
87                        </div>
88                        <?php //Comment in for Debug// dbg(tpl_img_getTag('Simple.Raw'));?>
89                    <?php endif; ?>
90                </div>
91
92                <!-- PAGE ACTIONS -->
93                <?php if (!$ERROR): ?>
94                    <ul class="detail-tools">
95                        <?php
96                            $data = array(
97                                'view' => 'detail',
98                                'items' => array(
99                                    'mediaManager' => tpl_action('mediaManager', 1, 'li', 1),
100                                    'img_backto' =>   tpl_action('img_backto', 1, 'li', 1)
101                                )
102                            );
103
104                            // the page tools can be amended through a custom plugin hook
105                            $evt = new Doku_Event('TEMPLATE_PAGETOOLS_DISPLAY', $data);
106                            if($evt->advise_before()) {
107                                foreach($evt->data['items'] as $k => $html) echo $html;
108                            }
109                            $evt->advise_after();
110                            unset($data);
111                            unset($evt);
112                        ?>
113                    </ul>
114                <?php endif; ?>
115            </div>
116        </div>
117    </div>
118
119    <?php include('tpl_footer.php') ?>
120    <!--[if ( lte IE 7 | IE 8 ) ]></div><![endif]-->
121</body>
122</html>
123