mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-03 20:05:53 +01:00
It is now possible to use regex as values for "Hide page types in Admin" and "Hide modular page types in Admin" settings (fixes #1828)
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
* Added modal to confirm updating Grav as well as cool down counter before enabling Update button [#1257](https://github.com/getgrav/grav-plugin-admin/issues/1257)
|
||||
* Better handling of offline/intranet mode when the repository index is missing. Faster admin. [#1916](https://github.com/getgrav/grav-plugin-admin/issues/1916)
|
||||
* Statistics is now Page View Statistics [#1885](https://github.com/getgrav/grav-plugin-admin/issues/1885)
|
||||
* It is now possible to use regex as values for "Hide page types in Admin" and "Hide modular page types in Admin" settings [#1828](https://github.com/getgrav/grav-plugin-admin/issues/1828)
|
||||
1. [](#bugfix)
|
||||
* Fixed Safari issue with new ACL picker field [#1955](https://github.com/getgrav/grav-plugin-admin/issues/1955)
|
||||
* Stop propagation of ACL add button in ACL picker [flex-objects#83](https://github.com/trilbymedia/grav-plugin-flex-objects/issues/83)
|
||||
|
||||
26
admin.php
26
admin.php
@@ -921,8 +921,17 @@ class AdminPlugin extends Plugin
|
||||
|
||||
// First filter by configuration
|
||||
$hideTypes = Grav::instance()['config']->get('plugins.admin.hide_page_types', []);
|
||||
foreach ((array) $hideTypes as $type) {
|
||||
unset($types[$type]);
|
||||
foreach ((array) $hideTypes as $hide) {
|
||||
if (isset($types[$hide])) {
|
||||
unset($types[$hide]);
|
||||
} else {
|
||||
foreach ($types as $key => $type) {
|
||||
$match = preg_match('#' . $hide . '#i', $key);
|
||||
if ($match) {
|
||||
unset($types[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Allow manipulating of the data by event
|
||||
@@ -946,8 +955,17 @@ class AdminPlugin extends Plugin
|
||||
|
||||
// First filter by configuration
|
||||
$hideTypes = (array) Grav::instance()['config']->get('plugins.admin.hide_modular_page_types', []);
|
||||
foreach ($hideTypes as $type) {
|
||||
unset($types[$type]);
|
||||
foreach ((array) $hideTypes as $hide) {
|
||||
if (isset($types[$hide])) {
|
||||
unset($types[$hide]);
|
||||
} else {
|
||||
foreach ($types as $key => $type) {
|
||||
$match = preg_match('#' . $hide . '#i', $key);
|
||||
if ($match) {
|
||||
unset($types[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Allow manipulating of the data by event
|
||||
|
||||
Reference in New Issue
Block a user