1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-09-17 10:40:12 +02:00

Redesigned the next/previous page switcher to allow direct access to any page.

This commit is contained in:
Hans-Emil Skogh 2011-12-22 20:37:57 +01:00
parent 8f50665e8c
commit ef4f189a1a

View File

@ -240,21 +240,31 @@ class FDroid
$out.=$matches;
$out.='<hr><p>';
if($query_vars['fdpage']==1) {
$out.="&lt;&lt;first ";
$out.="&lt;prev ";
} else {
$out.='<a href="'.makelink($query_vars, array('fdpage'=>1)).'">&lt;&lt;first</a> ';
$out.='<a href="'.makelink($query_vars, array('fdpage'=>($query_vars['fdpage']-1))).'">&lt;&lt;prev</a> ';
}
$out.='<div style="float:left;">';
$out.=' Page '.$query_vars['fdpage'].' of '.$numpages.' ';
if($query_vars['fdpage']==$numpages) {
$out.="next&gt; ";
$out.="last&gt;&gt; ";
} else {
$out.='</div>';
$out.='<div style="float:right;">';
if($query_vars['fdpage']!=$numpages) {
$out.='<a href="'.makelink($query_vars, array('fdpage'=>($query_vars['fdpage']+1))).'">next&gt;</a> ';
$out.='<a href="'.makelink($query_vars, array('fdpage'=>$numpages)).'">last&gt;&gt;</a> ';
}
$out.='</div>';
$out.='<div style="text-align:center;">';
for($i=1;$i<=$numpages;$i++) {
if($i == $query_vars['fdpage']) {
$out.='<b>'.$i.'</b>';
} else {
$out.='<a href="'.makelink($query_vars, array('fdpage'=>$i)).'">';
$out.=$i;
$out.='</a>';
}
$out.=' ';
}
$out.=' ';
$out.='</div>';
$out.='</p>';
} else if($query_vars['fdfilter']!='') {
$out.='<p>No matches</p>';