features time - a feature that allows to disable a feature!
authorDomas Mituzas <midom@users.mediawiki.org>
Mon, 7 Sep 2009 18:38:40 +0000 (18:38 +0000)
committerDomas Mituzas <midom@users.mediawiki.org>
Mon, 7 Sep 2009 18:38:40 +0000 (18:38 +0000)
(rationale: allows turning off relatively expensive code that generates invisible stuff :)

includes/DefaultSettings.php
includes/Linker.php

index d0b806f..698ec27 100644 (file)
@@ -3466,6 +3466,11 @@ $wgDisabledActions = array();
  */
 $wgDisableHardRedirects = false;
 
+/**
+ * Disable tooltips and access keys
+ */
+$wgDisableTooltipsAndAccesskeys = false;
+
 /**
  * Use http.dnsbl.sorbs.net to check for open proxies
  */
index 821611d..a25013b 100644 (file)
@@ -1941,6 +1941,9 @@ class Linker {
         * @deprecated Returns raw bits of HTML, use titleAttrib() and accesskey()
         */
        public function tooltipAndAccesskey( $name ) {
+               global $wgDisableTooltipsAndAccesskeys;
+               if ($wgDisableTooltipsAndAccesskeys)
+                       return array();
                # FIXME: If Sanitizer::expandAttributes() treated "false" as "output
                # no attribute" instead of "output '' as value for attribute", this
                # would be three lines.
@@ -1959,6 +1962,9 @@ class Linker {
 
        /** @deprecated Returns raw bits of HTML, use titleAttrib() */
        public function tooltip( $name, $options = null ) {
+               global $wgDisableTooltipsAndAccesskeys;
+               if ($wgDisableTooltipsAndAccesskeys)
+                       return array();
                # FIXME: If Sanitizer::expandAttributes() treated "false" as "output
                # no attribute" instead of "output '' as value for attribute", this
                # would be two lines.