forked from pauloamgomes/BackupAndRestore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin.php
31 lines (25 loc) · 777 Bytes
/
admin.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
/**
* @file
* Cockpit backup and restore admin functions.
*/
// Module ACL definitions.
$this("acl")->addResource('BackupAndRestore', [
'manage.view',
'manage.create',
'manage.restore',
'manage.delete',
]);
$app->on('admin.init', function () use ($app) {
// Bind admin routes /backup-and-restore.
$this->bindClass('BackupAndRestore\\Controller\\Admin', 'backup-and-restore');
if ($app->module('cockpit')->hasaccess('BackupAndRestore', 'manage.view')) {
// Add to modules menu.
$this('admin')->addMenuItem('modules', [
'label' => 'Backup And Restore',
'icon' => 'assets:app/media/icons/database.svg',
'route' => '/backup-and-restore',
'active' => strpos($this['route'], '/backup-and-restore') === 0,
]);
}
});