Completed
Push — master ( 9b78f7...5dcb4f )
by Andreas
08:15 queued 03:39
created

MediaManager   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 23
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 18 2
1
<?php
2
3
namespace dokuwiki\Menu\Item;
4
5
/**
6
 * Class MediaManager
7
 *
8
 * Opens the current image in the media manager. Used on image detail view.
9
 */
10
class 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->type = 'mediaManager';
25
        $this->params = array(
26
            'ns' => $imgNS,
27
            'image' => $IMG,
28
            'do' => 'media'
29
        );
30
    }
31
32
}
33