diff --git a/css/styles.css b/css/styles.css index a186c17324..f0832d0594 100644 --- a/css/styles.css +++ b/css/styles.css @@ -70,7 +70,7 @@ form a { color:#000; text-decoration:none; } /* CONTENT ------------------------------------------------------------------ */ #content { margin:7em 0 0 16em; } -table { width:90%; margin:1em 5em 2em 3em; } +table { margin:1em 5em 2em 3em; } table tr.mouseOver td { background-color:#eee; } table th, table td { padding:0; border-bottom:1px solid #ddd; text-align:left; font-style:italic; } table th { padding:0.5em; } @@ -118,6 +118,23 @@ p.actions a.delete { background-image:url('../img/delete.png'); } #quota_indicator { margin:0 4em 1em 0; padding:0; border:1px solid #ddd; border-radius:10px; -webkit-border-radius:10px; -moz-border-radius:10px; } #quota_indicator div { background-color:#76A9EA; border-radius:10px; -webkit-border-radius:10px; -moz-border-radius:10px; } + +/* PAGER ------------------------------------------------------------ */ +.pager tr td +{ + border-bottom: 0px; +} + + +.pager tr td a +{ + text-decoration: none; + color: #666666; + font-size: 0.9em; + text-align: center; +} + + /* LOGS --------------------------------------------------------------------- */ #logs_options { width:auto; margin:0; } #logs_options p { padding:0.5em; text-align:left; } diff --git a/help/index.php b/help/index.php index e6a2d5661f..de461c2941 100644 --- a/help/index.php +++ b/help/index.php @@ -7,6 +7,11 @@ if( !OC_USER::isLoggedIn()){ exit(); } +//hardcode for testing +$pagecount=8; +$page=2; + + // Load the files we need OC_UTIL::addStyle( "help", "help" ); OC_APP::setActiveNavigationEntry( "help" ); @@ -16,6 +21,8 @@ $kbe=OC_OCSCLIENT::getKnownledgebaseEntries(); $tmpl = new OC_TEMPLATE( "help", "index", "admin" ); $tmpl->assign( "kbe", $kbe ); +$tmpl->assign( "pagecount", $pagecount ); +$tmpl->assign( "page", $page ); $tmpl->printPage(); ?> diff --git a/help/templates/index.php b/help/templates/index.php index b8444c556e..262ab3d8ca 100644 --- a/help/templates/index.php +++ b/help/templates/index.php @@ -1,7 +1,7 @@

Questions and Answers

- +
@@ -13,6 +13,10 @@
+ ASK A QUESTION diff --git a/lib/base.php b/lib/base.php index fad4007aa1..ec30525080 100644 --- a/lib/base.php +++ b/lib/base.php @@ -231,6 +231,48 @@ class OC_UTIL { return date($timeformat,$timestamp); } + /** + * Shows a pagenavi widget where you can jump to different pages. + * + * @param int $pagecount + * @param int $page + * @param string $url + * @return html-string + */ + public static function showPageNavi($pagecount,$page,$url) { + + $pagelinkcount=8; + $txt=''; + if ($pagecount>1) { + $txt.='
'; + + if ($page>'0') { + $txt.='prev  '; + } + $txt.=''; + + $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.=' '.($i+1).' '; + } else { + $txt.=' '.($i+1).' '; + } + } + if ($pagecount>$pagestop) $txt.='...'; + $txt.=''; + if (($page+1)<$pagecount) { + $txt.='next'; + } + $txt.='
'; + } + echo($txt); + } + /**