@@ -444,11 +444,11 @@ discard block |
||
444 | 444 | |
445 | 445 | // ensure that the last index never overruns the total record count |
446 | 446 | if ($last > $recordCount) { |
447 | - $last = $recordCount ; |
|
447 | + $last = $recordCount; |
|
448 | 448 | } |
449 | 449 | |
450 | 450 | // render a message for an empty list |
451 | - if ($recordCount > 0) { |
|
451 | + if ($recordCount > 0) { |
|
452 | 452 | $html .= '<ul class="pagination">'; |
453 | 453 | } else { |
454 | 454 | $html .= '<p align="center">The list is empty. </p>'; |
@@ -457,7 +457,7 @@ discard block |
||
457 | 457 | } |
458 | 458 | |
459 | 459 | // render "Previous" link |
460 | - if ($start > 0) { |
|
460 | + if ($start > 0) { |
|
461 | 461 | // handle secure URLs |
462 | 462 | if ($controller->getRequest()->getParam('token', null) != null) { |
463 | 463 | $url = FrontController::generateSecureURL('act=Alpha\Controller\ActiveRecordController&ActiveRecordType='.$controller->getRequest()->getParam('ActiveRecordType').'&start='.($start-$controller->getLimit()).'&limit='.$limit); |
@@ -465,15 +465,15 @@ discard block |
||
465 | 465 | $url = '/records/'.urlencode($controller->getRequest()->getParam('ActiveRecordType')).'/'.($start-$limit).'/'.$limit; |
466 | 466 | } |
467 | 467 | $html .= '<li><a href="'.$url.'"><<-Previous</a></li>'; |
468 | - } elseif ($recordCount > $limit) { |
|
468 | + } elseif ($recordCount > $limit) { |
|
469 | 469 | $html .= '<li class="disabled"><a href="#"><<-Previous</a></li>'; |
470 | 470 | } |
471 | 471 | |
472 | 472 | // render the page index links |
473 | - if ($recordCount > $limit) { |
|
473 | + if ($recordCount > $limit) { |
|
474 | 474 | $page = 1; |
475 | 475 | |
476 | - for ($i = 0; $i < $recordCount ; $i += $limit) { |
|
476 | + for ($i = 0; $i < $recordCount; $i += $limit) { |
|
477 | 477 | if ($i != $start) { |
478 | 478 | // handle secure URLs |
479 | 479 | if ($controller->getRequest()->getParam('token', null) != null) { |
@@ -482,7 +482,7 @@ discard block |
||
482 | 482 | $url = '/records/'.urlencode($controller->getRequest()->getParam('ActiveRecordType')).'/'.$i.'/'.$limit; |
483 | 483 | } |
484 | 484 | $html .= '<li><a href="'.$url.'">'.$page.'</a></li>'; |
485 | - } elseif ($recordCount > $limit) { // render an anchor for the current page |
|
485 | + } elseif ($recordCount > $limit) { // render an anchor for the current page |
|
486 | 486 | $html .= '<li class="active"><a href="#">'.$page.'</a></li>'; |
487 | 487 | } |
488 | 488 | |
@@ -491,7 +491,7 @@ discard block |
||
491 | 491 | } |
492 | 492 | |
493 | 493 | // render "Next" link |
494 | - if ($recordCount > $last) { |
|
494 | + if ($recordCount > $last) { |
|
495 | 495 | // handle secure URLs |
496 | 496 | if ($controller->getRequest()->getParam('token', null) != null) { |
497 | 497 | $url = FrontController::generateSecureURL('act=Alpha\Controller\ActiveRecordController&ActiveRecordType='.$controller->getRequest()->getParam('ActiveRecordType').'&start='.($start+$limit).'&limit='.$limit); |
@@ -499,7 +499,7 @@ discard block |
||
499 | 499 | $url = '/records/'.urlencode($controller->getRequest()->getParam('ActiveRecordType')).'/'.($start+$limit.'/'.$limit); |
500 | 500 | } |
501 | 501 | $html .= '<li><a href="'.$url.'">Next->></a></li>'; |
502 | - } elseif ($recordCount > $limit) { |
|
502 | + } elseif ($recordCount > $limit) { |
|
503 | 503 | $html .= '<li class="disabled"><a href="#">Next->></a></li>'; |
504 | 504 | } |
505 | 505 |