From 147671c60130feab9d439049d778a55839762519 Mon Sep 17 00:00:00 2001 From: Raimond Spekking Date: Fri, 20 Apr 2007 10:26:00 +0000 Subject: [PATCH] * some tweaks to r21395 to make Brion happy ;-) ** Handling of "newbies" in the inputform consistent now ** stripping out _ in inputform * German translation --- includes/SpecialContributions.php | 44 +++++++++++++++++++++++-------- languages/messages/MessagesDe.php | 3 +-- maintenance/language/messages.inc | 2 +- 3 files changed, 35 insertions(+), 14 deletions(-) diff --git a/includes/SpecialContributions.php b/includes/SpecialContributions.php index a6d16001d3..bbdec44e7d 100644 --- a/includes/SpecialContributions.php +++ b/includes/SpecialContributions.php @@ -191,11 +191,22 @@ class ContribsFinder { function wfSpecialContributions( $par = null ) { global $wgUser, $wgOut, $wgLang, $wgRequest; - $target = isset( $par ) ? $par : $wgRequest->getVal( 'target' ); - $radiobox = $wgRequest->getVal( 'newbie' ); + $options = array(); + + if ( isset( $par ) && $par == 'newbies' ) { + $target = 'newbies'; + $options['contribs'] = 'newbie'; + } elseif ( isset( $par ) ) { + $target = $par; + } else { + $target = ucfirst( $wgRequest->getVal( 'target' ) ); + } - // check for radiobox - if ( $radiobox == 'contribs-newbie' ) $target = 'newbies'; + // check for radiobox + if ( $wgRequest->getVal( 'contribs' ) == 'newbie' ) { + $target = 'newbies'; + $options['contribs'] = 'newbie'; + } if ( !strlen( $target ) ) { $wgOut->addHTML( contributionsForm( '' ) ); @@ -208,8 +219,6 @@ function wfSpecialContributions( $par = null ) { return; } - $options = array(); - list( $options['limit'], $options['offset']) = wfCheckLimits(); $options['offset'] = $wgRequest->getVal( 'offset' ); /* Offset must be an integral. */ @@ -382,22 +391,35 @@ function contributionsForm( $options ) { global $wgScript, $wgTitle, $wgRequest; $options['title'] = $wgTitle->getPrefixedText(); - if (!isset($options['target'])) + if ( !isset( $options['target'] ) ) { $options['target'] = ''; - if (!isset($options['namespace'])) + } else { + $options['target'] = str_replace( '_' , ' ' , $options['target'] ); + } + + if ( !isset( $options['namespace'] ) ) { $options['namespace'] = 0; + } + + if ( !isset( $options['contribs'] ) ) { + $options['contribs'] = 'user'; + } + + if ( $options['contribs'] == 'newbie' ) { + $options['target'] = ''; + } $f = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ); foreach ( $options as $name => $value ) { - if( $name === 'namespace') continue; + if( $name === 'namespace' || $name === 'target' || $name === 'contribs' ) continue; $f .= "\t" . Xml::hidden( $name, $value ) . "\n"; } $f .= '
' . Xml::element( 'legend', array(), wfMsg( 'sp-contributions-search' ) ) . - Xml::radioLabel( wfMsgExt( 'sp-contributions-newbies', array( 'parseinline' ) ), 'newbie' , 'contribs-newbie' , 'contribs-newbie', 'contribs-newbie' ) . '
' . - Xml::radioLabel( wfMsgExt( 'sp-contributions-username', array( 'parseinline' ) ), 'newbie' , 'contribs-all', 'contribs-all', 'contribs-all' ) . ' ' . + Xml::radioLabel( wfMsgExt( 'sp-contributions-newbies', array( 'parseinline' ) ), 'contribs' , 'newbie' , 'newbie', $options['contribs'] == 'newbie' ? true : false ) . '
' . + Xml::radioLabel( wfMsgExt( 'sp-contributions-username', array( 'parseinline' ) ), 'contribs' , 'user', 'user', $options['contribs'] == 'user' ? true : false ) . ' ' . Xml::input( 'target', 20, $options['target']) . ' '. Xml::label( wfMsg( 'namespace' ), 'namespace' ) . Xml::namespaceSelector( $options['namespace'], '' ) . diff --git a/languages/messages/MessagesDe.php b/languages/messages/MessagesDe.php index 8cac98f47e..2fec77bbdd 100644 --- a/languages/messages/MessagesDe.php +++ b/languages/messages/MessagesDe.php @@ -1265,8 +1265,7 @@ Davon {{PLURAL:$2|hat|haben}} '''$2''' (=$4%) $5-Rechte.", # Watchlist 'watchlist' => 'Beobachtungsliste', -'my-watchlist' => 'Beobachtungsliste', -'mywatchlist' => 'Beobachtungsliste', +'my-watchlist' => 'Beobachtungsliste', 'watchlistfor' => "(für '''$1''')", 'nowatchlist' => 'Sie haben keine Einträge auf Ihrer Beobachtungsliste.', 'watchlistanontext' => 'Sie müssen sich $1, um Ihre Beobachtungsliste zu sehen oder Einträge auf ihr zu bearbeiten.', diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index 63a81037c0..32cd124bd8 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -1059,7 +1059,7 @@ $wgMessageStructure = array( ), 'watchlist' => array( 'watchlist', - 'mywatchlist', + 'my-watchlist', 'watchlistfor', 'nowatchlist', 'watchlistanontext', -- 2.20.1