r105066 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105065‎ | r105066 | r105067 >
Date:12:28, 3 December 2011
Author:robin
Status:deferred (Comments)
Tags:
Comment:
Split the default reason for single users and multiple users; easier for translators. The "nuke-multiplepeople" was substituted as parameter one (in the user language!!). Also include a link to the contributions in parameter 1 of "nuke-defaultreason".
Some other small changes: whitespace fixes, update getLang() -> getLanguage(), call Linker statically, increase the reason input box size
Modified paths:
  • /trunk/extensions/Nuke/Nuke.i18n.php (modified) (history)
  • /trunk/extensions/Nuke/Nuke.php (modified) (history)
  • /trunk/extensions/Nuke/Nuke_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Nuke/Nuke_body.php
@@ -6,8 +6,8 @@
77 parent::__construct( 'Nuke', 'nuke' );
88 }
99
10 - public function execute( $par ){
11 - if( !$this->userCanExecute( $this->getUser() ) ){
 10+ public function execute( $par ) {
 11+ if( !$this->userCanExecute( $this->getUser() ) ) {
1212 $this->displayRestrictionError();
1313 return;
1414 }
@@ -25,12 +25,10 @@
2626 if ( $user ) $target = $user->getName();
2727 }
2828
29 - $reason = $req->getText(
30 - 'wpReason',
31 - wfMsgForContent(
32 - 'nuke-defaultreason',
33 - $target === '' ? wfMsg( 'nuke-multiplepeople' ) : $target
34 - )
 29+ $reason = $req->getText( 'wpReason',
 30+ $target === '' ?
 31+ wfMsgForContent( 'nuke-multiplepeople' ) :
 32+ wfMsgForContent( 'nuke-defaultreason', "[[Special:Contributions/$target|$target]]" )
3533 );
3634
3735 if( $req->wasPosted()
@@ -60,6 +58,8 @@
6159
6260 /**
6361 * Prompt for a username or IP address.
 62+ *
 63+ * @param $userName string
6464 */
6565 protected function promptForm( $userName = '' ) {
6666 $out = $this->getOutput();
@@ -135,7 +135,7 @@
136136 Xml::tags( 'p',
137137 null,
138138 Xml::inputLabel(
139 - wfMsg( 'deletecomment' ), 'wpReason', 'wpReason', 60, $reason
 139+ wfMsg( 'deletecomment' ), 'wpReason', 'wpReason', 70, $reason
140140 )
141141 )
142142 );
@@ -149,7 +149,7 @@
150150 $out->addHTML(
151151 Xml::tags( 'p',
152152 null,
153 - wfMsg( 'nuke-select', $this->getLang()->commaList( $links ) )
 153+ wfMsg( 'nuke-select', $this->getLanguage()->commaList( $links ) )
154154 )
155155 );
156156
@@ -166,7 +166,7 @@
167167 $image = $title->getNamespace() == NS_IMAGE ? wfLocalFile( $title ) : false;
168168 $thumb = $image && $image->exists() ? $image->transform( array( 'width' => 120, 'height' => 120 ), 0 ) : false;
169169
170 - $changes = wfMsgExt( 'nchanges', 'parsemag', $this->getLang()->formatNum( $edits ) );
 170+ $changes = wfMsgExt( 'nchanges', 'parsemag', $this->getLanguage()->formatNum( $edits ) );
171171
172172 $out->addHTML( '<li>' .
173173 Xml::check( 'pages[]', true,
@@ -174,10 +174,10 @@
175175 ) .
176176 '&#160;' .
177177 ( $thumb ? $thumb->toHtml( array( 'desc-link' => true ) ) : '' ) .
178 - $this->getSkin()->makeKnownLinkObj( $title ) .
 178+ Linker::makeKnownLinkObj( $title ) .
179179 '&#160;(' .
180180 ( $userName ? wfMsgExt( 'nuke-editby', 'parseinline', $userName ) . ',&#160;' : '' ) .
181 - $this->getSkin()->makeKnownLinkObj( $title, $changes, 'action=history' ) .
 181+ Linker::makeKnownLinkObj( $title, $changes, 'action=history' ) .
182182 ")</li>\n" );
183183 }
184184
Index: trunk/extensions/Nuke/Nuke.i18n.php
@@ -22,6 +22,7 @@
2323 'nuke-list-multiple' => 'The following pages were recently created;
2424 put in a comment and hit the button to delete them.',
2525 'nuke-defaultreason' => "Mass deletion of pages added by $1",
 26+ 'nuke-multiplepeople'=> 'Mass deletion of recently added pages',
2627 'nuke-tools' => 'This tool allows for mass deletions of pages recently added by a given user or an IP address.
2728 Input the username or IP address to get a list of pages to delete, or leave blank for all users.',
2829 'nuke-submit-user' => 'Go',
@@ -30,7 +31,6 @@
3132 'nuke-select' => 'Select: $1',
3233 'nuke-userorip' => 'Username, IP address or blank:',
3334 'nuke-maxpages' => 'Maximum number of pages:',
34 - 'nuke-multiplepeople'=> 'multiple users',
3535 'nuke-editby' => 'Created by [[Special:Contributions/$1|$1]]',
3636 'nuke-deleted' => "Page '''$1''' has been deleted.",
3737 'nuke-not-deleted' => "Page [[:$1]] '''could not''' be deleted.",
@@ -56,12 +56,11 @@
5757 'nuke-desc' => 'The Nuke extension allows for sysops to delete a large number of pages ("Mass delete").
5858 For more information, see http://www.mediawiki.org/wiki/Extension:Nuke
5959 {{desc}}',
60 - 'nuke-defaultreason' => 'Reason for deletion in logs. Parameters:
61 -* $1 is a username or {{msg-mw|nuke-multiplepeople}} in case pages by multiple users were deleted.',
 60+ 'nuke-defaultreason' => 'Reason for deletion in logs. Parameters: $1 is a username or IP address, with a link to their contributions.',
 61+ 'nuke-multiplepeople' => 'Reason for deletion in logs, when pages created by multiple users were deleted.',
6262 'nuke-submit-user' => '{{Identical|Go}}',
6363 'right-nuke' => '{{doc-right|nuke}}',
6464 'nuke-select' => '{{Identical|Select}}',
65 - 'nuke-multiplepeople' => 'Substituted for $1 in {{msg-mw|nuke-defaultreason}} when pages created by multiple users were deleted.',
6665 );
6766
6867 /** Niuean (ko e vagahau Niuē)
Index: trunk/extensions/Nuke/Nuke.php
@@ -4,7 +4,7 @@
55 die( 'Not an entry point.' );
66 }
77
8 -define( 'Nuke_VERSION', '1.1.2' );
 8+define( 'Nuke_VERSION', '1.1.3' );
99
1010 $dir = dirname(__FILE__) . '/';
1111

Follow-up revisions

RevisionCommit summaryAuthorDate
r105076follow-up r105066: makeKnownLinkObj() is deprecatedrobin19:28, 3 December 2011

Comments

#Comment by Nikerabbit (talk | contribs)   19:13, 3 December 2011

Isn't it Linker::linkKnown nowdays?

#Comment by SPQRobin (talk | contribs)   19:29, 3 December 2011

Indeed, makeKnownLinkObj is deprecated. Updated in r105076.

Status & tagging log