*/
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
$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();