-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin.php
More file actions
28 lines (25 loc) · 923 Bytes
/
Copy pathadmin.php
File metadata and controls
28 lines (25 loc) · 923 Bytes
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
<?php
$this("acl")->addResource('collectionentriesfilters', [
'manage'
]);
/**
* Add filters to collection entries page
*/
$this->on('collections.entries', function ($collection) use ($app) {
$filters = $app->module("collectionentriesfilters")->loadFilters();
$this->renderView("collectionentriesfilters:views/partials/filters.php", ['collection' => $collection, 'filters' => $filters[$collection['name']]]);
});
/**
* Initialize addon settings page
*/
$app->on('admin.init', function () use ($app) {
$this->bindClass('CollectionEntriesFilters\\Controller\\Admin', 'settings/collection-entries-filters');
});
/*
* Add menu entry if the user has access to group stuff
*/
$this->on('cockpit.view.settings.item', function () use ($app) {
if ($app->module('cockpit')->hasaccess('collectionentriesfilters', 'manage')) {
$this->renderView("collectionentriesfilters:views/partials/settings.php");
}
});