* More BIDI-fixes to special pages
authorNiklas Laxström <nikerabbit@users.mediawiki.org>
Mon, 8 May 2006 16:41:05 +0000 (16:41 +0000)
committerNiklas Laxström <nikerabbit@users.mediawiki.org>
Mon, 8 May 2006 16:41:05 +0000 (16:41 +0000)
includes/SpecialImagelist.php
includes/SpecialNewpages.php
includes/SpecialShortpages.php
includes/SpecialUnusedimages.php
includes/SpecialUnusedtemplates.php
includes/SpecialUnwatchedpages.php

index 5ef203f..b797216 100644 (file)
@@ -9,7 +9,7 @@
  *
  */
 function wfSpecialImagelist() {
-       global $wgUser, $wgOut, $wgLang, $wgRequest, $wgMiserMode;
+       global $wgUser, $wgOut, $wgLang, $wgContLang, $wgRequest, $wgMiserMode;
 
        $sort = $wgRequest->getVal( 'sort' );
        $wpIlMatch = $wgRequest->getText( 'wpIlMatch' );
@@ -95,6 +95,8 @@ function wfSpecialImagelist() {
                        $ul = $sk->makeLinkObj( Title::makeTitle( NS_USER, $ut ), $ut );
                }
 
+               $dirmark = $wgContLang->getDirMark(); // to keep text in correct direction
+
                $ilink = "<a href=\"" . htmlspecialchars( Image::imageUrl( $name ) ) .
                  "\">" . strtr(htmlspecialchars( $name ), '_', ' ') . "</a>";
 
@@ -107,7 +109,8 @@ function wfSpecialImagelist() {
                $date = $wgLang->timeanddate( $s->img_timestamp, true );
                $comment = $sk->commentBlock( $s->img_description );
 
-               $l = "({$desc}) {$ilink} . . {$nb} . . {$ul} . . {$date} {$comment}<br />\n";
+               $l = "({$desc}) {$dirmark}{$ilink} . . {$dirmark}{$nb} . . {$dirmark}{$ul}".
+                       " . . {$dirmark}{$date} . . {$dirmark}{$comment}<br />\n";
                $wgOut->addHTML( $l );
        }
 
index c67a24b..3f72352 100644 (file)
@@ -75,6 +75,7 @@ class NewPagesPage extends QueryPage {
                global $wgLang, $wgContLang, $wgUser, $wgUseRCPatrol;
                $u = $result->user;
                $ut = $result->user_text;
+               $dirmark = $wgContLang->getDirMark(); // To keep text in correct order
 
                $length = wfMsgExt( 'nbytes', array('parsemag', 'escape'),
                        $wgLang->formatNum( $result->length ) );
@@ -89,10 +90,12 @@ class NewPagesPage extends QueryPage {
                        $link = $skin->makeKnownLink( $ns . ':' . $result->title, '' );
                }
 
-               $userTools = $skin->userLink( $u, $ut ) . $skin->userToolLinks( $u, $ut );
+               $userLink = $skin->userLink( $u, $ut );
+               $userTools = $skin->userToolLinks( $u, $ut );
 
-               $s = "{$d} {$link} ({$length}) . . {$userTools}";
-               $s .= $skin->commentBlock( $result->comment );
+               $s = "{$d} {$dirmark}{$link} {$dirmark}({$length}) . . " .
+                       "{$dirmark}{$userLink}{$dirmark}{$userTools}";
+               $s .= $dirmark . $skin->commentBlock( $result->comment );
                return $s;
        }
 
index 6867b80..5381e2f 100644 (file)
@@ -58,7 +58,9 @@ class ShortPagesPage extends QueryPage {
                $title = Title::makeTitle( $result->namespace, $result->title );
                $link = $skin->makeKnownLinkObj( $title, htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) ) );
                $histlink = $skin->makeKnownLinkObj( $title, wfMsgHtml('hist'), 'action=history' );
-               return "({$histlink}) $link ({$nb})";
+               $dirmark = $wgContLang->getDirMark();
+
+               return "({$histlink}) {$dirmark}$link {$dirmark}({$nb})";
        }
 }
 
index f6fccfb..fa76c57 100644 (file)
@@ -48,17 +48,25 @@ class UnusedimagesPage extends QueryPage {
                $title = Title::makeTitle( NS_IMAGE, $result->title );
 
                $imageUrl = htmlspecialchars( Image::imageUrl( $result->title ) );
+               $dirmark = $wgContLang->getDirMark(); // To keep text in correct order
+
                $return =
                # The 'desc' linking to the image page
-               '('.$skin->makeKnownLinkObj( $title, wfMsg('imgdesc') ).') '
+               '('.$skin->makeKnownLinkObj( $title, wfMsg('imgdesc') ).') ' . $dirmark .
+
                # Link to the image itself
-               . '<a href="' . $imageUrl . '">' . htmlspecialchars( $title->getText() ) . '</a>'
+               '<a href="' . $imageUrl . '">' . htmlspecialchars( $title->getText() ) .
+                       '</a> . . ' . $dirmark .
+
                # Last modified date
-               . ' . . '.$wgLang->timeanddate($result->value)
+               $wgLang->timeanddate($result->value) . ' . . ' . $dirmark .
+
                # Link to username
-               . ' . . '.$skin->makeLinkObj( Title::makeTitle( NS_USER, $result->img_user_text ), $result->img_user_text)
+               $skin->makeLinkObj( Title::makeTitle( NS_USER, $result->img_user_text ),
+                       $result->img_user_text) . $dirmark .
+
                # If there is a description, show it
-               $skin->commentBlock( $wgContLang->convert( $result->img_description ) );
+               $skin->commentBlock( $wgContLang->convert( $result->img_description ) );
 
                return $return;
        }
index 8782b81..422c5a2 100644 (file)
@@ -43,7 +43,7 @@ class UnusedtemplatesPage extends QueryPage {
                        Title::makeTitle( NS_SPECIAL, 'Whatlinkshere' ),
                        wfMsgHtml( 'unusedtemplateswlh' ),
                        'target=' . $title->getPrefixedUrl() );
-               return( $pageLink . ' (' . $wlhLink . ')' );
+               return wfSpecialList( $pageLink, $wlhLink );
        }
 
        function getPageHeader() {
index aca2a33..8cc0802 100644 (file)
@@ -51,7 +51,7 @@ class UnwatchedpagesPage extends QueryPage {
                $plink = $skin->makeKnownLinkObj( $nt, htmlspecialchars( $text ) );
                $wlink = $skin->makeKnownLinkObj( $nt, wfMsgHtml( 'watch' ), 'action=watch' );
 
-               return $plink . ' (' . $wlink . ')';
+               return wfSpecialList( $plink, $wlink );
        }
 }