Quellcode durchsuchen

Remove buttons from paginator when are not need it

Diego Najar vor 6 Jahren
Ursprung
Commit
5779635bd4
1 geänderte Dateien mit 8 neuen und 7 gelöschten Zeilen
  1. 8 7
      bl-themes/alternative/php/home.php

+ 8 - 7
bl-themes/alternative/php/home.php

@@ -84,22 +84,23 @@
 	<ul class="pagination flex-wrap justify-content-center">
 
 		<!-- Previous button -->
-		<li class="page-item mr-2 <?php if (!Paginator::showPrev()) echo 'disabled' ?>">
+		<?php if (Paginator::showPrev()): ?>
+		<li class="page-item mr-2">
 			<a class="page-link" href="<?php echo Paginator::previousPageUrl() ?>" tabindex="-1">&#9664; <?php echo $L->get('Previous'); ?></a>
 		</li>
+		<?php endif; ?>
 
 		<!-- Home button -->
-		<?php if (Paginator::currentPage() > 1): ?>
-		<li class="page-item">
-			<a class="page-link" href="<?php echo Theme::siteUrl() ?>">Home</a>
+		<li class="page-item <?php if (Paginator::currentPage()==1) echo 'disabled' ?>">
+			<a class="page-link" href="<?php echo Theme::siteUrl() ?>"><?php echo $L->get('Home'); ?></a>
 		</li>
-		<?php endif ?>
 
 		<!-- Next button -->
-		<li class="page-item ml-2 <?php if (!Paginator::showNext()) echo 'disabled' ?>">
+		<?php if (Paginator::showNext()): ?>
+		<li class="page-item ml-2">
 			<a class="page-link" href="<?php echo Paginator::nextPageUrl() ?>"><?php echo $L->get('Next'); ?> &#9658;</a>
 		</li>
-
+		<?php endif; ?>
 	</ul>
 </nav>
 <?php endif ?>