config now in settings
This commit is contained in:
19
admin.php
19
admin.php
@@ -9,10 +9,22 @@
|
||||
$this("acl")->addResource('drone', [
|
||||
'manage.view',
|
||||
'manage.deploy',
|
||||
'manage.settings'
|
||||
]);
|
||||
|
||||
/*
|
||||
* add menu entry to settings
|
||||
*/
|
||||
$this->on('cockpit.view.settings.item', function () {
|
||||
if ($this->module('cockpit')->hasaccess('drone', 'manage.settings')) {
|
||||
$this->renderView("drone:views/partials/settings.php");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$app->on('admin.init', function () use ($app) {
|
||||
if ($app->config['drone']) {
|
||||
$settings = $app->storage->findOne('drone/settings');
|
||||
if ($settings && $settings['active']) {
|
||||
// Bind admin routes.
|
||||
$this->bindClass('Drone\\Controller\\Admin', 'drone/deploys');
|
||||
|
||||
@@ -26,4 +38,9 @@ $app->on('admin.init', function () use ($app) {
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
if ($app->module('cockpit')->hasaccess('drone', 'manage.settings')) {
|
||||
// Add settings
|
||||
$this->bindClass('Drone\\Controller\\Settings', 'drone/settings');
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user