From 284943fcd027ae1c02ad343f02b316072d331569 Mon Sep 17 00:00:00 2001 From: nicolasconnault Date: Wed, 9 Sep 2009 03:52:49 +0000 Subject: [PATCH] MDL-19756 Added $disabled value to html_link, which will be true if the link's URL compares with the $PAGE->url (order of params doesn't matter). A disabled link will render as italicised text by default. --- lib/outputcomponents.php | 7 ++++++- theme/standard/styles_fonts.css | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/outputcomponents.php b/lib/outputcomponents.php index 9ec7e55ed1..aad58be806 100644 --- a/lib/outputcomponents.php +++ b/lib/outputcomponents.php @@ -1259,6 +1259,11 @@ class html_link extends moodle_html_component { */ public $disabled = false; + /** + * @var boolean $disableifcurrent Whether or not this link should be disabled if it the same as the current page + */ + public $disableifcurrent = false; + /** * @see lib/moodle_html_component#prepare() Disables the link if it links to the current page. * @return void @@ -1274,7 +1279,7 @@ class html_link extends moodle_html_component { $this->url = new moodle_url($this->url); } - if ($this->url->compare($PAGE->url, URL_MATCH_PARAMS)) { + if ($this->url->compare($PAGE->url, URL_MATCH_PARAMS) && $this->disableifcurrent) { $this->disabled = true; } parent::prepare(); diff --git a/theme/standard/styles_fonts.css b/theme/standard/styles_fonts.css index c4c6dabe39..cccfb14368 100644 --- a/theme/standard/styles_fonts.css +++ b/theme/standard/styles_fonts.css @@ -187,6 +187,7 @@ a.useredit, a:hover.useredit, .blink { .currentlink { font-style: italic; + display: inline; } /*** *** Header -- 2.39.5