From 190dc254cb47ad1e9d82b9e6acd7bf1de499104a Mon Sep 17 00:00:00 2001 From: Rotem Liss Date: Fri, 3 Aug 2007 00:47:49 +0000 Subject: [PATCH] Fix RTL display of the upload form. --- RELEASE-NOTES | 1 + includes/SpecialUpload.php | 41 +++++++++++++++++++++----------------- 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 8805167e5c..78548331a4 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -345,6 +345,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 10769) Database::update() should return boolean result * Toggles in RTL preferences indented to the right, hidden in IE in some cases. +* Fix RTL display of the upload form. == API changes since 1.10 == diff --git a/includes/SpecialUpload.php b/includes/SpecialUpload.php index 0affae1bc9..1c738cce6e 100644 --- a/includes/SpecialUpload.php +++ b/includes/SpecialUpload.php @@ -668,7 +668,7 @@ class UploadForm { * @access private */ function uploadWarning( $warning ) { - global $wgOut; + global $wgOut, $wgContLang; global $wgUseCopyrightUpload; $this->mSessionKey = $this->stashSession(); @@ -686,6 +686,8 @@ class UploadForm { $reup = wfMsgWikiHtml( 'reuploaddesc' ); $titleObj = SpecialPage::getTitleFor( 'Upload' ); $action = $titleObj->escapeLocalURL( 'action=submit' ); + $align1 = $wgContLang->isRTL() ? 'left' : 'right'; + $align2 = $wgContLang->isRTL() ? 'right' : 'left'; if ( $wgUseCopyrightUpload ) { @@ -709,16 +711,16 @@ class UploadForm { - - + - - +
+ $iw$iw
+ $reup$reup
\n" ); @@ -732,7 +734,7 @@ class UploadForm { * @access private */ function mainUploadForm( $msg='' ) { - global $wgOut, $wgUser; + global $wgOut, $wgUser, $wgContLang; global $wgUseCopyrightUpload, $wgUseAjax, $wgAjaxUploadDestCheck, $wgAjaxLicensePreview; global $wgRequest, $wgAllowCopyUploads, $wgEnableAPI; global $wgStylePath, $wgStyleVersion; @@ -829,27 +831,29 @@ wgAjaxLicensePreview = {$alp}; } $encComment = htmlspecialchars( $this->mComment ); + $align1 = $wgContLang->isRTL() ? 'left' : 'right'; + $align2 = $wgContLang->isRTL() ? 'right' : 'left'; $wgOut->addHTML( << {$this->uploadFormTextTop} - - + - - + - - + - + + - + @@ -913,11 +917,11 @@ EOT $warningRow - + -
+ {$filename_form}
+
+ {$this->uploadFormTextAfterSummary} @@ -862,8 +866,8 @@ EOT if ( $licenseshtml != '' ) { global $wgStylePath; $wgOut->addHTML( " - +
+ " ); $wgOut->addWikiText( wfMsgForContent( 'edittools' ) ); $wgOut->addHTML( " @@ -1392,3 +1396,4 @@ EOT } } + -- 2.20.1