From: Guillaume AGNIERAY Date: Thu, 5 Oct 2023 08:59:17 +0000 (+0200) Subject: Add missing variable to hide pagination X-Git-Tag: 1.0.0rc2~24 X-Git-Url: https://git.agnieray.net/?a=commitdiff_plain;h=a25062b7d866f024669cd7d052227d60b00b624f;p=galette.git Add missing variable to hide pagination --- diff --git a/galette/lib/Galette/Core/Pagination.php b/galette/lib/Galette/Core/Pagination.php index e5daeca1c..a896c24db 100644 --- a/galette/lib/Galette/Core/Pagination.php +++ b/galette/lib/Galette/Core/Pagination.php @@ -252,6 +252,7 @@ abstract class Pagination */ public function setViewPagination(RouteParser $routeparser, $view, $restricted = true) { + $is_paginated = true; $paginate = null; $this->view = $view; $this->routeparser = $routeparser; @@ -318,6 +319,9 @@ abstract class Pagination preg_replace("(%i)", $this->pages, _T("Last page (%i)")) ); } + if ($this->current_page == 1 && $this->current_page == $this->pages) { + $is_paginated = false; + } $options = array( 10 => "10", @@ -334,6 +338,7 @@ abstract class Pagination $view->getEnvironment()->addGlobal('nb_pages', $this->pages); $view->getEnvironment()->addGlobal('page', $this->current_page); $view->getEnvironment()->addGlobal('numrows', $this->show); + $view->getEnvironment()->addGlobal('is_paginated', $is_paginated); $view->getEnvironment()->addGlobal('pagination', $paginate); $view->getEnvironment()->addGlobal('nbshow_options', $options);