r22068 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r22067‎ | r22068 | r22069 >
Date:16:12, 10 May 2007
Author:raymond
Status:old
Tags:
Comment:
* move hardcoded colons into message files
* make input forms nicer for RTL wikis. Should not make any difference to LTR wikis.
Modified paths:
  • /trunk/phase3/includes/SpecialBlockip.php (modified) (history)
  • /trunk/phase3/includes/SpecialIpblocklist.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesDe.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialBlockip.php
@@ -65,7 +65,7 @@
6666 }
6767
6868 function showForm( $err ) {
69 - global $wgOut, $wgUser, $wgSysopUserBans;
 69+ global $wgOut, $wgUser, $wgSysopUserBans, $wgContLang;
7070
7171 $wgOut->setPagetitle( wfMsg( 'blockip' ) );
7272 $wgOut->addWikiText( wfMsg( 'blockiptext' ) );
@@ -84,6 +84,7 @@
8585
8686 $titleObj = SpecialPage::getTitleFor( 'Blockip' );
8787 $action = $titleObj->escapeLocalURL( "action=submit" );
 88+ $alignRight = $wgContLang->isRtl() ? 'left' : 'right';
8889
8990 if ( "" != $err ) {
9091 $wgOut->setSubtitle( wfMsgHtml( 'formerror' ) );
@@ -150,8 +151,8 @@
151152 <form id=\"blockip\" method=\"post\" action=\"{$action}\">
152153 <table border='0'>
153154 <tr>
154 - <td align=\"right\">{$mIpaddress}:</td>
155 - <td align=\"left\">
 155+ <td align=\"$alignRight\">{$mIpaddress}</td>
 156+ <td>
156157 " . Xml::input( 'wpBlockAddress', 45, $this->BlockAddress,
157158 array(
158159 'tabindex' => '1',
@@ -162,8 +163,8 @@
163164 <tr>");
164165 if ($showblockoptions) {
165166 $wgOut->addHTML("
166 - <td align=\"right\">{$mIpbexpiry}:</td>
167 - <td align=\"left\">
 167+ <td align=\"$alignRight\">{$mIpbexpiry}</td>
 168+ <td>
168169 <select tabindex='2' id='wpBlockExpiry' name=\"wpBlockExpiry\" onchange=\"considerChangingExpiryFocus()\">
169170 $blockExpiryFormOptions
170171 </select>
@@ -173,8 +174,8 @@
174175 $wgOut->addHTML("
175176 </tr>
176177 <tr id='wpBlockOther'>
177 - <td align=\"right\">{$mIpbother}:</td>
178 - <td align=\"left\">
 178+ <td align=\"$alignRight\">{$mIpbother}</td>
 179+ <td>
179180 " . Xml::input( 'wpBlockOther', 45, $this->BlockOther,
180181 array( 'tabindex' => '3', 'id' => 'mw-bi-other' ) ) . "
181182 </td>
@@ -182,8 +183,8 @@
183184 if ( $blockReasonList != '' ) {
184185 $wgOut->addHTML("
185186 <tr>
186 - <td align=\"right\">{$mIpbreasonother}:</td>
187 - <td align=\"left\">
 187+ <td align=\"$alignRight\">{$mIpbreasonother}</td>
 188+ <td>
188189 <select tabindex='4' id=\"wpBlockReasonList\" name=\"wpBlockReasonList\">
189190 $blockReasonList
190191 </select>
@@ -192,15 +193,15 @@
193194 }
194195 $wgOut->addHTML("
195196 <tr id=\"wpBlockReason\">
196 - <td align=\"right\">{$mIpbreason}:</td>
197 - <td align=\"left\">
 197+ <td align=\"$alignRight\">{$mIpbreason}</td>
 198+ <td>
198199 " . Xml::input( 'wpBlockReason', 45, $this->BlockReason,
199200 array( 'tabindex' => '5', 'id' => 'mw-bi-reason' ) ) . "
200201 </td>
201202 </tr>
202203 <tr id='wpAnonOnlyRow'>
203204 <td>&nbsp;</td>
204 - <td align=\"left\">
 205+ <td>
205206 " . wfCheckLabel( wfMsgHtml( 'ipbanononly' ),
206207 'wpAnonOnly', 'wpAnonOnly', $this->BlockAnonOnly,
207208 array( 'tabindex' => '6' ) ) . "
@@ -208,7 +209,7 @@
209210 </tr>
210211 <tr id='wpCreateAccountRow'>
211212 <td>&nbsp;</td>
212 - <td align=\"left\">
 213+ <td>
213214 " . wfCheckLabel( wfMsgHtml( 'ipbcreateaccount' ),
214215 'wpCreateAccount', 'wpCreateAccount', $this->BlockCreateAccount,
215216 array( 'tabindex' => '7' ) ) . "
@@ -216,7 +217,7 @@
217218 </tr>
218219 <tr id='wpEnableAutoblockRow'>
219220 <td>&nbsp;</td>
220 - <td align=\"left\">
 221+ <td>
221222 " . wfCheckLabel( wfMsgHtml( 'ipbenableautoblock' ),
222223 'wpEnableAutoblock', 'wpEnableAutoblock', $this->BlockEnableAutoblock,
223224 array( 'tabindex' => '8' ) ) . "
@@ -228,7 +229,7 @@
229230 $wgOut->addHTML("
230231 <tr>
231232 <td>&nbsp;</td>
232 - <td align=\"left\">
 233+ <td>
233234 " . wfCheckLabel( wfMsgHtml( 'ipbhidename' ),
234235 'wpHideName', 'wpHideName', $this->BlockHideName,
235236 array( 'tabindex' => '9' ) ) . "
@@ -239,7 +240,7 @@
240241 $wgOut->addHTML("
241242 <tr>
242243 <td style='padding-top: 1em'>&nbsp;</td>
243 - <td style='padding-top: 1em' align=\"left\">
 244+ <td style='padding-top: 1em'>
244245 " . Xml::submitButton( wfMsg( 'ipbsubmit' ),
245246 array( 'name' => 'wpBlock', 'tabindex' => '10' ) ) . "
246247 </td>
Index: trunk/phase3/includes/SpecialIpblocklist.php
@@ -77,7 +77,7 @@
7878 }
7979
8080 function showForm( $err ) {
81 - global $wgOut, $wgUser, $wgSysopUserBans;
 81+ global $wgOut, $wgUser, $wgSysopUserBans, $wgContLang;
8282
8383 $wgOut->setPagetitle( wfMsg( 'unblockip' ) );
8484 $wgOut->addWikiText( wfMsg( 'unblockiptext' ) );
@@ -87,6 +87,7 @@
8888 $ipus = wfMsgHtml( 'ipusubmit' );
8989 $titleObj = SpecialPage::getTitleFor( "Ipblocklist" );
9090 $action = $titleObj->getLocalURL( "action=submit" );
 91+ $alignRight = $wgContLang->isRtl() ? 'left' : 'right';
9192
9293 if ( "" != $err ) {
9394 $wgOut->setSubtitle( wfMsg( "formerror" ) );
@@ -111,24 +112,24 @@
112113 Xml::openElement( 'form', array( 'method' => 'post', 'action' => $action, 'id' => 'unblockip' ) ) .
113114 Xml::openElement( 'table', array( 'border' => '0' ) ).
114115 "<tr>
115 - <td align='right'>
116 - {$ipa}:
 116+ <td align='$alignRight'>
 117+ {$ipa}
117118 </td>
118 - <td align='left'>
 119+ <td>
119120 {$addressPart}
120121 </td>
121122 </tr>
122123 <tr>
123 - <td align='right'>
124 - {$ipr}:
 124+ <td align='$alignRight'>
 125+ {$ipr}
125126 </td>
126 - <td align='left'>" .
 127+ <td>" .
127128 Xml::input( 'wpUnblockReason', 40, $this->reason, array( 'type' => 'text', 'tabindex' => '2' ) ) .
128129 "</td>
129130 </tr>
130131 <tr>
131132 <td>&nbsp;</td>
132 - <td align='left'>" .
 133+ <td>" .
133134 Xml::submitButton( $ipus, array( 'name' => 'wpBlock', 'tabindex' => '3' ) ) .
134135 "</td>
135136 </tr>" .
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -1963,10 +1963,10 @@
19641964 accordance with [[{{MediaWiki:policy-url}}|policy]].
19651965 Fill in a specific reason below (for example, citing particular
19661966 pages that were vandalized).",
1967 -'ipaddress' => 'IP Address',
1968 -'ipadressorusername' => 'IP Address or username',
1969 -'ipbexpiry' => 'Expiry',
1970 -'ipbreason' => 'Reason',
 1967+'ipaddress' => 'IP Address:',
 1968+'ipadressorusername' => 'IP Address or username:',
 1969+'ipbexpiry' => 'Expiry:',
 1970+'ipbreason' => 'Reason:',
19711971 'ipbreasonotherlist' => 'Other reason',
19721972
19731973 // These are examples only. They can be translated but should be adjusted via
@@ -1988,10 +1988,10 @@
19891989 'ipbcreateaccount' => 'Prevent account creation',
19901990 'ipbenableautoblock' => 'Automatically block the last IP address used by this user, and any subsequent IPs they try to edit from',
19911991 'ipbsubmit' => 'Block this user',
1992 -'ipbother' => 'Other time',
 1992+'ipbother' => 'Other time:',
19931993 'ipboptions' => '2 hours:2 hours,1 day:1 day,3 days:3 days,1 week:1 week,2 weeks:2 weeks,1 month:1 month,3 months:3 months,6 months:6 months,1 year:1 year,infinite:infinite',
19941994 'ipbotheroption' => 'other',
1995 -'ipbotherreason' => 'Other/additional reason',
 1995+'ipbotherreason' => 'Other/additional reason:',
19961996 'ipbhidename' => 'Hide username/IP from the block log, active block list and user list',
19971997 'badipaddress' => 'Invalid IP address',
19981998 'blockipsuccesssub' => 'Block succeeded',
Index: trunk/phase3/languages/messages/MessagesDe.php
@@ -1538,10 +1538,10 @@
15391539 'blockiptext' => 'Benutzen Sie das Formular, um einen Benutzer oder eine IP-Adresse zu sperren.
15401540 Dies sollte nur erfolgen, um Vandalismus zu verhindern und in Übereinstimmung mit den [[{{MediaWiki:policy-url}}|Richtlinien]].
15411541 Bitte geben Sie den Grund für die Sperre an.',
1542 -'ipaddress' => 'IP-Adresse oder Benutzername',
1543 -'ipadressorusername' => 'IP-Adresse oder Benutzername',
1544 -'ipbexpiry' => 'Sperrdauer',
1545 -'ipbreason' => 'Begründung',
 1542+'ipaddress' => 'IP-Adresse oder Benutzername:',
 1543+'ipadressorusername' => 'IP-Adresse oder Benutzername:',
 1544+'ipbexpiry' => 'Sperrdauer:',
 1545+'ipbreason' => 'Begründung:',
15461546 'ipbreasonotherlist' => 'Andere Begründung',
15471547 'ipbreason-dropdown' => '
15481548 * Allgemeine Sperrgründe
@@ -1558,10 +1558,10 @@
15591559 'ipbcreateaccount' => 'Erstellung von Benutzerkonten verhindern',
15601560 'ipbenableautoblock' => 'Sperre die aktuell von diesem Benutzer genutzte IP-Adresse sowie automatisch alle folgenden, von denen aus er Bearbeitungen oder das Anlegen von Benutzeraccounts versucht',
15611561 'ipbsubmit' => 'IP-Adresse/Benutzer sperren',
1562 -'ipbother' => 'Andere Dauer (englisch)',
 1562+'ipbother' => 'Andere Dauer (englisch):',
15631563 'ipboptions' => '1 Stunde:1 hour,2 Stunden:2 hours,6 Stunden:6 hours,1 Tag:1 day,3 Tage:3 days,1 Woche:1 week,2 Wochen:2 weeks,1 Monat:1 month,3 Monate:3 months,1 Jahr:1 year,Unbeschränkt:infinite',
15641564 'ipbotheroption' => 'Andere Dauer',
1565 -'ipbotherreason' => 'Andere/ergänzende Begründung',
 1565+'ipbotherreason' => 'Andere/ergänzende Begründung:',
15661566 'ipbhidename' => 'Benutzername/IP-Adresse im Sperr-Logbuch, der Liste aktiver Sperren und dem Benutzerverzeichnis verstecken.',
15671567 'badipaddress' => 'Die IP-Adresse hat ein falsches Format.',
15681568 'blockipsuccesssub' => 'Sperre erfolgreich',