$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'));
}
/**
}
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);
}
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 = '';
* 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();