* Bidi-aid on list pages

* Some lists with bidi titles should be more readable now
This commit is contained in:
Niklas Laxström 2006-05-01 21:17:31 +00:00
parent 5b946d32df
commit 6136b2fee4
14 changed files with 23 additions and 16 deletions

View 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 ==

View 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
*

View 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);
}
}

View 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);
}
}

View 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);
}
}

View 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);
}
}

View 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);
}
}

View 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);
}
}

View 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);
}
}

View 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);
}
}

View 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);
}
}

View 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);
}
}

View 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);
}
/**

View file

@ -861,6 +861,7 @@ class Language {
* @return bool
*/
function isRTL() { return false; }
function getDirMark() { return $this->isRTL() ? '‏' : '‎'; }
/**
* To allow "foo[[bar]]" to extend the link over the whole word "foobar"