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 #2640
This commit is contained in:
parent
47c616567f
commit
7c7b4a928d
|
@ -10,6 +10,15 @@ $showText = $this->translate('%s: Show %s %u to %u out of %u', 'pagination.joyst
|
||||||
$xAxisPages = $xAxisPaginator->getPages('all');
|
$xAxisPages = $xAxisPaginator->getPages('all');
|
||||||
$yAxisPages = $yAxisPaginator->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();
|
$totalYAxisPages = $yAxisPaginator->count();
|
||||||
$currentYAxisPage = $yAxisPaginator->getCurrentPageNumber();
|
$currentYAxisPage = $yAxisPaginator->getCurrentPageNumber();
|
||||||
$prevYAxisPage = $currentYAxisPage > 1 ? $currentYAxisPage - 1 : null;
|
$prevYAxisPage = $currentYAxisPage > 1 ? $currentYAxisPage - 1 : null;
|
||||||
|
@ -79,7 +88,20 @@ $nextXAxisPage = $currentXAxisPage < $totalXAxisPages ? $currentXAxisPage + 1 :
|
||||||
<?= $this->icon('left-open'); ?>
|
<?= $this->icon('left-open'); ?>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
</td>
|
</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> </td>
|
<td> </td>
|
||||||
|
<?php endif ?>
|
||||||
<td>
|
<td>
|
||||||
<?php if ($nextXAxisPage): ?>
|
<?php if ($nextXAxisPage): ?>
|
||||||
<?= $this->qlink(
|
<?= $this->qlink(
|
||||||
|
|
Loading…
Reference in New Issue