r20226 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r20225‎ | r20226 | r20227 >
Date:11:54, 8 March 2007
Author:raymond
Status:old
Tags:
Comment:
Add option for "newbies" to SpecialContributions
Better XML code for form
Modified paths:
  • /trunk/phase3/includes/SpecialContributions.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesDe.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/messages.inc
@@ -541,6 +541,9 @@
542542 'rev-deleted-text-permission',
543543 'rev-deleted-text-view',
544544 'rev-delundel',
 545+ 'historysize',
 546+ 'historyempty',
 547+
545548 ),
546549 'history-feed' => array(
547550 'history-feed-title',
@@ -1183,6 +1186,7 @@
11841187 'sp-contributions-oldest',
11851188 'sp-contributions-newer',
11861189 'sp-contributions-older',
 1190+ 'sp-contributions-newbies',
11871191 'sp-contributions-newbies-sub',
11881192 'sp-contributions-blocklog',
11891193 'sp-contributions-search',
Index: trunk/phase3/includes/SpecialContributions.php
@@ -198,6 +198,11 @@
199199 global $wgUser, $wgOut, $wgLang, $wgRequest;
200200
201201 $target = isset( $par ) ? $par : $wgRequest->getVal( 'target' );
 202+ $radiobox = $wgRequest->getVal( 'newbie' );
 203+
 204+ // check for radiobox
 205+ if ( $radiobox == 'contribs-newbie' ) $target = 'newbies';
 206+
202207 if ( !strlen( $target ) ) {
203208 $wgOut->addHTML( contributionsForm( '' ) );
204209 return;
@@ -375,7 +380,7 @@
376381 * @param $options Array: the options to be included.
377382 */
378383 function contributionsForm( $options ) {
379 - global $wgScript, $wgTitle;
 384+ global $wgScript, $wgTitle, $wgRequest;
380385
381386 $options['title'] = $wgTitle->getPrefixedText();
382387 if (!isset($options['target']))
@@ -392,11 +397,14 @@
393398
394399 $f .= '<fieldset>' .
395400 Xml::element( 'legend', array(), wfMsg( 'sp-contributions-search' ) ) .
396 - Xml::inputLabel( wfMsg( 'sp-contributions-username' ), 'target', 'target', 20 , $options['target']) . ' ' .
397 - wfMsgHtml( 'namespace' ) . ' ' .
 401+ Xml::radioLabel( wfMsgExt( 'sp-contributions-newbies', array( 'parseinline' ) ), 'newbie' , 'contribs-newbie' , 'contribs-newbie', 'contribs-newbie' ) . '<br />' .
 402+ Xml::radioLabel( wfMsgExt( 'sp-contributions-username', array( 'parseinline' ) ), 'newbie' , 'contribs-all', 'contribs-all', 'contribs-all' ) . ' ' .
 403+ Xml::input( 'target', 20, $options['target']) . ' '.
 404+ Xml::label( wfMsg( 'namespace' ), 'namespace' ) .
398405 Xml::namespaceSelector( $options['namespace'], '' ) .
399406 Xml::submitButton( wfMsg( 'sp-contributions-submit' ) ) .
400 - "</fieldset></form>\n";
 407+ '</fieldset>' .
 408+ Xml::closeElement( 'form' );
401409 return $f;
402410 }
403411
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -1849,6 +1849,7 @@
18501850 'sp-contributions-oldest' => 'Oldest',
18511851 'sp-contributions-newer' => 'Newer $1',
18521852 'sp-contributions-older' => 'Older $1',
 1853+'sp-contributions-newbies' => 'Show contributions of newbies only',
18531854 'sp-contributions-newbies-sub' => 'For newbies',
18541855 'sp-contributions-blocklog' => 'Block log',
18551856 'sp-contributions-search' => 'Search for contributions',
Index: trunk/phase3/languages/messages/MessagesDe.php
@@ -720,6 +720,8 @@
721721 Als Administrator können Sie sie weiterhin einsehen.
722722 Nähere Angaben zum Löschvorgang sowie eine Begründung finden sich im [{{fullurl:Special:Log/delete|page={{PAGENAMEE}}}} Lösch-Logbuch].</div>',
723723 'rev-delundel' => 'zeige/verstecke',
 724+'historysize' => '($1 Bytes)',
 725+'historyempty' => '(leer)',
724726
725727 'history-feed-title' => 'Versionsgeschichte',
726728 'history-feed-description' => 'Versionsgeschichte für diese Seite in {{SITENAME}}',
@@ -1424,6 +1426,7 @@
14251427 'sp-contributions-oldest' => 'Älteste',
14261428 'sp-contributions-newer' => 'Jüngere $1',
14271429 'sp-contributions-older' => 'Ältere $1',
 1430+'sp-contributions-newbies' => 'Zeige nur Beiträge neuer Benutzer',
14281431 'sp-contributions-newbies-sub' => 'Für Neulinge',
14291432 'sp-contributions-blocklog' => 'Sperrlogbuch',
14301433 'sp-contributions-search' => 'Suche nach Benutzerbeiträgen',