New default theme #82

Merged
kazhnuz merged 36 commits from feat/new-default-theme into koblog2 2025-07-27 16:03:24 +02:00
Showing only changes of commit 2401727a20 - Show all commits

View file

@ -141,6 +141,55 @@ class Paginator {
return $html;
}
public static function numberedPageHTML() {
global $L;
$maxDistance = 2;
if (self::get('numberOfPages') <= 1) {
return "";
}
$html = '<div id="paginator">';
$html .= '<ul>';
if(self::get('showPrev'))
{
$html .= '<li class="left">';
$html .= '<a aria-label="'.$L->g('Previous page').'" href="'.self::previousPageUrl().'">←</a>';
$html .= '</li>';
}
for ($i=1; $i <= self::get('numberOfPages'); $i++) {
if ($i <= 1 || $i >= self::get('numberOfPages') || abs($i - self::currentPage()) < $maxDistance) {
if ($i == self::currentPage()) {
$html .= '<li class="pagination-page">';
$html .= '<span class="current-page">'.($i).'</span>';
$html .= '</li>';
} else {
$html .= '<li class="pagination-page">';
$html .= '<a href="'.self::numberUrl($i).'">'.($i).'</a>';
$html .= '</li>';
}
} elseif (abs($i - self::currentPage()) == $maxDistance) {
$html .= '<li class="pagination-page">';
$html .= '<span>…</span>';
$html .= '</li>';
}
}
if(self::get('showNext'))
{
$html .= '<li class="left">';
$html .= '<a aria-label="'.$L->g('Next page').'" href="'.self::nextPageUrl().'">→</a>';
$html .= '</li>';
}
$html .= '</ul>';
$html .= '</div>';
return $html;
}
/*
* Bootstrap Pagination
*/