CockpitCMS-Drone/admin.php
2019-03-05 16:45:04 +01:00

30 lines
678 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', 'manage.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,
]);
}
}
});