r24548 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24547‎ | r24548 | r24549 >
Date:00:47, 3 August 2007
Author:rotem
Status:old
Tags:
Comment:
Fix RTL display of the upload form.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/SpecialUpload.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialUpload.php
@@ -668,7 +668,7 @@
669669 * @access private
670670 */
671671 function uploadWarning( $warning ) {
672 - global $wgOut;
 672+ global $wgOut, $wgContLang;
673673 global $wgUseCopyrightUpload;
674674
675675 $this->mSessionKey = $this->stashSession();
@@ -686,6 +686,8 @@
687687 $reup = wfMsgWikiHtml( 'reuploaddesc' );
688688 $titleObj = SpecialPage::getTitleFor( 'Upload' );
689689 $action = $titleObj->escapeLocalURL( 'action=submit' );
 690+ $align1 = $wgContLang->isRTL() ? 'left' : 'right';
 691+ $align2 = $wgContLang->isRTL() ? 'right' : 'left';
690692
691693 if ( $wgUseCopyrightUpload )
692694 {
@@ -709,16 +711,16 @@
710712 <table border='0'>
711713 <tr>
712714 <tr>
713 - <td align='right'>
 715+ <td align='$align1'>
714716 <input tabindex='2' type='submit' name='wpUpload' value=\"$save\" />
715717 </td>
716 - <td align='left'>$iw</td>
 718+ <td align='$align2'>$iw</td>
717719 </tr>
718720 <tr>
719 - <td align='right'>
 721+ <td align='$align1'>
720722 <input tabindex='2' type='submit' name='wpReUpload' value=\"{$reupload}\" />
721723 </td>
722 - <td align='left'>$reup</td>
 724+ <td align='$align2'>$reup</td>
723725 </tr>
724726 </tr>
725727 </table></form>\n" );
@@ -732,7 +734,7 @@
733735 * @access private
734736 */
735737 function mainUploadForm( $msg='' ) {
736 - global $wgOut, $wgUser;
 738+ global $wgOut, $wgUser, $wgContLang;
737739 global $wgUseCopyrightUpload, $wgUseAjax, $wgAjaxUploadDestCheck, $wgAjaxLicensePreview;
738740 global $wgRequest, $wgAllowCopyUploads, $wgEnableAPI;
739741 global $wgStylePath, $wgStyleVersion;
@@ -829,27 +831,29 @@
830832 }
831833
832834 $encComment = htmlspecialchars( $this->mComment );
 835+ $align1 = $wgContLang->isRTL() ? 'left' : 'right';
 836+ $align2 = $wgContLang->isRTL() ? 'right' : 'left';
833837
834838 $wgOut->addHTML( <<<EOT
835839 <form id='upload' method='post' enctype='multipart/form-data' action="$action">
836840 <table border='0'>
837841 <tr>
838842 {$this->uploadFormTextTop}
839 - <td align='right' valign='top'><label for='wpUploadFile'>{$sourcefilename}:</label></td>
840 - <td align='left'>
 843+ <td align='$align1' valign='top'><label for='wpUploadFile'>{$sourcefilename}:</label></td>
 844+ <td align='$align2'>
841845 {$filename_form}
842846 </td>
843847 </tr>
844848 <tr>
845 - <td align='right'><label for='wpDestFile'>{$destfilename}:</label></td>
846 - <td align='left'>
 849+ <td align='$align1'><label for='wpDestFile'>{$destfilename}:</label></td>
 850+ <td align='$align2'>
847851 <input tabindex='2' type='text' name='wpDestFile' id='wpDestFile' size='40'
848852 value="$encDestName" $destOnkeyup />
849853 </td>
850854 </tr>
851855 <tr>
852 - <td align='right'><label for='wpUploadDescription'>{$summary}</label></td>
853 - <td align='left'>
 856+ <td align='$align1'><label for='wpUploadDescription'>{$summary}</label></td>
 857+ <td align='$align2'>
854858 <textarea tabindex='3' name='wpUploadDescription' id='wpUploadDescription' rows='6'
855859 cols='{$cols}'{$ew}>$encComment</textarea>
856860 {$this->uploadFormTextAfterSummary}
@@ -862,8 +866,8 @@
863867 if ( $licenseshtml != '' ) {
864868 global $wgStylePath;
865869 $wgOut->addHTML( "
866 - <td align='right'><label for='wpLicense'>$license:</label></td>
867 - <td align='left'>
 870+ <td align='$align1'><label for='wpLicense'>$license:</label></td>
 871+ <td align='$align2'>
868872 <select name='wpLicense' id='wpLicense' tabindex='4'
869873 onchange='licenseSelectorCheck()'>
870874 <option value=''>$nolicense</option>
@@ -888,12 +892,12 @@
889893 $uploadsource = htmlspecialchars( $this->mCopyrightSource );
890894
891895 $wgOut->addHTML( "
892 - <td align='right' nowrap='nowrap'><label for='wpUploadCopyStatus'>$filestatus:</label></td>
 896+ <td align='$align1' nowrap='nowrap'><label for='wpUploadCopyStatus'>$filestatus:</label></td>
893897 <td><input tabindex='5' type='text' name='wpUploadCopyStatus' id='wpUploadCopyStatus'
894898 value=\"$copystatus\" size='40' /></td>
895899 </tr>
896900 <tr>
897 - <td align='right'><label for='wpUploadCopyStatus'>$filesource:</label></td>
 901+ <td align='$align1'><label for='wpUploadCopyStatus'>$filesource:</label></td>
898902 <td><input tabindex='6' type='text' name='wpUploadSource' id='wpUploadCopyStatus'
899903 value=\"$uploadsource\" size='40' /></td>
900904 </tr>
@@ -913,11 +917,11 @@
914918 $warningRow
915919 <tr>
916920 <td></td>
917 - <td align='left'><input tabindex='9' type='submit' name='wpUpload' value=\"{$ulb}\" /></td>
 921+ <td align='$align2'><input tabindex='9' type='submit' name='wpUpload' value=\"{$ulb}\" /></td>
918922 </tr>
919923 <tr>
920924 <td></td>
921 - <td align='left'>
 925+ <td align='$align2'>
922926 " );
923927 $wgOut->addWikiText( wfMsgForContent( 'edittools' ) );
924928 $wgOut->addHTML( "
@@ -1392,3 +1396,4 @@
13931397 }
13941398 }
13951399
 1400+
Index: trunk/phase3/RELEASE-NOTES
@@ -345,6 +345,7 @@
346346 * (bug 10769) Database::update() should return boolean result
347347 * Toggles in RTL preferences indented to the right, hidden in IE in some
348348 cases.
 349+* Fix RTL display of the upload form.
349350
350351 == API changes since 1.10 ==
351352

Follow-up revisions

RevisionCommit summaryAuthorDate
r24631Merged revisions 24480-24600 via svnmerge from...david18:39, 6 August 2007

Status & tagging log