mirror of
https://github.com/moodle/moodle.git
synced 2025-03-18 14:40:06 +01:00
"MDL-19118, improve comments pagination"
This commit is contained in:
parent
d0e36ce531
commit
3e34183a97
@ -265,7 +265,7 @@ M.core_comment = {
|
||||
register_pagination: function() {
|
||||
var scope = this;
|
||||
// page buttons
|
||||
Y.all('#comment-paging-'+this.client_id+' a').each(
|
||||
Y.all('#comment-pagination-'+this.client_id+' a').each(
|
||||
function(node, id) {
|
||||
node.on('click', function(e, node) {
|
||||
var id = node.get('id');
|
||||
|
@ -313,12 +313,14 @@ EOD;
|
||||
// in comments block, we print comments list right away
|
||||
if ($this->env == 'block_comments') {
|
||||
$html .= $this->print_comments(0, true, false);
|
||||
}
|
||||
|
||||
$html .= <<<EOD
|
||||
$html .= '</ul>';
|
||||
$html .= $this->get_pagination(0);
|
||||
} else {
|
||||
$html .= <<<EOD
|
||||
</ul>
|
||||
<div id="comment-pagination-{$this->cid}" class="comment-pagination"></div>
|
||||
EOD;
|
||||
}
|
||||
|
||||
// print posting textarea
|
||||
if (!empty($this->postcap)) {
|
||||
@ -369,7 +371,7 @@ EOD;
|
||||
if (empty($this->viewcap)) {
|
||||
return false;
|
||||
}
|
||||
$CFG->commentsperpage = 3;
|
||||
$CFG->commentsperpage = 15;
|
||||
if (!is_numeric($page)) {
|
||||
$page = 0;
|
||||
}
|
||||
@ -435,7 +437,7 @@ EOD;
|
||||
} else {
|
||||
// return ajax paging bar
|
||||
$str = '';
|
||||
$str .= '<div class="comment-paging" id="comment-paging-'.$this->cid.'">';
|
||||
$str .= '<div class="comment-paging" id="comment-pagination-'.$this->cid.'">';
|
||||
for ($p=0; $p<$pages; $p++) {
|
||||
$extra = '';
|
||||
if ($p == $page) {
|
||||
@ -551,8 +553,8 @@ EOD;
|
||||
|
||||
if ($nonjs) {
|
||||
$html .= '</ul>';
|
||||
$html .= $this->get_pagination($page);
|
||||
}
|
||||
$html .= $this->get_pagination($page);
|
||||
$sesskey = sesskey();
|
||||
$returnurl = qualified_me();
|
||||
$strsubmit = get_string('submit');
|
||||
|
Loading…
x
Reference in New Issue
Block a user