This repository was archived by the owner on May 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathadmin.php
More file actions
47 lines (38 loc) · 1.19 KB
/
Copy pathadmin.php
File metadata and controls
47 lines (38 loc) · 1.19 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
/**
* @file
* Cockpit ImageStyles admin functions.
*/
// Module ACL definitions.
$this("acl")->addResource('imagestyles', [
'manage.view',
'manage.admin',
'rebuild',
]);
/*
* add menu entry if the user has access to group stuff
*/
$this->on('cockpit.view.settings.item', function () {
if ($this->module('cockpit')->hasaccess('imagestyles', 'manage.view')) {
$this->renderView("imagestyles:views/partials/settings.php");
}
});
$app->on('admin.init', function () use ($app) {
// Bind admin routes /image-styles.
$this->bindClass('ImageStyles\\Controller\\Admin', 'image-styles');
// Add effects manager field.
$this->helper('admin')->addAssets('imagestyles:assets/cp-effectsmanager.tag');
});
// Dashboard widgets.
$this->on("admin.dashboard.widgets", function ($widgets) {
$imagestyles = $this->module("imagestyles")->styles(TRUE);
$widgets[] = [
"name" => "imagestyles",
"content" => $this->view("imagestyles:views/widgets/dashboard.php", compact('imagestyles')),
"area" => 'aside-right',
];
}, 100);
// Add entry-aside to collections.
$this->on('collections.entry.aside', function() {
$this->renderView("imagestyles:views/partials/entry-aside.php");
});