Skip to content

Commit

Permalink
MDL-46625 theme: Added a way to target the current page
Browse files Browse the repository at this point in the history
  • Loading branch information
marsh0lion committed Jul 31, 2014
1 parent cc1dc85 commit 5bb55ee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/outputcomponents.php
Expand Up @@ -2354,7 +2354,7 @@ public function prepare(renderer_base $output, moodle_page $page, $target) {
$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;
Expand Down
4 changes: 2 additions & 2 deletions lib/tests/outputcomponents_test.php
Expand Up @@ -389,7 +389,7 @@ public function test_multilang_support() {
}

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>',
Expand All @@ -400,7 +400,7 @@ public function test_prepare() {
);
$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>',
);
Expand Down

0 comments on commit 5bb55ee

Please sign in to comment.