* Bidi-aid on list pages
authorNiklas Laxström <nikerabbit@users.mediawiki.org>
Mon, 1 May 2006 21:17:31 +0000 (21:17 +0000)
committerNiklas Laxström <nikerabbit@users.mediawiki.org>
Mon, 1 May 2006 21:17:31 +0000 (21:17 +0000)
* Some lists with bidi titles should be more readable now

14 files changed:
RELEASE-NOTES
includes/GlobalFunctions.php
includes/SpecialAncientpages.php
includes/SpecialCategories.php
includes/SpecialListusers.php
includes/SpecialMostcategories.php
includes/SpecialMostimages.php
includes/SpecialMostlinked.php
includes/SpecialMostlinkedcategories.php
includes/SpecialMostrevisions.php
includes/SpecialPopularpages.php
includes/SpecialWantedcategories.php
includes/SpecialWantedpages.php
languages/Language.php

index 853cd1f..b50ecfc 100644 (file)
@@ -182,6 +182,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 361) URL in URL, they were almost fixed. Now they are.
 * (bug 4876) Add __NEWSECTIONLINK__ magic word to force the "new section" link/tab to
   show up on specific pages on demand
+* Bidi-aid on list pages
 
 == Compatibility ==
 
index d30dd97..59a8191 100644 (file)
@@ -1621,6 +1621,12 @@ function in_string( $needle, $str ) {
        return strpos( $str, $needle ) !== false;
 }
 
