Using a new function, Language::getArrow, to check the direction, instead of hard...
authorRotem Liss <rotem@users.mediawiki.org>
Sun, 6 Aug 2006 18:08:21 +0000 (18:08 +0000)
committerRotem Liss <rotem@users.mediawiki.org>
Sun, 6 Aug 2006 18:08:21 +0000 (18:08 +0000)
includes/SpecialBrokenRedirects.php
includes/SpecialDisambiguations.php
includes/SpecialDoubleRedirects.php
includes/SpecialListredirects.php
languages/Language.php

index e5c2dd8..653e13e 100644 (file)
@@ -68,7 +68,7 @@ class BrokenRedirectsPage extends PageQueryPage {
                $from = $skin->makeKnownLinkObj( $fromObj ,'', 'redirect=no' );
                $edit = $skin->makeBrokenLinkObj( $fromObj , "(".wfMsg("qbedit").")" , 'redirect=no');
                $to   = $skin->makeBrokenLinkObj( $toObj );
-               $arr = $wgContLang->isRTL() ? '&larr;' : '&rarr;';
+               $arr = $wgContLang->getArrow();
 
                return "$from $edit $arr $to";
        }
index 1a0297a..f57b732 100644 (file)
@@ -23,7 +23,6 @@ class DisambiguationsPage extends PageQueryPage {
                global $wgUser;
                $sk = $wgUser->getSkin();
 
-               #FIXME : probably need to add a backlink to the maintenance page.
                return '<p>'.wfMsg('disambiguationstext', $sk->makeKnownLink(wfMsgForContent('disambiguationspage')) )."</p><br />\n";
        }
 
@@ -57,14 +56,16 @@ class DisambiguationsPage extends PageQueryPage {
        }
 
        function formatResult( $skin, $result ) {
+               global $wgContLang;
                $title = Title::newFromId( $result->value );
                $dp = Title::makeTitle( $result->namespace, $result->title );
 
                $from = $skin->makeKnownLinkObj( $title,'');
                $edit = $skin->makeBrokenLinkObj( $title, "(".wfMsg("qbedit").")" , 'redirect=no');
+               $arr  = $wgContLang->getArrow();
                $to   = $skin->makeKnownLinkObj( $dp,'');
 
-               return "$from $edit => $to";
+               return "$from $edit $arr $to";
        }
 }
 
index fe480f6..fe42b00 100644 (file)
@@ -87,7 +87,7 @@ class DoubleRedirectsPage extends PageQueryPage {
                $edit = $skin->makeBrokenLinkObj( $titleA, "(".wfMsg("qbedit").")" , 'redirect=no');
                $linkB = $skin->makeKnownLinkObj( $titleB, '', 'redirect=no' );
                $linkC = $skin->makeKnownLinkObj( $titleC );
-               $arr = $wgContLang->isRTL() ? '&larr;' : '&rarr;';
+               $arr = $wgContLang->getArrow() . $wgContLang->getDirMark();
 
                return( "{$linkA} {$edit} {$arr} {$linkB} {$arr} {$linkC}" );
        }
index a7ae44f..0dca85a 100644 (file)
@@ -32,6 +32,7 @@ class ListredirectsPage extends QueryPage {
        
                # Make a link to the redirect itself
                $rd_title = Title::makeTitle( $result->namespace, $result->title );
+               $arr = $wgContLang->getArrow() . $wgContLang->getDirMark();
                $rd_link = $skin->makeKnownLinkObj( $rd_title, '', 'redirect=no' );
 
                # Find out where the redirect leads
@@ -50,10 +51,6 @@ class ListredirectsPage extends QueryPage {
                        $targetLink = '*';
                }
 
-               # Check the language; RTL wikis need a &larr;
-               $arr = $wgContLang->isRTL() ? ' &larr; ' : ' &rarr; ';
-               $arr .= $wgContLang->getDirMark();
-
                # Format the whole thing and return it
                return( $rd_link . $arr . $targetLink );
 
index 33e5f46..2a8fb99 100644 (file)
@@ -884,16 +884,27 @@ class Language {
         *
         * @return string
         */
-       function getDirMark() { return $this->isRTL() ? "\xE2\x80\x8F" : "\xE2\x80\x8E"; }
+       function getDirMark() {
+               return $this->isRTL() ? "\xE2\x80\x8F" : "\xE2\x80\x8E";
+       }
+
+       /**
+        * An arrow, depending on the language direction
+        *
+        * @return string
+        */
+       function getArrow() {
+               return $this->isRTL() ? '←' : '→';
+       }
 
        /**
         * To allow "foo[[bar]]" to extend the link over the whole word "foobar"
         *
         * @return bool
         */
-       function linkPrefixExtension() { 
+       function linkPrefixExtension() {
                $this->load();
-               return $this->linkPrefixExtension; 
+               return $this->linkPrefixExtension;
        }
 
        function &getMagicWords() {