Completed
Push — svgpagetools ( 17ef2a...7c844e )
by Andreas
04:40
created

MediaManager::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 16
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 11
nc 2
nop 0
dl 0
loc 16
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace dokuwiki\Menu\Item;
4
5
class MediaManager extends AbstractItem {
6
7
    protected $svg = DOKU_INC . 'lib/images/menu/11-mediamanager_folder-image.svg';
8
9
    /** @inheritdoc */
10
    public function __construct() {
11
        parent::__construct();
12
13
        // View image in media manager
14
        global $IMG;
15
        $imgNS = getNS($IMG);
16
        $authNS = auth_quickaclcheck("$imgNS:*");
17
        if($authNS < AUTH_UPLOAD) {
18
            throw new \RuntimeException("media manager link only with upload permissions");
19
        }
20
        $this->params = array(
21
            'ns' => $imgNS,
22
            'image' => $IMG,
23
            'do' => 'media'
24
        );
25
    }
26
27
}
28