From: Aryeh Gregor Date: Wed, 10 Jan 2007 06:03:14 +0000 (+0000) Subject: XHTML validity X-Git-Tag: 1.31.0-rc.0~54539 X-Git-Url: http://git.cyclocoop.org/%22.%20generer_url_ecrire%28%22sites_tous%22%2C%22%22%29.%20%22?a=commitdiff_plain;h=4d177f5d131ce38dfc3a9fb87b14fcd7a702a18d;p=lhc%2Fweb%2Fwiklou.git XHTML validity --- diff --git a/includes/Linker.php b/includes/Linker.php index 192597ac6a..3fe7c70d35 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -1229,6 +1229,25 @@ class Linker { } return $out; } + + /** + * Given the id of an interface element (minus any prefixes such as 'n-'), + * constructs the appropriate title attribute from the system messages. + * + * @param string $name Id of the element, minus prefixes. + * @return string title attribute, ready to drop in an element + * (e.g., ' title="This does something"'). + */ + public function tooltip($name) { + $out = ''; + + $tooltip = wfMsg('tooltip-'.$name); + if (!wfEmptyMsg('tooltip-'.$name, $tooltip) && $tooltip != '-') { + $out = ' title="'.htmlspecialchars($tooltip).'"'; + } + + return $out; + } } ?> diff --git a/skins/MonoBook.php b/skins/MonoBook.php index 8e68e9ca0b..f2fa598ef3 100644 --- a/skins/MonoBook.php +++ b/skins/MonoBook.php @@ -123,9 +123,9 @@ class MonoBookTemplate extends QuickTemplate {
@@ -136,9 +136,9 @@ class MonoBookTemplate extends QuickTemplate {
    data['personal_urls'] as $key => $item) { ?> -
  • tooltipAndAccesskey($key) ?>" class="active">"tooltipAndAccesskey($key) ?> class="">
  • @@ -148,19 +148,19 @@ class MonoBookTemplate extends QuickTemplate {
data['sidebar'] as $bar => $cont) { ?> -
tooltipAndAccesskey($bar) ?>> +
tooltip($bar) ?>>
@@ -186,46 +186,46 @@ class MonoBookTemplate extends QuickTemplate {