Page MenuHomePhabricator

mediawiki-1.7-rtl-tables.patch

Authored By
bzimport
Nov 21 2014, 9:22 PM
Size
18 KB
Referenced Files
None
Subscribers
None

mediawiki-1.7-rtl-tables.patch

diff --exclude=.svn -ur phase3_bak/includes/SpecialAllpages.php phase3/includes/SpecialAllpages.php
--- phase3_bak/includes/SpecialAllpages.php 2006-05-31 19:09:03.000000000 +0200
+++ phase3/includes/SpecialAllpages.php 2006-05-28 14:32:35.000000000 +0200
@@ -50,7 +50,7 @@
* @param string $from Article name we are starting listing at.
*/
function namespaceForm ( $namespace = NS_MAIN, $from = '' ) {
- global $wgScript;
+ global $wgScript, $wgLang;
$t = Title::makeTitle( NS_SPECIAL, $this->name );
$namespaceselect = HTMLnamespaceselector($namespace, null);
@@ -59,17 +59,19 @@
. htmlspecialchars ( $from ) . '"/>';
$submitbutton = '<input type="submit" value="' . wfMsgHtml( 'allpagessubmit' ) . '" />';
+ $left = ($wgLang->isRTL()) ? "right" : "left";
+ $right = ($wgLang->isRTL()) ? "left" : "right";
$out = "<div class='namespaceoptions'><form method='get' action='{$wgScript}'>";
$out .= '<input type="hidden" name="title" value="'.$t->getPrefixedText().'" />';
$out .= "
<table id='nsselect' class='allpages'>
<tr>
- <td align='right'>" . wfMsgHtml($this->nsfromMsg) . "</td>
- <td align='left'><label for='nsfrom'>$frombox</label></td>
+ <td align='$right'>" . wfMsgHtml($this->nsfromMsg) . "</td>
+ <td align='$left'><label for='nsfrom'>$frombox</label></td>
</tr>
<tr>
- <td align='right'><label for='namespace'>" . wfMsgHtml('namespace') . "</label></td>
- <td align='left'>
+ <td align='$right'><label for='namespace'>" . wfMsgHtml('namespace') . "</label></td>
+ <td align='$left'>
$namespaceselect $submitbutton
</td>
</tr>
@@ -171,9 +173,12 @@
} else {
$morelinks = '';
if ( $morelinks != '' ) {
+ global $wgLang;
+ $left = ($wgLang->isRTL()) ? "right" : "left";
+ $right = ($wgLang->isRTL()) ? "left" : "right";
$out2 = '<table style="background: inherit;" width="100%" cellpadding="0" cellspacing="0" border="0">';
- $out2 .= '<tr valign="top"><td align="left">' . $nsForm;
- $out2 .= '</td><td align="right" style="font-size: smaller; margin-bottom: 1em;">';
+ $out2 .= "<tr valign=\"top\"><td align=\"$left\">" . $nsForm;
+ $out2 .= "</td><td align=\"$right\" style=\"font-size: smaller; margin-bottom: 1em;\">";
$out2 .= $morelinks . '</td></tr></table><hr />';
} else {
$out2 = $nsForm . '<hr />';
@@ -189,7 +194,7 @@
* @param integer $namespace (Default NS_MAIN)
*/
function showline( $inpoint, $outpoint, $namespace = NS_MAIN ) {
- global $wgUser;
+ global $wgUser, $wgLang;
$sk = $wgUser->getSkin();
$dbr =& wfGetDB( DB_SLAVE );
@@ -199,12 +204,14 @@
$special = Title::makeTitle( NS_SPECIAL, $this->name . '/' . $inpoint );
$link = $special->escapeLocalUrl( $queryparams );
+ $left = ($wgLang->isRTL()) ? "right" : "left";
+ $right = ($wgLang->isRTL()) ? "left" : "right";
$out = wfMsgHtml(
'alphaindexline',
"<a href=\"$link\">$inpointf</a></td><td><a href=\"$link\">",
- "</a></td><td align=\"left\"><a href=\"$link\">$outpointf</a>"
+ "</a></td><td align=\"$left\"><a href=\"$link\">$outpointf</a>"
);
- return '<tr><td align="right">'.$out.'</td></tr>';
+ return "<tr><td align=\"$right\">$out</td></tr>";
}
/**
@@ -212,7 +219,7 @@
* @param string $from list all pages from this name (default FALSE)
*/
function showChunk( $namespace = NS_MAIN, $from, $including = false ) {
- global $wgOut, $wgUser, $wgContLang;
+ global $wgOut, $wgUser, $wgLang, $wgContLang;
$fname = 'indexShowChunk';
@@ -278,10 +286,13 @@
if ( $including ) {
$out2 = '';
} else {
+ global $wgLang;
$nsForm = $this->namespaceForm ( $namespace, $from );
+ $left = ($wgLang->isRTL()) ? "right" : "left";
+ $right = ($wgLang->isRTL()) ? "left" : "right";
$out2 = '<table style="background: inherit;" width="100%" cellpadding="0" cellspacing="0" border="0">';
- $out2 .= '<tr valign="top"><td align="left">' . $nsForm;
- $out2 .= '</td><td align="right" style="font-size: smaller; margin-bottom: 1em;">' .
+ $out2 .= "<tr valign=\"top\"><td align=\"$left\">" . $nsForm;
+ $out2 .= "</td><td align=\"$right\" style=\"font-size: smaller; margin-bottom: 1em;\">" .
$sk->makeKnownLink( $wgContLang->specialPage( "Allpages" ),
wfMsgHtml ( 'allpages' ) );
if ( ($n == $this->maxPerPage) && ($s = $dbr->fetchObject( $res )) ) {
diff --exclude=.svn -ur phase3_bak/includes/SpecialBlockip.php phase3/includes/SpecialBlockip.php
--- phase3_bak/includes/SpecialBlockip.php 2006-05-31 19:09:03.000000000 +0200
+++ phase3/includes/SpecialBlockip.php 2006-05-27 19:01:21.000000000 +0200
@@ -49,10 +49,13 @@
}
function showForm( $err ) {
- global $wgOut, $wgUser, $wgSysopUserBans;
+ global $wgOut, $wgUser, $wgSysopUserBans, $wgLang;
$wgOut->setPagetitle( wfMsg( 'blockip' ) );
$wgOut->addWikiText( wfMsg( 'blockiptext' ) );
+
+ $left = ($wgLang->isRTL()) ? "right" : "left";
+ $right = ($wgLang->isRTL()) ? "left" : "right";
if($wgSysopUserBans) {
$mIpaddress = wfMsgHtml( 'ipadressorusername' );
@@ -100,16 +103,16 @@
<form id=\"blockip\" method=\"post\" action=\"{$action}\">
<table border='0'>
<tr>
- <td align=\"right\">{$mIpaddress}:</td>
- <td align=\"left\">
+ <td align=\"{$right}\">{$mIpaddress}:</td>
+ <td align=\"${left}\">
<input tabindex='1' type='text' size='20' name=\"wpBlockAddress\" value=\"{$scBlockAddress}\" />
</td>
</tr>
<tr>");
if ($showblockoptions) {
$wgOut->addHTML("
- <td align=\"right\">{$mIpbexpiry}:</td>
- <td align=\"left\">
+ <td align=\"${right}\">{$mIpbexpiry}:</td>
+ <td align=\"${left}\">
<select tabindex='2' id='wpBlockExpiry' name=\"wpBlockExpiry\" onchange=\"considerChangingExpiryFocus()\">
$blockExpiryFormOptions
</select>
@@ -119,20 +122,20 @@
$wgOut->addHTML("
</tr>
<tr id='wpBlockOther'>
- <td align=\"right\">{$mIpbother}:</td>
- <td align=\"left\">
+ <td align=\"${right}\">{$mIpbother}:</td>
+ <td align=\"${left}\">
<input tabindex='3' type='text' size='40' name=\"wpBlockOther\" value=\"{$scBlockOtherTime}\" />
</td>
</tr>
<tr>
- <td align=\"right\">{$mIpbreason}:</td>
- <td align=\"left\">
+ <td align=\"${right}\">{$mIpbreason}:</td>
+ <td align=\"${left}\">
<input tabindex='3' type='text' size='40' name=\"wpBlockReason\" value=\"{$scBlockReason}\" />
</td>
</tr>
<tr>
<td>&nbsp;</td>
- <td align=\"left\">
+ <td align=\"${left}\">
<input tabindex='4' type='submit' name=\"wpBlock\" value=\"{$mIpbsubmit}\" />
</td>
</tr>
diff --exclude=.svn -ur phase3_bak/includes/SpecialPreferences.php phase3/includes/SpecialPreferences.php
--- phase3_bak/includes/SpecialPreferences.php 2006-05-31 19:09:03.000000000 +0200
+++ phase3/includes/SpecialPreferences.php 2006-05-28 17:26:07.000000000 +0200
@@ -437,7 +437,10 @@
}
function addRow($td1, $td2) {
- return "<tr><td align='right'>$td1</td><td align='left'>$td2</td></tr>";
+ global $wgLang;
+ $left = ($wgLang->isRTL()) ? "right" : "left";
+ $right = ($wgLang->isRTL()) ? "left" : "right";
+ return "<tr><td align='{$right}'>$td1</td><td align='{$left}'>$td2</td></tr>";
}
/**
diff --exclude=.svn -ur phase3_bak/includes/SpecialUpload.php phase3/includes/SpecialUpload.php
--- phase3_bak/includes/SpecialUpload.php 2006-05-31 19:09:03.000000000 +0200
+++ phase3/includes/SpecialUpload.php 2006-05-27 18:15:52.000000000 +0200
@@ -514,6 +514,7 @@
function uploadWarning( $warning ) {
global $wgOut;
global $wgUseCopyrightUpload;
+ global $wgLang;
$this->mSessionKey = $this->stashSession();
if( !$this->mSessionKey ) {
@@ -531,6 +532,8 @@
$titleObj = Title::makeTitle( NS_SPECIAL, 'Upload' );
$action = $titleObj->escapeLocalURL( 'action=submit' );
+ $left = ($wgLang->isRTL()) ? "right" : "left";
+ $right = ($wgLang->isRTL()) ? "left" : "right";
if ( $wgUseCopyrightUpload )
{
$copyright = "
@@ -553,16 +556,16 @@
<table border='0'>
<tr>
<tr>
- <td align='right'>
+ <td align='${right}'>
<input tabindex='2' type='submit' name='wpUpload' value=\"$save\" />
</td>
- <td align='left'>$iw</td>
+ <td align='${left}'>$iw</td>
</tr>
<tr>
- <td align='right'>
+ <td align='${right}'>
<input tabindex='2' type='submit' name='wpReUpload' value=\"{$reupload}\" />
</td>
- <td align='left'>$reup</td>
+ <td align='${left}'>$reup</td>
</tr>
</tr>
</table></form>\n" );
@@ -578,6 +581,7 @@
function mainUploadForm( $msg='' ) {
global $wgOut, $wgUser;
global $wgUseCopyrightUpload;
+ global $wgLang;
$cols = intval($wgUser->getOption( 'cols' ));
$ew = $wgUser->getOption( 'editwidth' );
@@ -616,24 +620,26 @@
? 'checked="checked"'
: '';
+ $left = ($wgLang->isRTL()) ? "right" : "left";
+ $right = ($wgLang->isRTL()) ? "left" : "right";
$wgOut->addHTML( "
<form id='upload' method='post' enctype='multipart/form-data' action=\"$action\">
<table border='0'>
<tr>
- <td align='right'><label for='wpUploadFile'>{$sourcefilename}:</label></td>
- <td align='left'>
+ <td align='{$right}'><label for='wpUploadFile'>{$sourcefilename}:</label></td>
+ <td align='{$left}'>
<input tabindex='1' type='file' name='wpUploadFile' id='wpUploadFile' " . ($this->mDestFile?"":"onchange='fillDestFilename()' ") . "size='40' />
</td>
</tr>
<tr>
- <td align='right'><label for='wpDestFile'>{$destfilename}:</label></td>
- <td align='left'>
+ <td align='{$right}'><label for='wpDestFile'>{$destfilename}:</label></td>
+ <td align='{$left}'>
<input tabindex='2' type='text' name='wpDestFile' id='wpDestFile' size='40' value=\"$encDestFile\" />
</td>
</tr>
<tr>
- <td align='right'><label for='wpUploadDescription'>{$summary}</label></td>
- <td align='left'>
+ <td align='{$right}'><label for='wpUploadDescription'>{$summary}</label></td>
+ <td align='{$left}'>
<textarea tabindex='3' name='wpUploadDescription' id='wpUploadDescription' rows='6' cols='{$cols}'{$ew}>" . htmlspecialchars( $this->mUploadDescription ) . "</textarea>
</td>
</tr>
@@ -642,8 +648,8 @@
if ( $licenseshtml != '' ) {
global $wgStylePath;
$wgOut->addHTML( "
- <td align='right'><label for='wpLicense'>$license:</label></td>
- <td align='left'>
+ <td align='{$right}'><label for='wpLicense'>$license:</label></td>
+ <td align='{$left}'>
<script type='text/javascript' src=\"$wgStylePath/common/upload.js\"></script>
<select name='wpLicense' id='wpLicense' tabindex='4'
onchange='licenseSelectorCheck()'>
@@ -663,11 +669,11 @@
$uploadsource = htmlspecialchars( $this->mUploadSource );
$wgOut->addHTML( "
- <td align='right' nowrap='nowrap'><label for='wpUploadCopyStatus'>$filestatus:</label></td>
+ <td align='${right}' nowrap='nowrap'><label for='wpUploadCopyStatus'>$filestatus:</label></td>
<td><input tabindex='5' type='text' name='wpUploadCopyStatus' id='wpUploadCopyStatus' value=\"$copystatus\" size='40' /></td>
</tr>
<tr>
- <td align='right'><label for='wpUploadCopyStatus'>$filesource:</label></td>
+ <td align='${right}'><label for='wpUploadCopyStatus'>$filesource:</label></td>
<td><input tabindex='6' type='text' name='wpUploadSource' id='wpUploadCopyStatus' value=\"$uploadsource\" size='40' /></td>
</tr>
<tr>
@@ -689,12 +695,12 @@
</tr>
<tr>
<td></td>
- <td align='left'><input tabindex='9' type='submit' name='wpUpload' value=\"{$ulb}\" /></td>
+ <td align='${left}'><input tabindex='9' type='submit' name='wpUpload' value=\"{$ulb}\" /></td>
</tr>
<tr>
<td></td>
- <td align='left'>
+ <td align='${left}'>
" );
$wgOut->addWikiText( wfMsgForContent( 'edittools' ) );
$wgOut->addHTML( "
diff --exclude=.svn -ur phase3_bak/includes/SpecialUserlogin.php phase3/includes/SpecialUserlogin.php
--- phase3_bak/includes/SpecialUserlogin.php 2006-05-31 19:09:03.000000000 +0200
+++ phase3/includes/SpecialUserlogin.php 2006-05-31 22:01:50.000000000 +0200
@@ -471,6 +471,7 @@
global $wgAllowRealName, $wgEnableEmail;
global $wgCookiePrefix;
global $wgAuth;
+ global $wgLang;
if ( '' == $this->mName ) {
if ( $wgUser->isLoggedIn() ) {
@@ -529,6 +530,8 @@
$template->set( 'userealname', $wgAllowRealName );
$template->set( 'useemail', $wgEnableEmail );
$template->set( 'remember', $wgUser->getOption( 'rememberpassword' ) or $this->mRemember );
+
+ $template->set( 'rtl', $wgLang->isRTL() );
// Give authentication and captcha plugins a chance to modify the form
$wgAuth->modifyUITemplate( $template );
diff --exclude=.svn -ur phase3_bak/includes/templates/Userlogin.php phase3/includes/templates/Userlogin.php
--- phase3_bak/includes/templates/Userlogin.php 2006-05-31 19:09:02.000000000 +0200
+++ phase3/includes/templates/Userlogin.php 2006-05-31 22:00:05.000000000 +0200
@@ -15,6 +15,8 @@
*/
class UserloginTemplate extends QuickTemplate {
function execute() {
+ $left = ($this->data['rtl'] == "1") ? "right" : "left";
+ $right = ($this->data['rtl'] == "1") ? "left" : "right";
if( $this->data['message'] ) {
?>
<div class="<?php $this->text('messagetype') ?>box">
@@ -33,15 +35,15 @@
<div id="userloginprompt"><?php $this->msgWiki('loginprompt') ?></div>
<table>
<tr>
- <td align='right'><label for='wpName1'><?php $this->msg('yourname') ?>:</label></td>
- <td align='left'>
+ <td align='<?php echo $right ?>'><label for='wpName1'><?php $this->msg('yourname') ?>:</label></td>
+ <td align='<?php echo $left ?>'>
<input type='text' class='loginText' name="wpName" id="wpName1"
value="<?php $this->text('name') ?>" size='20' />
</td>
</tr>
<tr>
- <td align='right'><label for='wpPassword1'><?php $this->msg('yourpassword') ?>:</label></td>
- <td align='left'>
+ <td align='<?php echo $right ?>'><label for='wpPassword1'><?php $this->msg('yourpassword') ?>:</label></td>
+ <td align='<?php echo $left ?>'>
<input type='password' class='loginPassword' name="wpPassword" id="wpPassword1"
value="<?php $this->text('password') ?>" size='20' />
</td>
@@ -53,8 +55,8 @@
}
?>
<tr>
- <td align='right'><?php $this->msg( 'yourdomainname' ) ?>:</td>
- <td align='left'>
+ <td align='<?php echo $right ?>'><?php $this->msg( 'yourdomainname' ) ?>:</td>
+ <td align='<?php echo $left ?>'>
<select name="wpDomain" value="<?php $this->text( 'domain' ) ?>">
<?php echo $doms ?>
</select>
@@ -63,7 +65,7 @@
<?php } ?>
<tr>
<td></td>
- <td align='left'>
+ <td align='<?php echo $left ?>'>
<input type='checkbox' name="wpRemember"
value="1" id="wpRemember"
<?php if( $this->data['remember'] ) { ?>checked="checked"<?php } ?>
@@ -72,7 +74,7 @@
</tr>
<tr>
<td></td>
- <td align='left' style="white-space:nowrap">
+ <td align='<?php echo $left ?>' style="white-space:nowrap">
<input type='submit' name="wpLoginattempt" id="wpLoginattempt" value="<?php $this->msg('login') ?>" />&nbsp;<?php if( $this->data['useemail'] ) { ?><input type='submit' name="wpMailmypassword" id="wpMailmypassword"
value="<?php $this->msg('mailmypassword') ?>" />
<?php } ?>
@@ -108,15 +110,15 @@
<?php $this->html('header'); /* pre-table point for form plugins... */ ?>
<table>
<tr>
- <td align='right'><label for='wpName2'><?php $this->msg('yourname') ?>:</label></td>
- <td align='left'>
+ <td align='<?php echo $right ?>'><label for='wpName2'><?php $this->msg('yourname') ?>:</label></td>
+ <td align='<?php echo $left ?>'>
<input type='text' class='loginText' name="wpName" id="wpName2"
value="<?php $this->text('name') ?>" size='20' />
</td>
</tr>
<tr>
- <td align='right'><label for='wpPassword2'><?php $this->msg('yourpassword') ?>:</label></td>
- <td align='left'>
+ <td align='<?php echo $right ?>'><label for='wpPassword2'><?php $this->msg('yourpassword') ?>:</label></td>
+ <td align='<?php echo $left ?>'>
<input type='password' class='loginPassword' name="wpPassword" id="wpPassword2"
value="<?php $this->text('password') ?>" size='20' />
</td>
@@ -128,8 +130,8 @@
}
?>
<tr>
- <td align='right'><?php $this->msg( 'yourdomainname' ) ?>:</td>
- <td align='left'>
+ <td align='<?php echo $right ?>'><?php $this->msg( 'yourdomainname' ) ?>:</td>
+ <td align='<?php echo $left ?>'>
<select name="wpDomain" value="<?php $this->text( 'domain' ) ?>">
<?php echo $doms ?>
</select>
@@ -137,8 +139,8 @@
</tr>
<?php } ?>
<tr>
- <td align='right'><label for='wpRetype'><?php $this->msg('yourpasswordagain') ?>:</label></td>
- <td align='left'>
+ <td align='<?php echo $right ?>'><label for='wpRetype'><?php $this->msg('yourpasswordagain') ?>:</label></td>
+ <td align='<?php echo $left ?>'>
<input type='password' class='loginPassword' name="wpRetype" id="wpRetype"
value="<?php $this->text('retype') ?>"
size='20' />
@@ -146,8 +148,8 @@
</tr>
<tr>
<?php if( $this->data['useemail'] ) { ?>
- <td align='right'><label for='wpEmail'><?php $this->msg('youremail') ?>:</label></td>
- <td align='left'>
+ <td align='<?php echo $right ?>'><label for='wpEmail'><?php $this->msg('youremail') ?>:</label></td>
+ <td align='<?php echo $left ?>'>
<input type='text' class='loginText' name="wpEmail" id="wpEmail"
value="<?php $this->text('email') ?>" size='20' />
</td>
@@ -155,8 +157,8 @@
<?php if( $this->data['userealname'] ) { ?>
</tr>
<tr>
- <td align='right'><label for='wpRealName'><?php $this->msg('yourrealname') ?>:</label></td>
- <td align='left'>
+ <td align='<?php echo $right ?>'><label for='wpRealName'><?php $this->msg('yourrealname') ?>:</label></td>
+ <td align='<?php echo $left ?>'>
<input type='text' class='loginText' name="wpRealName" id="wpRealName"
value="<?php $this->text('realname') ?>" size='20' />
</td>
@@ -164,7 +166,7 @@
</tr>
<tr>
<td></td>
- <td align='left'>
+ <td align='<?php echo $left ?>'>
<input type='checkbox' name="wpRemember"
value="1" id="wpRemember"
<?php if( $this->data['remember'] ) { ?>checked="checked"<?php } ?>
@@ -173,7 +175,7 @@
</tr>
<tr>
<td></td>
- <td align='left'>
+ <td align='<?php echo $left ?>'>
<input type='submit' name="wpCreateaccount" id="wpCreateaccount"
value="<?php $this->msg('createaccount') ?>" />
<?php if( $this->data['createemail'] ) { ?>

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2717
Default Alt Text
mediawiki-1.7-rtl-tables.patch (18 KB)

Event Timeline