From 4d177f5d131ce38dfc3a9fb87b14fcd7a702a18d Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Wed, 10 Jan 2007 06:03:14 +0000 Subject: [PATCH] XHTML validity --- includes/Linker.php | 19 +++++++++++++++++++ skins/MonoBook.php | 46 ++++++++++++++++++++++----------------------- 2 files changed, 42 insertions(+), 23 deletions(-) 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 {