diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-14 13:30:50 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-14 13:30:50 +0000 |
commit | d5f222b7ebf4d2c2d47d20a25adcc9aadf67fbd5 (patch) | |
tree | da9b32212bf99154450a7668f61a75f65617a9fa /configuration.php | |
parent | Initial commit. (diff) | |
download | icingaweb2-module-toplevelview-d5f222b7ebf4d2c2d47d20a25adcc9aadf67fbd5.tar.xz icingaweb2-module-toplevelview-d5f222b7ebf4d2c2d47d20a25adcc9aadf67fbd5.zip |
Adding upstream version 0.3.3.upstream/0.3.3upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'configuration.php')
-rw-r--r-- | configuration.php | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/configuration.php b/configuration.php new file mode 100644 index 0000000..af09d2f --- /dev/null +++ b/configuration.php @@ -0,0 +1,45 @@ +<?php +/* Copyright (C) 2017 Icinga Development Team <info@icinga.com> */ + +/** @var \Icinga\Application\Modules\Module $this */ + +use Icinga\Module\Toplevelview\ViewConfig; +use Icinga\Web\Url; + +$this->providePermission('toplevelview/edit', $this->translate('Allow the user to edit Top Level Views')); + +/** @var \Icinga\Web\Navigation\NavigationItem $section */ +$section = $this->menuSection('toplevelview'); +$section + ->setLabel('Top Level View') + ->setUrl('toplevelview') + ->setIcon('sitemap') + ->setPriority(20); + +try { + if (extension_loaded('yaml')) { + /** @var \Icinga\Application\Modules\MenuItemContainer $section */ + $views = ViewConfig::loadAll(); + + foreach ($views as $name => $viewConfig) { + $section->add($name, array( + 'label' => $viewConfig->getMeta('name'), + 'url' => Url::fromPath('toplevelview/show', array('name' => $name)), + )); + } + } +} catch (Exception $e) { + // don't fail here... +} + +$this->provideJsFile('vendor/codemirror/codemirror.js'); +$this->provideJsFile('vendor/codemirror/mode/yaml.js'); +$this->provideJsFile('vendor/codemirror/addon/dialog/dialog.js'); +$this->provideJsFile('vendor/codemirror/addon/search/searchcursor.js'); +$this->provideJsFile('vendor/codemirror/addon/search/search.js'); +$this->provideJsFile('vendor/codemirror/addon/search/matchesonscrollbar.js'); +$this->provideJsFile('vendor/codemirror/addon/search/jump-to-line.js'); + +$this->provideCssFile('vendor/codemirror/codemirror.css'); +$this->provideCssFile('vendor/codemirror/addon/dialog/dialog.css'); +$this->provideCssFile('vendor/codemirror/addon/search/matchesonscrollbar.css'); |