From 4e412c459d62db982ceaa9299f519b2ae7fc98cc Mon Sep 17 00:00:00 2001 From: nicolasconnault Date: Fri, 7 Aug 2009 01:37:44 +0000 Subject: [PATCH] MDL-19808 Converted calls to print_paging_bar --- mod/forum/lib.php | 4 ++-- mod/forum/search.php | 7 ++++--- mod/forum/user.php | 9 ++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/mod/forum/lib.php b/mod/forum/lib.php index 29c932fb1c..047e30d7c7 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -5527,7 +5527,7 @@ function forum_print_latest_discussions($course, $forum, $maxdiscussions=-1, $di $numdiscussions = forum_get_discussions_count($cm); ///Show the paging bar - print_paging_bar($numdiscussions, $page, $perpage, "view.php?f=$forum->id&"); + echo $OUTPUT->paging_bar(moodle_paging_bar::make($numdiscussions, $page, $perpage, "view.php?f=$forum->id")); if ($numdiscussions > 1000) { // saves some memory on sites with very large forums $replies = forum_count_discussion_replies($forum->id, $sort, $maxdiscussions, $page, $perpage); @@ -5667,7 +5667,7 @@ function forum_print_latest_discussions($course, $forum, $maxdiscussions=-1, $di } if ($page != -1) { ///Show the paging bar - print_paging_bar($numdiscussions, $page, $perpage, "view.php?f=$forum->id&"); + echo $OUTPUT->paging_bar(moodle_paging_bar::make($numdiscussions, $page, $perpage, "view.php?f=$forum->id")); } } diff --git a/mod/forum/search.php b/mod/forum/search.php index c31ae464f3..57cc06fa37 100644 --- a/mod/forum/search.php +++ b/mod/forum/search.php @@ -159,8 +159,9 @@ echo ''; echo $OUTPUT->heading("$strsearchresults: $totalcount"); - - print_paging_bar($totalcount, $page, $perpage, "search.php?search=".urlencode($search)."&id=$course->id&perpage=$perpage&"); + + $url = new moodle_url('search.php', array('search' => urlencode($search), 'id' => $course->id, 'perpage' => $perpage)); + echo $OUTPUT->paging_bar(moodle_paging_bar::make($totalcount, $page, $perpage, $url)); //added to implement highlighting of search terms found only in HTML markup //fiedorow - 9/2/2005 @@ -236,7 +237,7 @@ $fulllink, $strippedsearch, -99, false); } - print_paging_bar($totalcount, $page, $perpage, "search.php?search=".urlencode($search)."&id=$course->id&perpage=$perpage&"); + echo $OUTPUT->paging_bar(moodle_paging_bar::make($totalcount, $page, $perpage, $url)); echo $OUTPUT->footer(); diff --git a/mod/forum/user.php b/mod/forum/user.php index 9221c6ce2c..76392cfb95 100644 --- a/mod/forum/user.php +++ b/mod/forum/user.php @@ -96,9 +96,9 @@ if ($course->id == SITEID) { // Get the posts. if ($posts = forum_search_posts($searchterms, $searchcourse, $page*$perpage, $perpage, $totalcount, $extrasql)) { - - print_paging_bar($totalcount, $page, $perpage, - "user.php?id=$user->id&course=$course->id&mode=$mode&perpage=$perpage&"); + + $baseurl = new moodle_url('user.php', array('id' => $user->id, 'course' => $course->id, 'mode' => $mode, 'perpage' => $perpage)); + echo $OUTPUT->paging_bar(moodle_paging_bar::make($totalcount, $page, $perpage, $baseurl)); $discussions = array(); $forums = array(); @@ -165,8 +165,7 @@ if ($posts = forum_search_posts($searchterms, $searchcourse, $page*$perpage, $pe echo "
"; } - print_paging_bar($totalcount, $page, $perpage, - "user.php?id=$user->id&course=$course->id&mode=$mode&perpage=$perpage&"); + echo $OUTPUT->paging_bar(moodle_paging_bar::make($totalcount, $page, $perpage, $baseurl)); } else { if ($mode == 'posts') { echo $OUTPUT->heading(get_string('noposts', 'forum')); -- 2.39.5