r77538 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77537‎ | r77538 | r77539 >
Date:20:46, 1 December 2010
Author:kaldari
Status:ok
Tags:
Comment:
quick fix for bug 26185
Modified paths:
  • /trunk/extensions/Nuke/Nuke.i18n.php (modified) (history)
  • /trunk/extensions/Nuke/Nuke_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Nuke/Nuke_body.php
@@ -44,6 +44,9 @@
4545 }
4646 }
4747
 48+ /**
 49+ * Prompt for a username or IP address
 50+ */
4851 function promptForm() {
4952 global $wgOut;
5053
@@ -61,6 +64,9 @@
6265 $wgOut->addHTML( "</form>" );
6366 }
6467
 68+ /**
 69+ * Display list of pages to delete
 70+ */
6571 function listForm( $username, $reason ) {
6672 global $wgUser, $wgOut, $wgLang;
6773
@@ -75,15 +81,50 @@
7682 $nuke = $this->getTitle();
7783 $submit = Xml::submitButton( wfMsg( 'nuke-submit-delete' ) );
7884
 85+ $script = <<<JAVASCRIPT
 86+<script type="text/javascript">
 87+function selectPages( bool ) {
 88+ var inputs = document.getElementsByTagName("input");
 89+ for (i = 0; i < inputs.length; i++) {
 90+ if (inputs[i].type == "checkbox") {
 91+ inputs[i].checked = bool;
 92+ }
 93+ }
 94+}
 95+</script>
 96+JAVASCRIPT;
 97+ $wgOut->addScript( $script );
 98+
7999 $wgOut->addHTML(
80100 Xml::openElement( 'form', array(
81101 'action' => $nuke->getLocalURL( 'action=delete' ),
82 - 'method' => 'post' )
 102+ 'method' => 'post',
 103+ 'name' => 'nukelist')
83104 ) .
84105 Html::hidden( 'wpEditToken', $wgUser->editToken() ) .
85 - Xml::inputLabel(
86 - wfMsg( 'deletecomment' ), 'wpReason', 'wpReason', 60, $reason
87 - ) . '<br /><br />' .
 106+ Xml::tags( 'p',
 107+ null,
 108+ Xml::inputLabel(
 109+ wfMsg( 'deletecomment' ), 'wpReason', 'wpReason', 60, $reason
 110+ )
 111+ )
 112+ );
 113+
 114+ // Select: All, None
 115+ $links = array();
 116+ $links[] = '<a href="#" onclick="selectPages( true ); return false;">' .
 117+ wfMsg( 'powersearch-toggleall' ) . '</a>';
 118+ $links[] = '<a href="#" onclick="selectPages( false ); return false;">' .
 119+ wfMsg( 'powersearch-togglenone' ) . '</a>';
 120+ $wgOut->addHTML(
 121+ Xml::tags( 'p',
 122+ null,
 123+ wfMsg( 'nuke-select', $wgLang->commaList( $links ) )
 124+ )
 125+ );
 126+
 127+ // Delete button
 128+ $wgOut->addHTML(
88129 Xml::submitButton( wfMsg( 'nuke-submit-delete' ) )
89130 );
90131
Index: trunk/extensions/Nuke/Nuke.i18n.php
@@ -24,6 +24,7 @@
2525 'nuke-submit-user' => 'Go',
2626 'nuke-submit-delete' => 'Delete selected',
2727 'right-nuke' => 'Mass delete pages',
 28+ 'nuke-select' => 'Select: $1',
2829 );
2930
3031 /** Message documentation (Message documentation)
@@ -36,6 +37,7 @@
3738 'nuke-desc' => '{{desc}}',
3839 'nuke-submit-user' => '{{Identical|Go}}',
3940 'right-nuke' => '{{doc-right}}',
 41+ 'nuke-select' => '{{Identical|Select}}',
4042 );
4143
4244 /** Niuean (ko e vagahau Niuē)
@@ -55,6 +57,7 @@
5658 'nuke-submit-user' => 'Laat waai',
5759 'nuke-submit-delete' => 'Skrap geselekteerde',
5860 'right-nuke' => 'Massa verwydering van bladsye',
 61+ 'nuke-select' => 'Selekteer: $1',
5962 );
6063
6164 /** Aragonese (Aragonés)
@@ -346,6 +349,7 @@
347350 'nuke-submit-user' => 'Hole die Liste',
348351 'nuke-submit-delete' => 'Ausgewählte Seiten löschen',
349352 'right-nuke' => 'Massenlöschung von Seiten',
 353+ 'nuke-select' => 'Auswählen: $1',
350354 );
351355
352356 /** German (formal address) (Deutsch (Sie-Form))

Status & tagging log