From: Brion Vibber Date: Sun, 1 Feb 2004 09:20:19 +0000 (+0000) Subject: Fix RTL for toc contents and section edit links X-Git-Tag: 1.3.0beta1~1043 X-Git-Url: http://git.cyclocoop.org/?a=commitdiff_plain;h=895b9e5d8dec7f93565a7d1532330a96bd925753;p=lhc%2Fweb%2Fwiklou.git Fix RTL for toc contents and section edit links --- diff --git a/includes/Skin.php b/includes/Skin.php index c6ce5304a2..7cfe75bf4d 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -2183,23 +2183,18 @@ class Skin { } function tocTable($toc) { - // note to CSS fanatics: putting this in a div does not work -- div won't auto-expand - global $printable, $wgLang; - - if (!$printable) { - $hideline = " "; - } - if( $wgLang->isRTL() ) { - $rtl = ' dir="rtl"'; - } else { - $rtl = ""; - } - return - "

\n". - "".wfMsg("toc")."" . - $hideline . - "
\n". - $toc."

\n"; + // note to CSS fanatics: putting this in a div does not work -- div won't auto-expand + global $printable; + + if (!$printable) { + $hideline = " "; + } + return + "

\n". + "".wfMsg("toc")."" . + $hideline . + "
\n". + $toc."

\n"; } # These two do not check for permissions: check $wgTitle->userCanEdit before calling them @@ -2212,14 +2207,23 @@ class Skin { } function editSectionLink($section) { - - global $printable; - global $wgTitle,$wgUser,$oldid; - if($oldid) return ""; - if ($printable) return ""; - $editurl="§ion={$section}"; - $url=$this->makeKnownLink($wgTitle->getPrefixedText(),wfMsg("editsection"),"action=edit".$editurl); - return "

[".$url."]
"; + global $printable,$oldid; + global $wgTitle, $wgUser, $wgLang; + + if( isset( $oldid ) ) return ""; + if( isset( $printable ) ) return ""; + + $editurl = "§ion={$section}"; + $url = $this->makeKnownLink($wgTitle->getPrefixedText(),wfMsg("editsection"),"action=edit".$editurl); + + if( $wgLang->isRTL() ) { + $farside = "left"; + $nearside = "right"; + } else { + $farside = "right"; + $nearside = "left"; + } + return "
[".$url."]
"; }