1<?php
2
3namespace dokuwiki\Menu\Item;
4
5/**
6 * Class MediaManager
7 *
8 * Opens the current image in the media manager. Used on image detail view.
9 */
10class MediaManager extends AbstractItem {
11
12    /** @inheritdoc */
13    public function __construct() {
14        global $IMG;
15        parent::__construct();
16
17        $imgNS = getNS($IMG);
18        $authNS = auth_quickaclcheck("$imgNS:*");
19        if($authNS < AUTH_UPLOAD) {
20            throw new \RuntimeException("media manager link only with upload permissions");
21        }
22
23        $this->svg = DOKU_INC_COMPAT . 'lib/images/menu/11-mediamanager_folder-image.svg';
24        $this->type = 'mediaManager';
25        $this->params = array(
26            'ns' => $imgNS,
27            'image' => $IMG,
28            'do' => 'media'
29        );
30    }
31
32}
33