From 7c7b4a928d7e09ecff190e10cd2f6945b67eafdf Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 2 May 2018 13:42:57 +0200 Subject: [PATCH] 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 --- .../views/scripts/joystickPagination.phtml | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/application/views/scripts/joystickPagination.phtml b/application/views/scripts/joystickPagination.phtml index 9549fc2b0..134796b79 100644 --- a/application/views/scripts/joystickPagination.phtml +++ b/application/views/scripts/joystickPagination.phtml @@ -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 : icon('left-open'); ?> + flippable): ?> + qlink( + '', + $flipUrl, + null, + array( + 'icon' => 'arrows-cw', + 'data-base-target' => '_self', + 'title' => $this->translate('Flip grid axes') + ) + ) ?> +   + qlink(