commit 5f5a99252c35e61bc2ac28d44f1f9c54ed75e43b
parent 1e0007805a8d092c0838a9a3cbef2b09d1c25a05
Author: markseu <mark2011@mayberg.se>
Date: Wed, 20 Apr 2022 22:41:43 +0200
Updated API, filter by location or file
Diffstat:
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/system/extensions/core.php b/system/extensions/core.php
@@ -2,7 +2,7 @@
// Core extension, https://github.com/datenstrom/yellow-extensions/tree/master/source/core
class YellowCore {
- const VERSION = "0.8.71";
+ const VERSION = "0.8.72";
const RELEASE = "0.8.19";
public $page; // current page
public $content; // content files
@@ -1005,11 +1005,11 @@ class YellowPageCollection extends ArrayObject {
return $this;
}
- // Filter page collection by location
- public function match($regex = "/.*/") {
+ // Filter page collection by location or file
+ public function match($regex = "/.*/", $filterByLocation = true) {
$array = array();
foreach ($this->getArrayCopy() as $page) {
- if (preg_match($regex, $page->location)) array_push($array, $page);
+ if (preg_match($regex, $filterByLocation ? $page->location : $page->fileName)) array_push($array, $page);
}
$this->exchangeArray($array);
return $this;
diff --git a/system/extensions/update-current.ini b/system/extensions/update-current.ini
@@ -21,11 +21,11 @@ Tag: feature
system/extensions/command.php: command.php, create, update
Extension: Core
-Version: 0.8.71
+Version: 0.8.72
Description: Core functionality of the website.
DocumentationUrl: https://github.com/datenstrom/yellow-extensions/tree/master/source/core
DownloadUrl: https://github.com/datenstrom/yellow-extensions/raw/master/zip/core.zip
-Published: 2022-04-20 14:36:27
+Published: 2022-04-20 22:34:35
Developer: Datenstrom
Tag: feature
system/extensions/core.php: core.php, create, update