Browse Source

Updated API, filter by location or file

markseu 3 years ago
parent
commit
5f5a99252c
2 changed files with 6 additions and 6 deletions
  1. 4 4
      system/extensions/core.php
  2. 2 2
      system/extensions/update-current.ini

+ 4 - 4
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;

+ 2 - 2
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