diff options
Diffstat (limited to 'core/include')
-rw-r--r-- | core/include/category/list.php | 3 | ||||
-rw-r--r-- | core/include/category/main.php | 3 | ||||
-rw-r--r-- | core/include/home.php | 9 | ||||
-rw-r--r-- | core/include/page/list.php | 4 | ||||
-rw-r--r-- | core/include/post/list.php | 3 | ||||
-rw-r--r-- | core/include/user/list.php | 4 |
6 files changed, 20 insertions, 6 deletions
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 ?? [], diff --git a/core/include/home.php b/core/include/home.php index bc73bef..2893f0e 100644 --- a/core/include/home.php +++ b/core/include/home.php @@ -19,11 +19,18 @@ foreach($posts as $Post) { } #=============================================================================== +# Pagination +#=============================================================================== +$count = $PostRepository->getCount(); +$lastSite = ceil($count / Application::get('POST.LIST_SIZE')); + +#=============================================================================== # Build document #=============================================================================== $HomeTemplate = Template\Factory::build('home'); $HomeTemplate->set('PAGINATION', [ - 'HTML' => generatePostNaviTemplate(1) + 'HTML' => createPaginationTemplate( + 1, $lastSite, Application::getPostURL()) ]); $HomeTemplate->set('LIST', [ 'POSTS' => $templates ?? [] diff --git a/core/include/page/list.php b/core/include/page/list.php index f7541fa..8cfbce5 100644 --- a/core/include/page/list.php +++ b/core/include/page/list.php @@ -55,7 +55,9 @@ $ListTemplate = Template\Factory::build('page/list'); $ListTemplate->set('PAGINATION', [ 'THIS' => $currentSite, 'LAST' => $lastSite, - 'HTML' => generatePageNaviTemplate($currentSite) + 'HTML' => createPaginationTemplate( + $currentSite, $lastSite, Application::getPageURL() + ) ]); $ListTemplate->set('LIST', [ 'PAGES' => $templates ?? [] diff --git a/core/include/post/list.php b/core/include/post/list.php index 4599883..ab48552 100644 --- a/core/include/post/list.php +++ b/core/include/post/list.php @@ -55,7 +55,8 @@ $ListTemplate = Template\Factory::build('post/list'); $ListTemplate->set('PAGINATION', [ 'THIS' => $currentSite, 'LAST' => $lastSite, - 'HTML' => generatePostNaviTemplate($currentSite) + 'HTML' => createPaginationTemplate( + $currentSite, $lastSite, Application::getPostURL()) ]); $ListTemplate->set('LIST', [ 'POSTS' => $templates ?? [] diff --git a/core/include/user/list.php b/core/include/user/list.php index f6f794a..f4aec77 100644 --- a/core/include/user/list.php +++ b/core/include/user/list.php @@ -53,7 +53,9 @@ $ListTemplate = Template\Factory::build('user/list'); $ListTemplate->set('PAGINATION', [ 'THIS' => $currentSite, 'LAST' => $lastSite, - 'HTML' => generateUserNaviTemplate($currentSite) + 'HTML' => createPaginationTemplate( + $currentSite, $lastSite, Application::getUserURL() + ) ]); $ListTemplate->set('LIST', [ 'USERS' => $templates ?? [] |