xref: /dokuwiki/inc/Menu/Item/MediaManager.php (revision 368ce258641a4e8fae6b2e49c89f173d7e3ada69)
193b8c351SAndreas Gohr<?php
293b8c351SAndreas Gohr
393b8c351SAndreas Gohrnamespace dokuwiki\Menu\Item;
493b8c351SAndreas Gohr
5*368ce258SAndreas Gohr/**
6*368ce258SAndreas Gohr * Class MediaManager
7*368ce258SAndreas Gohr *
8*368ce258SAndreas Gohr * Opens the current image in the media manager. Used on image detail view.
9*368ce258SAndreas Gohr */
1093b8c351SAndreas Gohrclass MediaManager extends AbstractItem {
1193b8c351SAndreas Gohr
12c2b9771aSAndreas Gohr    protected $svg = DOKU_INC . 'lib/images/menu/11-mediamanager_folder-image.svg';
1393b8c351SAndreas Gohr
1493b8c351SAndreas Gohr    /** @inheritdoc */
1593b8c351SAndreas Gohr    public function __construct() {
168c51da59SAndreas Gohr        global $IMG;
1793b8c351SAndreas Gohr        parent::__construct();
1893b8c351SAndreas Gohr
1993b8c351SAndreas Gohr        $imgNS = getNS($IMG);
2093b8c351SAndreas Gohr        $authNS = auth_quickaclcheck("$imgNS:*");
2193b8c351SAndreas Gohr        if($authNS < AUTH_UPLOAD) {
2293b8c351SAndreas Gohr            throw new \RuntimeException("media manager link only with upload permissions");
2393b8c351SAndreas Gohr        }
2493b8c351SAndreas Gohr        $this->params = array(
2593b8c351SAndreas Gohr            'ns' => $imgNS,
2693b8c351SAndreas Gohr            'image' => $IMG,
2793b8c351SAndreas Gohr            'do' => 'media'
2893b8c351SAndreas Gohr        );
2993b8c351SAndreas Gohr    }
3093b8c351SAndreas Gohr
3193b8c351SAndreas Gohr}
32