Completed
Push — adminEvent ( 4f32ee...32adf5 )
by Andreas
19:59 queued 14:26
created

Admin::visibleInContext()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 1
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace dokuwiki\Menu\Item;
4
5
/**
6
 * Class Admin
7
 *
8
 * Opens the Admin screen. Only shown to managers or above
9
 */
10
class Admin extends AbstractItem {
11
12
    /** @inheritdoc */
13
    public function __construct() {
14
        parent::__construct();
15
16
        $this->svg = DOKU_INC . 'lib/images/menu/settings.svg';
17
    }
18
19
    /** @inheritdoc */
20
    public function visibleInContext($ctx)
21
    {
22
        global $INFO;
23
        if(!$INFO['ismanager']) return false;
24
25
        return parent::visibleInContext($ctx);
26
    }
27
28
}
29