From 2196f0031331bfbc894e6a409175c1cb9335acdf Mon Sep 17 00:00:00 2001 From: Domas Mituzas Date: Mon, 7 Sep 2009 18:38:40 +0000 Subject: [PATCH] features time - a feature that allows to disable a feature! (rationale: allows turning off relatively expensive code that generates invisible stuff :) --- includes/DefaultSettings.php | 5 +++++ includes/Linker.php | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index d0b806f63d..698ec27d94 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -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 */ diff --git a/includes/Linker.php b/includes/Linker.php index 821611d054..a25013b06a 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -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. -- 2.20.1