"MDL-21943, fixed paging class name"

This commit is contained in:
Dongsheng Cai 2010-03-29 05:29:53 +00:00
parent b1d124d1df
commit c794595d5f
2 changed files with 10 additions and 6 deletions

View file

@ -87,6 +87,10 @@ class comment {
public function __construct($options) { public function __construct($options) {
global $CFG, $DB; global $CFG, $DB;
if (empty($CFG->commentsperpage)) {
$CFG->commentsperpage = 15;
}
$this->viewcap = false; $this->viewcap = false;
$this->postcap = false; $this->postcap = false;
@ -371,7 +375,6 @@ EOD;
if (empty($this->viewcap)) { if (empty($this->viewcap)) {
return false; return false;
} }
$CFG->commentsperpage = 15;
if (!is_numeric($page)) { if (!is_numeric($page)) {
$page = 0; $page = 0;
} }
@ -439,11 +442,12 @@ EOD;
$str = ''; $str = '';
$str .= '<div class="comment-paging" id="comment-pagination-'.$this->cid.'">'; $str .= '<div class="comment-paging" id="comment-pagination-'.$this->cid.'">';
for ($p=0; $p<$pages; $p++) { for ($p=0; $p<$pages; $p++) {
$extra = '';
if ($p == $page) { if ($p == $page) {
$class = ' curpage '; $class = 'curpage';
} else {
$class = 'pageno';
} }
$str .= '<a class="pageno '.$class.'" href="###" id="comment-page-'.$this->cid.'-'.$p.'">'.($p+1).'</a> '; $str .= '<a class="'.$class.'" href="###" id="comment-page-'.$this->cid.'-'.$p.'">'.($p+1).'</a> ';
} }
$str .= '</div>'; $str .= '</div>';
} }

View file

@ -314,8 +314,8 @@ table.mod_index {width:100%;}
.comment-list {font-size: 11px;overflow:auto;list-style:none;padding:0;margin:0;} .comment-list {font-size: 11px;overflow:auto;list-style:none;padding:0;margin:0;}
.comment-list li {margin: 2px;margin-bottom:5px;clear:both;} .comment-list li {margin: 2px;margin-bottom:5px;clear:both;}
.comment-paging{text-align:center;} .comment-paging{text-align:center;}
.comment-paging .pageno{padding: 2px;} .comment-paging .pageno{padding:2px;}
.comment-paging .curpage{border:1px solid grey} .comment-paging .curpage{border:1px solid #CCC;}
.comment-userpicture {width: 20px;float:left;} .comment-userpicture {width: 20px;float:left;}
.comment-content {margin-left: 22px;} .comment-content {margin-left: 22px;}
.comment-content div {margin:0;padding:0;} .comment-content div {margin:0;padding:0;}