30 lines
679 B
PHP
30 lines
679 B
PHP
|
<?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,
|
||
|
]);
|
||
|
}
|
||
|
}
|
||
|
});
|