3 use dokuwiki\Extension\Event
;
5 if(!defined('DOKU_INC')) define('DOKU_INC',__DIR__
.'/../../');
6 if(!defined('DOKU_MEDIADETAIL')) define('DOKU_MEDIADETAIL',1);
8 // define all DokuWiki globals here (needed within test requests but also helps to keep track)
9 global $INPUT, $IMG, $ID, $REV, $SRC, $ERROR, $AUTH;
11 require_once(DOKU_INC
.'inc/init.php');
13 $IMG = getID('media');
14 $ID = cleanID($INPUT->str('id'));
15 $REV = $INPUT->int('rev');
17 // this makes some general info available as well as the info about the
19 $INFO = array_merge(pageinfo(),mediainfo());
22 Event
::createAndTrigger('DETAIL_STARTED', $tmp);
25 session_write_close();
28 // check image permissions
29 $AUTH = auth_quickaclcheck($IMG);
30 if($AUTH >= AUTH_READ
){
31 // check if image exists
32 $SRC = mediaFN($IMG,$REV);
33 if(!file_exists($SRC)){
36 $ERROR = 'File not found';
40 $ERROR = p_locale_xhtml('denied');
43 //start output and load template
44 header('Content-Type: text/html; charset=utf-8');
45 include(template('detail.php'));