From 25911860e35982f0fceae87d78e973ac7366115f Mon Sep 17 00:00:00 2001 From: nicolasconnault Date: Fri, 7 Aug 2009 01:38:36 +0000 Subject: [PATCH] MDL-19799 Converted calls to print_paging_bar --- comment/lib.php | 2 +- lib/commentlib.php | 4 ++-- lib/tablelib.php | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/comment/lib.php b/comment/lib.php index b7ab9391c1..921c6df471 100644 --- a/comment/lib.php +++ b/comment/lib.php @@ -102,7 +102,7 @@ class comment_manager { $table->data[] = array($checkbox, $c->username, $c->content, $action); } print_table($table); - print_paging_bar($count, $page, $this->perpage, $CFG->wwwroot.'/comment/index.php?', 'page'); + echo $OUTPUT->paging_bar(moodle_paging_bar::make($count, $page, $this->perpage, $CFG->wwwroot.'/comment/index.php')); } /** diff --git a/lib/commentlib.php b/lib/commentlib.php index b76be189c0..38c9e1535f 100644 --- a/lib/commentlib.php +++ b/lib/commentlib.php @@ -411,7 +411,7 @@ EOD; } public function get_pagination($page = 0) { - global $DB, $CFG; + global $DB, $CFG, $OUTPUT; if (!$count = $DB->count_records_sql("SELECT COUNT(*) from {comments} c, {user} u WHERE u.id=c.userid AND c.contextid=? AND c.commentarea=? AND c.itemid=?", array($this->contextid, $this->commentarea, $this->itemid))) { } $pages = (int)ceil($count/$CFG->commentsperpage); @@ -420,7 +420,7 @@ EOD; } if (!empty(self::$nonjs)) { // used in non-js interface - return print_paging_bar($count, $page, $CFG->commentsperpage, $this->link.'&', $pagevar='page', false, true); + return $OUTPUT->paging_bar(moodle_paging_bar::make($count, $page, $CFG->commentsperpage, $this->link)); } else { // return ajax paging bar $str = ''; diff --git a/lib/tablelib.php b/lib/tablelib.php index 0419a8917c..e6c6d27250 100644 --- a/lib/tablelib.php +++ b/lib/tablelib.php @@ -990,6 +990,7 @@ class flexible_table { * This function is not part of the public api. */ function finish_html(){ + global $OUTPUT; if (!$this->started_output) { //no data has been added to the table. $this->print_nothing_to_display(); -- 2.39.5