diff --git a/README.md b/README.md
index f96476d..27985e7 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# Nibiru
### Rapid Prototyping PHP Framework
-Version 0.6.0 beta
+Version 0.6.1 beta
## Introduction
Nibiru is a rapid prototyping framework written in PHP and based on the MVC design pattern. Now one may say that writing
@@ -95,5 +95,11 @@ Engine Implementation.
A soap extension will not be part of the system anymore, since that is just a bad habit, so this will be replaced with a REST api.
+Bugfixing
+Version 0.6.1 beta 04.01.2019
+
+- Bugfix for the pagination in the core files, used not to work on more then three pages, is now fixed.
+
+
The start is done, have success with PHP prototyping, and always remember to have fun!
Author: Stephan Kasdorf
\ No newline at end of file
diff --git a/core/a/pageination.php b/core/a/pageination.php
index f629430..d7265d8 100755
--- a/core/a/pageination.php
+++ b/core/a/pageination.php
@@ -1,16 +1,22 @@
0,
'end' => self::getEntriesPerPage()
);
}
else
{
- if(array_key_exists($i, $limit))
- {
- if(array_key_exists('start', $limit[$i]))
- {
- $start = $limit[$i]['start'];
- }
- else
- {
- $start = self::PAGE_ITERATION;
- }
- }
- else
- {
- $start = self::PAGE_ITERATION;
- }
- $limit[$i] = array(
+ $laststart = self::getPageEntryIndex()[$i-1]['start'];
+
+ $limit = array(
+ 'start' => $laststart + self::getEntriesPerPage(),
'end' => self::getEntriesPerPage(),
- 'start' => $start + self::getEntriesPerPage()
);
+
}
+ self::$_page_entry_index[$i] = $limit;
}
$fullEntriesOnPages = $PagesWithFullEntriesIndex*self::getEntriesPerPage();
if($fullEntriesOnPages $limit[$i-1]['start'] + self::getEntriesPerPage(),
+ $limit = array(
+ 'start' => self::getPageEntryIndex()[$i-1]['start']+self::getEntriesPerPage(),
'end' => $lastPageEntries
);
+ self::$_page_entry_index[$i] = $limit;
}
- self::$_page_entry_index = $limit;
self::setUriPaginationPath();
self::loadPaginationToTemplate();
}
@@ -144,7 +140,7 @@ abstract class Pageination implements IPageination
{
self::$_entries_per_page = Config::getInstance()->getConfig()[View::NIBIRU_SETTINGS]['entriesperpage'];
}
-
+
/**
* @return int
*/
@@ -163,7 +159,7 @@ abstract class Pageination implements IPageination
self::setMaxPageEntries( self::getTable()->loadTableRowCount( $tableinfo[0], $where ));
self::$_max_pages = ceil(self::getMaxPageEntries()/self::getEntriesPerPage());
}
-
+
/**
* @return boolean
*/
@@ -230,38 +226,38 @@ abstract class Pageination implements IPageination
protected static function setCurrentNumber( )
{
try {
- $page = false;
- $uri = explode('/', $_SERVER['REQUEST_URI']);
- foreach ($uri as $uripart)
+ $page = false;
+ $uri = explode('/', $_SERVER['REQUEST_URI']);
+ foreach ($uri as $uripart)
+ {
+ if($page)
{
- if($page)
+ if(is_numeric($uripart))
{
- if(is_numeric($uripart))
- {
- self::$_current_number = $uripart;
- Controller::getInstance()->varname(View::getInstance()->getEngine(), array('pagenumber' => self::getCurrentNumber()));
- $page = false;
- self::setNextPageNumber();
- self::setPreviousPageNumber();
- }
- else
- {
- throw new \Exception('ERROR: the pagenumber has to be a nummeric value!');
- }
+ self::$_current_number = $uripart;
+ Controller::getInstance()->varname(View::getInstance()->getEngine(), array('pagenumber' => self::getCurrentNumber()));
+ $page = false;
+ self::setNextPageNumber();
+ self::setPreviousPageNumber();
}
- if($uripart == 'page')
+ else
{
- $page = true;
+ throw new \Exception('ERROR: the pagenumber has to be a nummeric value!');
}
}
- if(self::getCurrentNumber() == self::CURRENT_PAGE)
+ if($uripart == 'page')
{
- throw new \Exception('ERROR: URL parameter [page] is missing, please check your class and add the parameter!');
+ $page = true;
}
- self::setNextPageNumber();
- self::setPreviousPageNumber();
-
}
+ if(self::getCurrentNumber() == self::CURRENT_PAGE)
+ {
+ throw new \Exception('ERROR: URL parameter [page] is missing, please check your class and add the parameter!');
+ }
+ self::setNextPageNumber();
+ self::setPreviousPageNumber();
+
+ }
catch (\Exception $e)
{
echo '';