diff --git a/system/extensions/update-available.ini b/system/extensions/update-available.ini index 272e0991..be1cd2a6 100644 --- a/system/extensions/update-available.ini +++ b/system/extensions/update-available.ini @@ -148,14 +148,14 @@ system/themes/copenhagen.css: copenhagen.css, create, update, careful system/themes/copenhagen.png: copenhagen.png, create Extension: Core -Version: 0.9.5 +Version: 0.9.6 Description: Core functionality of your website. Developer: Anna Svensson Tag: feature DownloadUrl: https://github.com/annaesvensson/yellow-core/archive/refs/heads/main.zip DocumentationUrl: https://github.com/annaesvensson/yellow-core DocumentationLanguage: en, de, sv -Published: 2024-04-23 10:16:44 +Published: 2024-04-23 21:35:24 Status: available system/workers/core.php: core.php, create, update system/extensions/core.php: coreupdate.txt, update @@ -602,14 +602,14 @@ Status: available system/workers/private.php: private.php, create, update Extension: Publish -Version: 0.9.3 +Version: 0.9.4 Description: Make and publish extensions. Developer: Anna Svensson Tag: feature DownloadUrl: https://github.com/annaesvensson/yellow-publish/archive/refs/heads/main.zip DocumentationUrl: https://github.com/annaesvensson/yellow-publish DocumentationLanguage: en, de, sv -Published: 2024-04-10 10:20:07 +Published: 2024-04-23 22:01:41 Status: available system/workers/publish.php: publish.php, create, update diff --git a/system/extensions/yellow-extension.ini b/system/extensions/yellow-extension.ini index 8972569c..9428edef 100755 --- a/system/extensions/yellow-extension.ini +++ b/system/extensions/yellow-extension.ini @@ -1,14 +1,14 @@ # Datenstrom Yellow extension settings Extension: Core -Version: 0.9.5 +Version: 0.9.6 Description: Core functionality of your website. Developer: Anna Svensson Tag: feature DownloadUrl: https://github.com/annaesvensson/yellow-core/archive/refs/heads/main.zip DocumentationUrl: https://github.com/annaesvensson/yellow-core DocumentationLanguage: en, de, sv -Published: 2024-04-23 10:16:44 +Published: 2024-04-23 21:35:24 Status: available system/workers/core.php: core.php, create, update system/extensions/core.php: coreupdate.txt, update diff --git a/system/workers/core.php b/system/workers/core.php index d13c85c0..9c1fe2b6 100755 --- a/system/workers/core.php +++ b/system/workers/core.php @@ -2,7 +2,7 @@ // Core extension, https://github.com/annaesvensson/yellow-core class YellowCore { - const VERSION = "0.9.5"; + const VERSION = "0.9.6"; const RELEASE = "0.9"; public $content; // content files public $media; // media files @@ -3656,14 +3656,14 @@ public function similar($page): YellowPageCollection { public function sort($key, $ascendingOrder = true): YellowPageCollection { $array = $this->getArrayCopy(); $sortIndex = 0; + $sortKeys = array(); foreach ($array as $page) { - $page->set("sortIndex", ++$sortIndex); + $sortKeys[$page->location] = $page->get($key)." ".++$sortIndex; } - $callback = function ($a, $b) use ($key, $ascendingOrder) { - $result = $ascendingOrder ? - strnatcasecmp($a->get($key), $b->get($key)) : - strnatcasecmp($b->get($key), $a->get($key)); - return $result==0 ? $a->get("sortIndex") - $b->get("sortIndex") : $result; + $callback = function ($a, $b) use ($sortKeys, $ascendingOrder) { + return $ascendingOrder ? + strnatcasecmp($sortKeys[$a->location], $sortKeys[$b->location]) : + strnatcasecmp($sortKeys[$b->location], $sortKeys[$a->location]); }; usort($array, $callback); $this->exchangeArray($array);