/* 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; }
#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; }
exit();
}
+//hardcode for testing
+$pagecount=8;
+$page=2;
+
+
// Load the files we need
OC_UTIL::addStyle( "help", "help" );
$tmpl = new OC_TEMPLATE( "help", "index", "admin" );
$tmpl->assign( "kbe", $kbe );
+$tmpl->assign( "pagecount", $pagecount );
+$tmpl->assign( "page", $page );
$tmpl->printPage();
?>
<h1>Questions and Answers</h1>
-<table cellspacing="0">
+<table cellspacing="0" width="100%">
<tbody>
<?php foreach($_["kbe"] as $kb): ?>
<tr>
<?php endforeach; ?>
</tbody>
</table>
+<?php
+ $url=OC_HELPER::linkTo( "help", "index.php" ).'?page=';
+ OC_UTIL::showPageNavi($_['pagecount'],$_['page'],$url);
+?>
<a target="_blank" class="prettybutton" href="http://apps.owncloud.com/knowledgebase/editquestion.php?action=new">ASK A QUESTION</a>
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.='<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>';
+ }
+ echo($txt);
+ }
+
/**