forked from Icinga/icingaweb2-module-businessprocess
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configuration.php
63 lines (53 loc) · 1.75 KB
/
configuration.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
use Icinga\Module\Businessprocess\Storage\LegacyStorage;
/** @var \Icinga\Application\Modules\Module $this */
$section = $this->menuSection(N_('Business Processes'), array(
'url' => 'businessprocess',
'icon' => 'sitemap',
'priority' => 46
));
try {
$storage = LegacyStorage::getInstance();
$prio = 0;
foreach ($storage->listProcessNames() as $name) {
$meta = $storage->loadMetadata($name);
if ($meta->get('AddToMenu') === 'no') {
continue;
}
$prio++;
if ($prio > 5) {
$section->add(N_('Show all'), array(
'url' => 'businessprocess',
'priority' => $prio
));
break;
}
$section->add($meta->getTitle(), array(
'url' => 'businessprocess/process/show',
'urlParameters' => array('config' => $name),
'priority' => $prio
));
}
} catch (Exception $e) {
// Well... there is not much we could do here
}
$this->providePermission(
'businessprocess/showall',
$this->translate('Allow to see all available processes, regardless of configured restrictions')
);
$this->providePermission(
'businessprocess/create',
$this->translate('Allow to create whole new process configuration (files)')
);
$this->providePermission(
'businessprocess/modify',
$this->translate('Allow to modify process definitions, to add and remove nodes')
);
$this->provideRestriction(
'businessprocess/prefix',
$this->translate('Restrict access to configurations with the given prefix')
);
$this->provideJsFile('vendor/Sortable.js');
$this->provideJsFile('behavior/sortable.js');
$this->provideJsFile('vendor/jquery.fn.sortable.js');
$this->provideCssFile('state-ball.less');