From 9d518fd7223740eda576c2f50ab5f870939734d9 Mon Sep 17 00:00:00 2001 From: Daniel Rudolf Date: Sun, 4 Oct 2015 22:39:38 +0200 Subject: [PATCH] Move sorting of $pages from Pico::getPages() to Pico::sortPages() --- lib/Pico.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/Pico.php b/lib/Pico.php index 5c11e2e..408d4ae 100644 --- a/lib/Pico.php +++ b/lib/Pico.php @@ -298,6 +298,7 @@ class Pico $this->triggerEvent('onPagesLoading'); $this->readPages(); + $this->sortPages(); $this->discoverCurrentPage(); $this->triggerEvent('onPagesLoaded', array( @@ -798,7 +799,15 @@ class Pico $this->pages[$id] = $page; } + } + /** + * Sorts all pages known to Pico + * + * @return void + */ + protected function sortPages() + { // sort pages $order = $this->getConfig('pages_order'); $alphaSortClosure = function ($a, $b) use ($order) {