+function wfSpecialList( $page, $details ) {
+       global $wgContLang;
+       $details = $details ? $wgContLang->getDirMark() . " ($details)" : "";
+       return $page . $details;
+}
+
 /**
  * Returns a regular expression of url protocols
  *
index f25caf4..a0fcef7 100644 (file)
@@ -55,7 +55,7 @@ class AncientPagesPage extends QueryPage {
                $d = $wgLang->timeanddate( wfTimestamp( TS_MW, $result->value ), true );
                $title = Title::makeTitle( $result->namespace, $result->title );
                $link = $skin->makeKnownLinkObj( $title, htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) ) );
-               return "{$link} ({$d})";
+               return wfSpecialList($link, $d);
        }
 }
 
index ccfd369..45d266a 100644 (file)
@@ -53,7 +53,7 @@ class CategoriesPage extends QueryPage {
                $title = Title::makeTitle( NS_CATEGORY, $result->title );
                $plink = $skin->makeLinkObj( $title, $title->getText() );
                $nlinks = wfMsg( 'nlinks', $result->count );
-               return "$plink ($nlinks)";
+               return wfSpecialList($plink, $nlinks);
        }
 }
 
index 17cc923..46244a3 100644 (file)
@@ -176,6 +176,7 @@ class ListUsersPage extends QueryPage {
        function formatResult( $skin, $result ) {
                $userPage = Title::makeTitle( $result->namespace, $result->title );
                $name = $skin->makeLinkObj( $userPage, htmlspecialchars( $userPage->getText() ) );
+               $groups = null;
 
                if( !isset( $result->numgroups ) || $result->numgroups > 0 ) {
                        $dbr =& wfGetDB( DB_SLAVE );
@@ -190,14 +191,12 @@ class ListUsersPage extends QueryPage {
                        $dbr->freeResult( $result );
 
                        if( count( $groups ) > 0 ) {
-                               $name .= ' (' .
-                                       $skin->makeLink( wfMsgForContent( 'administrators' ),
-                                               htmlspecialchars( implode( ', ', $groups ) ) ) .
-                                       ')';
+                               $groups = $skin->makeLink( wfMsgForContent( 'administrators' ),
+                                               htmlspecialchars( implode( ', ', $groups ) ) );
                        }
                }
 
-               return $name;
+               return wfSpecialList($name, $groups);
        }
 }
 
index 17dbb5d..2a188d9 100644 (file)
@@ -50,7 +50,7 @@ class MostcategoriesPage extends QueryPage {
                $nl = wfMsg( 'ncategories', $result->value );
                $nlink = $skin->makeKnownLink( $wgContLang->specialPage( 'Categories' ), $nl, 'article=' . $nt->getPrefixedURL() );
 
-               return "{$plink} ({$nlink})";
+               return wfSpecialList($plink, $nlink);
        }
 }
 
index 5a072a5..a10e5a1 100644 (file)
@@ -48,7 +48,7 @@ class MostimagesPage extends QueryPage {
                $nl = wfMsg( 'nlinks', $result->value );
                $nlink = $skin->makeKnownLink( $nt->getPrefixedText() . '#filelinks', $nl );
 
-               return "$plink ($nlink)";
+               return wfSpecialList($plink, $nlink);
        }
 }
 
index 6b51860..88a85a5 100644 (file)
@@ -58,7 +58,7 @@ class MostlinkedPage extends QueryPage {
                $nl = wfMsg( 'nlinks', $result->value );
                $nlink = $skin->makeKnownLink( $wgContLang->specialPage( 'Whatlinkshere' ), $nl, 'target=' . $nt->getPrefixedURL() );
 
-               return "{$plink} ({$nlink})";
+               return wfSpecialList($plink, $nlink);
        }
 }
 
index 2f6f2b0..a3b1562 100644 (file)
@@ -65,7 +65,7 @@ class MostlinkedCategoriesPage extends QueryPage {
                $plink = $skin->makeLinkObj( $nt, htmlspecialchars( $text ) );
 
                $nlinks = wfMsg( 'nlinks', $result->value );
-               return "$plink ($nlinks)";
+               return wfSpecialList($plink, $nlinks);
        }
 }
 
index 6bc807e..c8a04a5 100644 (file)
@@ -52,7 +52,7 @@ class MostrevisionsPage extends QueryPage {
                $nl = wfMsg( 'nrevisions', $result->value );
                $nlink = $skin->makeKnownLinkObj( $nt, $nl, 'action=history' );
 
-               return "$plink ($nlink)";
+               return wfSpecialList($plink, $nlink);
        }
 }
 
index 7a9557d..e5242c3 100644 (file)
@@ -45,7 +45,7 @@ class PopularPagesPage extends QueryPage {
                $title = Title::makeTitle( $result->namespace, $result->title );
                $link = $skin->makeKnownLinkObj( $title, htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) ) );
                $nv = wfMsg( "nviews", $wgLang->formatNum( $result->value ) );
-               return "{$link} ({$nv})";
+               return wfSpecialList($link, $nv);
        }
 }
 
index b78e0ae..df152aa 100644 (file)
@@ -69,7 +69,7 @@ class WantedCategoriesPage extends QueryPage {
                        $skin->makeBrokenLinkObj( $nt, htmlspecialchars( $text ) );
 
                $nlinks = wfMsg( 'nlinks', $result->value );
-               return "$plink ($nlinks)";
+               return wfSpecialList($plink, $nlinks);
        }
 }
 
index dcae3ec..100c6c0 100644 (file)
@@ -91,10 +91,10 @@ class WantedPagesPage extends QueryPage {
                
                # Make a link to "what links here" if it's required
                $wlhLink = $this->nlinks
-                                       ? " (" . $this->makeWlhLink( $title, $skin, wfMsgHtml( 'nlinks', $result->value ) ) . ")"
+                                       ? $this->makeWlhLink( $title, $skin, wfMsgHtml( 'nlinks', $result->value ) )
                                        : "";
                                        
-               return "{$pageLink}{$wlhLink}";
+               return wfSpecialList($pageLink, $wlhLink);
        }
        
        /**
index 50169a9..17b5d12 100644 (file)
@@ -861,6 +861,7 @@ class Language {
         * @return bool
         */
        function isRTL() { return false; }
+       function getDirMark() { return $this->isRTL() ? '&rlm;' : '&lrm;'; }
 
        /**
         * To allow "foo[[bar]]" to extend the link over the whole word "foobar"