mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-03 03:46:30 +01:00
taskFilterPages can filter by page type too
This commit is contained in:
@@ -417,6 +417,10 @@ class AdminController
|
||||
$collection = $this->grav['pages']->all();
|
||||
|
||||
if (count($flags)) {
|
||||
// Filter by state
|
||||
$pageStates = array('modular', 'visible', 'routable');
|
||||
|
||||
if (count(array_intersect($pageStates, $flags)) > 0) {
|
||||
if (in_array('modular', $flags))
|
||||
$collection = $collection->modular();
|
||||
|
||||
@@ -427,6 +431,17 @@ class AdminController
|
||||
$collection = $collection->routable();
|
||||
}
|
||||
|
||||
foreach ($pageStates as $pageState) {
|
||||
unset($flags[$pageState]);
|
||||
}
|
||||
|
||||
// Filter by page type
|
||||
if (count($flags)) {
|
||||
$type = $flags[0];
|
||||
$collection = $collection->ofType($type);
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($queries)) {
|
||||
foreach ($collection as $page) {
|
||||
foreach ($queries as $query) {
|
||||
|
||||
Reference in New Issue
Block a user