xref: /dokuwiki/inc/Menu/Item/MediaManager.php (revision ab9790ca81397622fcfd58faf56a69b68bd36257)
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
13    /** @inheritdoc */
14    public function __construct()
15    {
16        global $IMG;
17        parent::__construct();
18
19        $imgNS = getNS($IMG);
20        $authNS = auth_quickaclcheck("$imgNS:*");
21        if ($authNS < AUTH_UPLOAD) {
22            throw new \RuntimeException("media manager link only with upload permissions");
23        }
24
25        $this->svg = DOKU_INC . 'lib/images/menu/11-mediamanager_folder-image.svg';
26        $this->type = 'mediaManager';
27        $this->params = ['ns' => $imgNS, 'image' => $IMG, 'do' => 'media'];
28    }
29
30}
31