commit c29e7075ef465bfaa994181b4cbf9efce10aad9c
parent bac947ac47c4c66b072430e06bde54d993fe3778
Author: markseu <mark2011@mayberg.se>
Date: Tue, 11 Jan 2022 21:23:47 +0100
Updated API, replaced pagination() with paginate()
Diffstat:
4 files changed, 9 insertions(+), 9 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.56";
+ const VERSION = "0.8.57";
const RELEASE = "0.8.18";
public $page; // current page
public $content; // content files
@@ -1126,15 +1126,15 @@ class YellowPageCollection extends ArrayObject {
}
// Paginate page collection
- public function pagination($limit, $reverse = true) {
+ public function paginate($limit) {
$this->paginationNumber = 1;
$this->paginationCount = ceil($this->count() / $limit);
if ($this->yellow->page->isRequest("page")) $this->paginationNumber = intval($this->yellow->page->getRequest("page"));
- if ($this->paginationNumber>$this->paginationCount) $this->paginationNumber = 0;
- if ($this->paginationNumber>=1) {
- $array = $this->getArrayCopy();
- if ($reverse) $array = array_reverse($array);
- $this->exchangeArray(array_slice($array, ($this->paginationNumber - 1) * $limit, $limit));
+ if ($this->paginationNumber<0 || $this->paginationNumber>$this->paginationCount) $this->paginationNumber = 0;
+ if ($this->paginationNumber) {
+ $this->exchangeArray(array_slice($this->getArrayCopy(), ($this->paginationNumber - 1) * $limit, $limit));
+ } else {
+ $this->yellow->page->error(404);
}
return $this;
}
diff --git a/system/extensions/install-blog.bin b/system/extensions/install-blog.bin
Binary files differ.
diff --git a/system/extensions/install-wiki.bin b/system/extensions/install-wiki.bin
Binary files differ.
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.56
+Version: 0.8.57
Description: Core functionality of the website.
HelpUrl: https://github.com/datenstrom/yellow-extensions/tree/master/source/core
DownloadUrl: https://github.com/datenstrom/yellow-extensions/raw/master/zip/core.zip
-Published: 2021-12-09 17:13:31
+Published: 2022-01-11 21:11:22
Developer: Datenstrom
Tag: feature
system/extensions/core.php: core.php, create, update