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