Rename modular to module in flex pages

This commit is contained in:
Matias Griese
2019-11-20 10:21:37 +02:00
parent b3545ccb8b
commit 61a3f3f7c1
2 changed files with 8 additions and 8 deletions

View File

@@ -185,14 +185,14 @@ class PageIndex extends FlexPageIndex
$activeLanguage = $language->getLanguage();
$isDefaultLanguage = $activeLanguage === $language->getDefault();
} elseif ($key === 'routable') {
// Routable checks also "not modular and page".
// Routable checks also "not module and page".
$bool = (bool)$filters['routable'];
$modular = (bool)($filters['modular'] ?? !$bool);
$modular = (bool)($filters['module'] ?? !$bool);
$page = (bool)($filters['page'] ?? $bool);
if ($modular === $bool || $page !== $bool) {
return $this->createFrom([]);
}
$filters['modular'] = $modular;
$filters['module'] = $modular;
$filters['page'] = $page;
}
}
@@ -203,7 +203,7 @@ class PageIndex extends FlexPageIndex
$path = explode('/', $entry['key']);
$storagePath = explode('/', $entry['storage_key']);
$slug = end($path);
$isModular = $slug[0] === '_';
$isModule = $slug[0] === '_';
$storageSlug = end($storagePath);
foreach ($filters as $key => $value) {
@@ -217,10 +217,10 @@ class PageIndex extends FlexPageIndex
$types = $value ? explode(',', $value) : [];
$matches = in_array($type, $types, true);
break;
case 'modular':
case 'module':
// All modular pages start with underscore in their slug.
// Modular can also be in the header...
$matches = $isModular === (bool)$value;
$matches = $isModule === (bool)$value;
break;
case 'visible':
// Visible pages have numeric prefix in their folder name.

View File

@@ -254,7 +254,7 @@ class PageObject extends FlexPageObject
*
* - search: string
* - extension: string
* - modular: bool
* - module: bool
* - visible: bool
* - routable: bool
* - published: bool
@@ -282,7 +282,7 @@ class PageObject extends FlexPageObject
case 'extension':
$matches = Utils::contains((string)$value, $this->extension());
break;
case 'modular':
case 'module':
case 'visible':
case 'routable':
case 'published':