MDL-46625 theme: Added a way to target the current page
This commit is contained in:
@@ -2354,7 +2354,7 @@ class paging_bar implements renderable {
|
||||
$displaypage = $currpage + 1;
|
||||
|
||||
if ($this->page == $currpage) {
|
||||
$this->pagelinks[] = $displaypage;
|
||||
$this->pagelinks[] = html_writer::span($displaypage, 'current-page');
|
||||
} else {
|
||||
$pagelink = html_writer::link(new moodle_url($this->baseurl, array($this->pagevar=>$currpage)), $displaypage);
|
||||
$this->pagelinks[] = $pagelink;
|
||||
|
||||
@@ -389,7 +389,7 @@ EOF;
|
||||
}
|
||||
|
||||
public function test_prepare() {
|
||||
$expecteda = array('1',
|
||||
$expecteda = array('<span class="current-page">1</span>',
|
||||
'<a href="index.php?page=1">2</a>',
|
||||
'<a href="index.php?page=2">3</a>',
|
||||
'<a href="index.php?page=3">4</a>',
|
||||
@@ -400,7 +400,7 @@ EOF;
|
||||
);
|
||||
$expectedb = array('<a href="page?page=3">4</a>',
|
||||
'<a href="page?page=4">5</a>',
|
||||
'6',
|
||||
'<span class="current-page">6</span>',
|
||||
'<a href="page?page=6">7</a>',
|
||||
'<a href="page?page=7">8</a>',
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user