Merged fixes for MDL-7425 from 1.8 stable

This commit is contained in:
moodler
2007-08-30 06:01:57 +00:00
parent 79081e871b
commit 7b0d5cd551
2 changed files with 10 additions and 2 deletions
+5 -1
View File
@@ -342,7 +342,11 @@
// be moved up and down beyond the paging border
if ($totalcount > $perpage) {
$atfirstpage = ($page == 0);
$atlastpage = (($page + 1) == ceil($totalcount / $perpage));
if ($perpage > 0) {
$atlastpage = (($page + 1) == ceil($totalcount / $perpage));
} else {
$atlastpage = true;
}
} else {
$atfirstpage = true;
$atlastpage = true;
+5 -1
View File
@@ -5665,7 +5665,11 @@ function print_paging_bar($totalcount, $page, $perpage, $baseurl, $pagevar='page
$output .= '&nbsp;(<a href="'. $baseurl->out(false, array($pagevar => $pagenum)).'">'. get_string('previous') .'</a>)&nbsp;';
}
}
$lastpage = ceil($totalcount / $perpage);
if ($perpage > 0) {
$lastpage = ceil($totalcount / $perpage);
} else {
$lastpage = 1;
}
if ($page > 15) {
$startpage = $page - 10;
if (!is_a($baseurl, 'moodle_url')){