improved paging code

This commit is contained in:
Steffen Schröder
2014-05-15 17:45:08 +02:00
parent d37acbd116
commit 74658044fc
10 changed files with 50 additions and 120 deletions

View File

@ -573,19 +573,15 @@ class LocalRecordsPlugin implements CallbackListener, CommandListener, TimerList
$array = array("Rank" => $x + 5, "Nickname" => $x + 18, "Login" => $x + 70, "Time" => $x + 101);
$this->maniaControl->manialinkManager->labelLine($headFrame, $array);
$i = 0;
$y = $height / 2 - 10;
$pageFrames = array();
$i = 0;
$y = $height / 2 - 10;
$pageFrame = null;
foreach ($records as $listRecord) {
if (!isset($pageFrame)) {
if ($i % 15 === 0) {
$pageFrame = new Frame();
$frame->add($pageFrame);
if (!empty($pageFrames)) {
$pageFrame->setVisible(false);
}
array_push($pageFrames, $pageFrame);
$y = $height / 2 - 10;
$paging->addPage($pageFrame);
}
@ -610,9 +606,6 @@ class LocalRecordsPlugin implements CallbackListener, CommandListener, TimerList
$y -= 4;
$i++;
if ($i % 15 == 0) {
unset($pageFrame);
}
}
// Render and display xml