]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-19756 Added $disabled value to html_link, which will be true if the link's URL...
authornicolasconnault <nicolasconnault>
Wed, 9 Sep 2009 03:52:49 +0000 (03:52 +0000)
committernicolasconnault <nicolasconnault>
Wed, 9 Sep 2009 03:52:49 +0000 (03:52 +0000)
lib/outputcomponents.php
theme/standard/styles_fonts.css

index 9ec7e55ed1631d5057151ad17ad0a7209f9885c8..aad58be8060150a9f4b8c424434a9768d5dd0e62 100644 (file)
@@ -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();
index c4c6dabe3946978dee5b66b88c129a2ee7afd4e3..cccfb14368169417be873795035981b22cae1a33 100644 (file)
@@ -187,6 +187,7 @@ a.useredit, a:hover.useredit, .blink {
 
 .currentlink {
   font-style: italic;
+  display: inline;
 }
 /***
  *** Header