joystickPagination: Add small control to flip axes

Don't know if that's the final solution. There's probably
a better (more visible) one.

refs 
This commit is contained in:
Johannes Meyer 2018-05-02 13:42:57 +02:00
parent 47c616567f
commit 7c7b4a928d
1 changed files with 22 additions and 0 deletions
application/views/scripts

View File

@ -10,6 +10,15 @@ $showText = $this->translate('%s: Show %s %u to %u out of %u', 'pagination.joyst
$xAxisPages = $xAxisPaginator->getPages('all');
$yAxisPages = $yAxisPaginator->getPages('all');
$flipUrl = Url::fromRequest();
$flipUrl->setParam('flipped', (int) ! $flipUrl->getParam('flipped'));
if ($flipUrl->hasParam('page')) {
$flipUrl->setParam('page', implode(',', array_reverse(explode(',', $flipUrl->getParam('page')))));
}
if ($flipUrl->hasParam('limit')) {
$flipUrl->setParam('limit', implode(',', array_reverse(explode(',', $flipUrl->getParam('limit')))));
}
$totalYAxisPages = $yAxisPaginator->count();
$currentYAxisPage = $yAxisPaginator->getCurrentPageNumber();
$prevYAxisPage = $currentYAxisPage > 1 ? $currentYAxisPage - 1 : null;
@ -79,7 +88,20 @@ $nextXAxisPage = $currentXAxisPage < $totalXAxisPages ? $currentXAxisPage + 1 :
<?= $this->icon('left-open'); ?>
<?php endif ?>
</td>
<?php if ($this->flippable): ?>
<td><?= $this->qlink(
'',
$flipUrl,
null,
array(
'icon' => 'arrows-cw',
'data-base-target' => '_self',
'title' => $this->translate('Flip grid axes')
)
) ?></td>
<?php else: ?>
<td>&nbsp;</td>
<?php endif ?>
<td>
<?php if ($nextXAxisPage): ?>
<?= $this->qlink(