xref: /dokuwiki/inc/Menu/Item/MediaManager.php (revision 4bb2fc4a55c12e16c9272726ea842cce055177a2)
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 . 'lib/images/menu/11-mediamanager_folder-image.svg';
24        $this->params = array(
25            'ns' => $imgNS,
26            'image' => $IMG,
27            'do' => 'media'
28        );
29    }
30
31}
32