xref: /template/wikiweko/inc_detail.php (revision c2aea3328dc2a24248d4bc21bcbf801642e1107c)
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 Andreas Haerter <ah@bitkollektiv.org>
18 * @link http://www.dokuwiki.org/template:vector
19 * @link http://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    					    $t_array = media_inuse(tpl_img_getTag('IPTC.File.Name',$IMG));
70							if(isset($t_array[0])) echo '<dt>'.$lang['reference'].':</dt>';
71							foreach($t_array as $t){
72								echo '<dd>'.html_wikilink($t,$t).'</dd>';
73                        ?>
74                    </dl>
75                    <?php //Comment in for Debug// dbg(tpl_img_getTag('Simple.Raw'));?>
76                </div>
77                <div class="clearer"></div>
78            </div><!-- /.content -->
79
80            <p class="back">
81                <?php
82                    $imgNS = getNS($IMG);
83                    $authNS = auth_quickaclcheck("$imgNS:*");
84                    if (($authNS >= AUTH_UPLOAD) && function_exists('media_managerURL')) {
85                        $mmURL = media_managerURL(array('ns' => $imgNS, 'image' => $IMG));
86                        echo '<a href="'.$mmURL.'">'.$lang['img_manager'].'</a><br />';
87                    }
88                ?>
89                &larr; <?php echo $lang['img_backto']?> <?php tpl_pagelink($ID)?>
90            </p>
91
92        <?php } ?>
93    </div>
94
95