CockpitCMS-Drone/admin.php

30 lines
679 B
PHP
Raw Normal View History

2019-03-05 15:28:29 +01:00
<?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,
]);
}
}
});