BUGFIXING: version 0.6.1, update on the pagination
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Nibiru
|
||||
### Rapid Prototyping PHP Framework
|
||||
Version 0.6.0 beta
|
||||
Version 0.6.1 beta
|
||||
## Introduction
|
||||
|
||||
<div style="word-spacing: 2px; letter-spacing: 0.1px; font-size: 12px; margin-bottom: 15px;">Nibiru is a rapid prototyping framework written in PHP and based on the MVC design pattern. Now one may say that writing <br>
|
||||
@@ -95,5 +95,11 @@ Engine Implementation.</div>
|
||||
<li>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.</li>
|
||||
</ul>
|
||||
|
||||
<h1>Bugfixing</h1>
|
||||
<p>Version 0.6.1 beta 04.01.2019</p>
|
||||
<ul>
|
||||
<li>Bugfix for the pagination in the core files, used not to work on more then three pages, is now fixed.</li>
|
||||
</ul>
|
||||
|
||||
<div style="word-spacing: 2px; letter-spacing: 0.1px; font-size: 15px; margin-bottom: 15px;">The start is done, have success with PHP prototyping, and always remember to have fun!</div>
|
||||
Author: Stephan Kasdorf<br><br>
|
||||
@@ -1,15 +1,21 @@
|
||||
<?php
|
||||
namespace Nibiru;
|
||||
namespace Nibiru\Module;
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: mithril
|
||||
* User: Stephan Kasdorf
|
||||
* Date: 15.09.18
|
||||
* Time: 03:16
|
||||
* Last Update: 04.01.2019
|
||||
* Time: 19:13
|
||||
*/
|
||||
use Nibiru\Adapter;
|
||||
use Nibiru\Config;
|
||||
use Nibiru\Controller;
|
||||
use Nibiru\Router;
|
||||
use Nibiru\View;
|
||||
|
||||
abstract class Pageination implements IPageination
|
||||
abstract class Pageination implements Adapter\Pageination
|
||||
{
|
||||
use Attributes\Pageination;
|
||||
use \Nibiru\Messages\Pageination;
|
||||
|
||||
private static $_table = false;
|
||||
private static $_current_page_content = array();
|
||||
@@ -82,49 +88,39 @@ abstract class Pageination implements IPageination
|
||||
private static function setPageEntryIndex( )
|
||||
{
|
||||
$PagesWithFullEntriesIndex = floor(self::getMaxPageEntries()/self::getEntriesPerPage());
|
||||
$limit = array();
|
||||
for($i=1; $i<$PagesWithFullEntriesIndex+1; $i++)
|
||||
{
|
||||
if(!array_key_exists($i-1, $limit))
|
||||
$limit = array();
|
||||
|
||||
if($i==1)
|
||||
{
|
||||
$limit[$i] = array(
|
||||
$limit = array(
|
||||
'start' => 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<self::getMaxPageEntries())
|
||||
{
|
||||
$lastPageEntries = self::getMaxPageEntries()-($PagesWithFullEntriesIndex*self::getEntriesPerPage());
|
||||
$limit[$i] = array(
|
||||
'start' => $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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user