diff options
author | Andreas Gohr <gohr@cosmocode.de> | 2018-10-30 16:21:11 +0100 |
---|---|---|
committer | Andreas Gohr <gohr@cosmocode.de> | 2018-10-30 16:21:11 +0100 |
commit | 3d90b12c095f2bb5912813f3617da12495954581 (patch) | |
tree | f658e0790a6ee9396ada8859ca22ef24832211d6 /inc/Menu | |
parent | 4f32ee1841967c0b65ccf2aa5a485d50afa423e7 (diff) | |
download | dokuwiki-3d90b12c095f2bb5912813f3617da12495954581.tar.gz dokuwiki-3d90b12c095f2bb5912813f3617da12495954581.zip |
Admin Menu Item should not throw an exception
instead the visibility is properly checked in the visibleInContext()
method.
Diffstat (limited to 'inc/Menu')
-rw-r--r-- | inc/Menu/Item/Admin.php | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/inc/Menu/Item/Admin.php b/inc/Menu/Item/Admin.php index 7302f0f34..e5506c220 100644 --- a/inc/Menu/Item/Admin.php +++ b/inc/Menu/Item/Admin.php @@ -11,14 +11,18 @@ class Admin extends AbstractItem { /** @inheritdoc */ public function __construct() { - global $INFO; parent::__construct(); $this->svg = DOKU_INC . 'lib/images/menu/settings.svg'; + } + + /** @inheritdoc */ + public function visibleInContext($ctx) + { + global $INFO; + if(!$INFO['ismanager']) return false; - if(!$INFO['ismanager']) { - throw new \RuntimeException("admin is for managers only"); - } + return parent::visibleInContext($ctx); } } |