init
This commit is contained in:
29
admin.php
Normal file
29
admin.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Addon admin functions.
|
||||
*/
|
||||
|
||||
// Module ACL definitions.
|
||||
$this("acl")->addResource('drone', [
|
||||
'manage.view',
|
||||
'manage.deploy',
|
||||
]);
|
||||
|
||||
$app->on('admin.init', function () use ($app) {
|
||||
if ($app->config['drone']) {
|
||||
// Bind admin routes.
|
||||
$this->bindClass('Drone\\Controller\\Admin', 'drone/deploys');
|
||||
|
||||
if ($app->module('cockpit')->hasaccess('drone', 'deploys.view')) {
|
||||
// Add to modules menu.
|
||||
$this('admin')->addMenuItem('modules', [
|
||||
'label' => 'Drone Deploys',
|
||||
'icon' => 'drone:icon.svg',
|
||||
'route' => '/drone/deploys',
|
||||
'active' => strpos($this['route'], '/drone/deploys') === 0,
|
||||
]);
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user