diff options
author | Robin Appelman <icewind1991@gmail.com> | 2011-04-18 11:30:56 +0200 |
---|---|---|
committer | Robin Appelman <icewind1991@gmail.com> | 2011-04-18 11:31:01 +0200 |
commit | 900ece18e787b294aa1c424af543ec14817b2302 (patch) | |
tree | d492a342a7bc9c545f70ab7e5a1da4597f98c9f9 /lib/base.php | |
parent | 5249f09f70c670dcd7d34cac5c5c2ae617ae739b (diff) | |
download | nextcloud-server-900ece18e787b294aa1c424af543ec14817b2302.tar.gz nextcloud-server-900ece18e787b294aa1c424af543ec14817b2302.zip |
seperate view and logic for pagenavi
Diffstat (limited to 'lib/base.php')
-rw-r--r-- | lib/base.php | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/lib/base.php b/lib/base.php index ec305250809..352474e1e83 100644 --- a/lib/base.php +++ b/lib/base.php @@ -242,35 +242,20 @@ class OC_UTIL { public static function showPageNavi($pagecount,$page,$url) { $pagelinkcount=8; - $txt=''; if ($pagecount>1) { - $txt.='<center><table class="pager" cellspacing="0" cellpadding="0" border="0"><tr><td width="1">'; - - if ($page>'0') { - $txt.='<span class="pagerbutton1"><a href="'.$url.($page-1).'">prev</a> </span>'; - } - $txt.='</td><td width="1">'; - $pagestart=$page-$pagelinkcount; if($pagestart<0) $pagestart=0; $pagestop=$page+$pagelinkcount; if($pagestop>$pagecount) $pagestop=$pagecount; - if ($pagestart<>0) $txt.='...'; - for ($i=$pagestart; $i < $pagestop;$i++) { - if ($i<>$page) { - $txt.='<a href="'.$url.$i.'"> '.($i+1).' </a>'; - } else { - $txt.=' <b>'.($i+1).'</b> '; - } - } - if ($pagecount>$pagestop) $txt.='...'; - $txt.='</td><td width="1">'; - if (($page+1)<$pagecount) { - $txt.='<span class="pagerbutton2"><a href="'.$url.($page+1).'">next</a></span>'; - } - $txt.='</td></tr></table></center>'; + + $tmpl = new OC_TEMPLATE( '', 'part.pagenavi', '' ); + $tmpl->assign('page',$page); + $tmpl->assign('pagecount',$pagecount); + $tmpl->assign('pagestart',$pagestart); + $tmpl->assign('pagestop',$pagestop); + $tmpl->assign('url',$url); + $tmpl->printPage(); } - echo($txt); } |