CockpitCMS-Drone/admin.php
Sebastian Frank a3cce2df73 init
2019-03-05 15:28:29 +01:00

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,
]);
}
}
});