From f5f94531c9d5b369fdf9c287f63c41476496e5ee Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Fri, 2 Jul 2021 20:17:42 +0200 Subject: Add generic function to create pagination template This commit adds and uses the new function createPaginationTemplate to create the generic pagination template for various entity lists. This function replaces the many old confusing functions: * generateNaviTemplate * generatePageNaviTemplate * generatePostNaviTemplate * generateUserNaviTemplate * generateCategoryNaviTemplate * generateCategoryPostNaviTemplate --- core/include/category/list.php | 3 ++- core/include/category/main.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'core/include/category') diff --git a/core/include/category/list.php b/core/include/category/list.php index 4702a79..3a5720b 100644 --- a/core/include/category/list.php +++ b/core/include/category/list.php @@ -52,7 +52,8 @@ $ListTemplate = Template\Factory::build('category/list'); $ListTemplate->set('PAGINATION', [ 'THIS' => $currentSite, 'LAST' => $lastSite, - 'HTML' => generateCategoryNaviTemplate($currentSite) + 'HTML' => createPaginationTemplate( + $currentSite, $lastSite, Application::getCategoryURL()) ]); $ListTemplate->set('LIST', [ 'CATEGORIES' => $templates ?? [] diff --git a/core/include/category/main.php b/core/include/category/main.php index 066ea26..b1bea72 100644 --- a/core/include/category/main.php +++ b/core/include/category/main.php @@ -111,7 +111,8 @@ $CategoryTemplate->set('COUNT', [ $CategoryTemplate->set('PAGINATION', [ 'THIS' => $currentSite, 'LAST' => $lastSite, - 'HTML' => generateCategoryPostNaviTemplate($currentSite, $Category) + 'HTML' => createPaginationTemplate( + $currentSite, $lastSite, Application::getEntityURL($Category)) ]); $CategoryTemplate->set('LIST', [ 'POSTS' => $post_templates ?? [], -- cgit v1.2.3