r21407 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r21406‎ | r21407 | r21408 >
Date:10:26, 20 April 2007
Author:raymond
Status:old
Tags:
Comment:
* some tweaks to r21395 to make Brion happy ;-)
** Handling of "newbies" in the inputform consistent now
** stripping out _ in inputform
* German translation
Modified paths:
  • /trunk/phase3/includes/SpecialContributions.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesDe.php (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/messages.inc
@@ -1059,7 +1059,7 @@
10601060 ),
10611061 'watchlist' => array(
10621062 'watchlist',
1063 - 'mywatchlist',
 1063+ 'my-watchlist',
10641064 'watchlistfor',
10651065 'nowatchlist',
10661066 'watchlistanontext',
Index: trunk/phase3/includes/SpecialContributions.php
@@ -191,11 +191,22 @@
192192 function wfSpecialContributions( $par = null ) {
193193 global $wgUser, $wgOut, $wgLang, $wgRequest;
194194
195 - $target = isset( $par ) ? $par : $wgRequest->getVal( 'target' );
196 - $radiobox = $wgRequest->getVal( 'newbie' );
 195+ $options = array();
 196+
 197+ if ( isset( $par ) && $par == 'newbies' ) {
 198+ $target = 'newbies';
 199+ $options['contribs'] = 'newbie';
 200+ } elseif ( isset( $par ) ) {
 201+ $target = $par;
 202+ } else {
 203+ $target = ucfirst( $wgRequest->getVal( 'target' ) );
 204+ }
197205
198 - // check for radiobox
199 - if ( $radiobox == 'contribs-newbie' ) $target = 'newbies';
 206+ // check for radiobox
 207+ if ( $wgRequest->getVal( 'contribs' ) == 'newbie' ) {
 208+ $target = 'newbies';
 209+ $options['contribs'] = 'newbie';
 210+ }
200211
201212 if ( !strlen( $target ) ) {
202213 $wgOut->addHTML( contributionsForm( '' ) );
@@ -208,8 +219,6 @@
209220 return;
210221 }
211222
212 - $options = array();
213 -
214223 list( $options['limit'], $options['offset']) = wfCheckLimits();
215224 $options['offset'] = $wgRequest->getVal( 'offset' );
216225 /* Offset must be an integral. */
@@ -382,22 +391,35 @@
383392 global $wgScript, $wgTitle, $wgRequest;
384393
385394 $options['title'] = $wgTitle->getPrefixedText();
386 - if (!isset($options['target']))
 395+ if ( !isset( $options['target'] ) ) {
387396 $options['target'] = '';
388 - if (!isset($options['namespace']))
 397+ } else {
 398+ $options['target'] = str_replace( '_' , ' ' , $options['target'] );
 399+ }
 400+
 401+ if ( !isset( $options['namespace'] ) ) {
389402 $options['namespace'] = 0;
 403+ }
390404
 405+ if ( !isset( $options['contribs'] ) ) {
 406+ $options['contribs'] = 'user';
 407+ }
 408+
 409+ if ( $options['contribs'] == 'newbie' ) {
 410+ $options['target'] = '';
 411+ }
 412+
391413 $f = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) );
392414
393415 foreach ( $options as $name => $value ) {
394 - if( $name === 'namespace') continue;
 416+ if( $name === 'namespace' || $name === 'target' || $name === 'contribs' ) continue;
395417 $f .= "\t" . Xml::hidden( $name, $value ) . "\n";
396418 }
397419
398420 $f .= '<fieldset>' .
399421 Xml::element( 'legend', array(), wfMsg( 'sp-contributions-search' ) ) .
400 - Xml::radioLabel( wfMsgExt( 'sp-contributions-newbies', array( 'parseinline' ) ), 'newbie' , 'contribs-newbie' , 'contribs-newbie', 'contribs-newbie' ) . '<br />' .
401 - Xml::radioLabel( wfMsgExt( 'sp-contributions-username', array( 'parseinline' ) ), 'newbie' , 'contribs-all', 'contribs-all', 'contribs-all' ) . ' ' .
 422+ Xml::radioLabel( wfMsgExt( 'sp-contributions-newbies', array( 'parseinline' ) ), 'contribs' , 'newbie' , 'newbie', $options['contribs'] == 'newbie' ? true : false ) . '<br />' .
 423+ Xml::radioLabel( wfMsgExt( 'sp-contributions-username', array( 'parseinline' ) ), 'contribs' , 'user', 'user', $options['contribs'] == 'user' ? true : false ) . ' ' .
402424 Xml::input( 'target', 20, $options['target']) . ' '.
403425 Xml::label( wfMsg( 'namespace' ), 'namespace' ) .
404426 Xml::namespaceSelector( $options['namespace'], '' ) .
Index: trunk/phase3/languages/messages/MessagesDe.php
@@ -1265,8 +1265,7 @@
12661266
12671267 # Watchlist
12681268 'watchlist' => 'Beobachtungsliste',
1269 -'my-watchlist' => 'Beobachtungsliste',
1270 -'mywatchlist' => 'Beobachtungsliste',
 1269+'my-watchlist' => 'Beobachtungsliste',
12711270 'watchlistfor' => "(für '''$1''')",
12721271 'nowatchlist' => 'Sie haben keine Einträge auf Ihrer Beobachtungsliste.',
12731272 'watchlistanontext' => 'Sie müssen sich $1, um Ihre Beobachtungsliste zu sehen oder Einträge auf ihr zu bearbeiten.',

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r21395reapply relevant parts of r20164, 20177, 20226...raymond21:18, 19 April 2007