BetterDirectionality fixes:
authorRobin Pepermans <robin@users.mediawiki.org>
Mon, 11 Jul 2011 00:39:41 +0000 (00:39 +0000)
committerRobin Pepermans <robin@users.mediawiki.org>
Mon, 11 Jul 2011 00:39:41 +0000 (00:39 +0000)
* SkinTemplate: also set <div class="mw-content-ltr/rtl"> when action = historysubmit, so a diff displays correctly when you clicked on the "compare selected revisions" button on the history page
* ImagePage: set a dir attribute (according to the site content language) for the user comment in the file history
* FlaggedRevs: use CSS class sitedir-ltr/rtl instead of ambiguous rtl class

includes/ImagePage.php
includes/SkinTemplate.php

index 6f7ad74..956977e 100644 (file)
@@ -883,7 +883,7 @@ class ImageHistoryList {
         * @return string
         */
        public function imageHistoryLine( $iscur, $file ) {
-               global $wgUser, $wgLang;
+               global $wgUser, $wgLang, $wgContLang;
 
                $timestamp = wfTimestamp( TS_MW, $file->getTimestamp() );
                $img = $iscur ? $file->getName() : $file->getArchiveName();
@@ -1014,15 +1014,14 @@ class ImageHistoryList {
                                $row .= htmlspecialchars( $usertext );
                        }
                }
-               $row .= '</td><td>';
+               $row .= '</td>';
 
                // Don't show deleted descriptions
                if ( $file->isDeleted( File::DELETED_COMMENT ) ) {
-                       $row .= '<span class="history-deleted">' . wfMsgHtml( 'rev-deleted-comment' ) . '</span>';
+                       $row .= '<td><span class="history-deleted">' . wfMsgHtml( 'rev-deleted-comment' ) . '</span></td>';
                } else {
-                       $row .= Linker::commentBlock( $description, $this->title );
+                       $row .= '<td dir="' . $wgContLang->getDir() . '">' . Linker::commentBlock( $description, $this->title ) . '</td>';
                }
-               $row .= '</td>';
 
                $rowClass = null;
                wfRunHooks( 'ImagePageFileHistoryLine', array( $this, $file, &$row, &$rowClass ) );
index 8fef85f..898a048 100644 (file)
@@ -453,7 +453,7 @@ class SkinTemplate extends Skin {
                # not for special pages or file pages AND only when viewing AND if the page exists
                # (or is in MW namespace, because that has default content)
                if( !in_array( $this->getTitle()->getNamespace(), array( NS_SPECIAL, NS_FILE ) ) &&
-                       in_array( $action, array( 'view', 'render', 'print' ) ) &&
+                       in_array( $action, array( 'view', 'render', 'print', 'historysubmit' ) ) &&
                        ( $this->getTitle()->exists() || $this->getTitle()->getNamespace() == NS_MEDIAWIKI ) ) {
                        $pageLang = $this->getTitle()->getPageLanguage();
                        $realBodyAttribs = array( 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir(),