* Subtitle success message when unblocking a block ID instead of a pseudo link like...
authorRaimond Spekking <raymond@users.mediawiki.org>
Sun, 6 May 2007 09:53:25 +0000 (09:53 +0000)
committerRaimond Spekking <raymond@users.mediawiki.org>
Sun, 6 May 2007 09:53:25 +0000 (09:53 +0000)
* Proper XML functions for input form

RELEASE-NOTES
includes/SpecialIpblocklist.php
languages/messages/MessagesDe.php
languages/messages/MessagesEn.php
maintenance/language/messages.inc

index 6ff8cf8..367afb3 100644 (file)
@@ -36,6 +36,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 3431) Suppress "next page" link in Special:Search at end of results
 * Don't show unblock form if the user doesn't have permission to use it
   (cosmetic change, no vulnerabilities existed)
+* Subtitle success message when unblocking a block ID instead of a pseudo link
+  like [[User:#123|#123]]
 
 == Maintenance script changes since 1.10 ==
 
index a2a5999..8e7aeb1 100644 (file)
@@ -49,7 +49,13 @@ function wfSpecialIpblocklist() {
                # Inform the user of a successful unblock
                # (No need to check permissions or locks here,
                # if something was done, then it's too late!)
-               $ipu->showList( $wgOut->parse( wfMsg( 'unblocked', $successip ) ) );
+               if ( substr( $successip, 0, 1) == '#' ) {
+                       // A block ID was unblocked
+                       $ipu->showList( $wgOut->parse( wfMsg( 'unblocked-ID', $successip ) ) );
+               } else {
+                       // A username/IP was unblocked
+                       $ipu->showList( $wgOut->parse( wfMsg( 'unblocked', $successip ) ) );
+               }
        } else {
                # Just show the block list
                $ipu->showList( '' );
@@ -80,7 +86,7 @@ class IPUnblockForm {
                $ipr = wfMsgHtml( 'ipbreason' );
                $ipus = wfMsgHtml( 'ipusubmit' );
                $titleObj = SpecialPage::getTitleFor( "Ipblocklist" );
-               $action = $titleObj->escapeLocalURL( "action=submit" );
+               $action = $titleObj->getLocalURL( "action=submit" );
 
                if ( "" != $err ) {
                        $wgOut->setSubtitle( wfMsg( "formerror" ) );
@@ -93,39 +99,43 @@ class IPUnblockForm {
                        $block = Block::newFromID( $this->id );
                        if ( $block ) {
                                $encName = htmlspecialchars( $block->getRedactedName() );
-                               $encId = htmlspecialchars( $this->id );
-                               $addressPart = $encName . "<input type='hidden' name=\"id\" value=\"$encId\" />";
+                               $encId = $this->id;
+                               $addressPart = $encName . Xml::hidden( 'id', $encId );
                        }
                }
                if ( !$addressPart ) {
-                       $addressPart = "<input tabindex='1' type='text' size='20' " .
-                               "name=\"wpUnblockAddress\" value=\"" . htmlspecialchars( $this->ip ) . "\" />";
+                       $addressPart = Xml::input( 'wpUnblockAddress', 20, $this->ip, array( 'type' => 'text', 'tabindex' => '1' ) );
                }
 
-               $wgOut->addHTML( "
-<form id=\"unblockip\" method=\"post\" action=\"{$action}\">
-       <table border='0'>
-               <tr>
-                       <td align='right'>{$ipa}:</td>
-                       <td align='left'>
-                               {$addressPart}
-                       </td>
-               </tr>
-               <tr>
-                       <td align='right'>{$ipr}:</td>
-                       <td align='left'>
-                               <input tabindex='1' type='text' size='40' name=\"wpUnblockReason\" value=\"" . htmlspecialchars( $this->reason ) . "\" />
-                       </td>
-               </tr>
-               <tr>
-                       <td>&nbsp;</td>
-                       <td align='left'>
-                               <input tabindex='2' type='submit' name=\"wpBlock\" value=\"{$ipus}\" />
-                       </td>
-               </tr>
-       </table>
-       <input type='hidden' name='wpEditToken' value=\"{$token}\" />
-</form>\n" );
+               $wgOut->addHTML(
+                       Xml::openElement( 'form', array( 'method' => 'post', 'action' => $action, 'id' => 'unblockip' ) ) .
+                       Xml::openElement( 'table', array( 'border' => '0' ) ).
+                       "<tr>
+                               <td align='right'>
+                                       {$ipa}:
+                               </td>
+                               <td align='left'>
+                                       {$addressPart}
+                               </td>
+                       </tr>
+                       <tr>
+                               <td align='right'>
+                                       {$ipr}:
+                               </td>
+                               <td align='left'>" .
+                                       Xml::input( 'wpUnblockReason', 40, $this->reason, array( 'type' => 'text', 'tabindex' => '2' ) ) .
+                               "</td>
+                       </tr>
+                       <tr>
+                               <td>&nbsp;</td>
+                               <td align='left'>" .
+                                       Xml::submitButton( $ipus, array( 'name' => 'wpBlock', 'tabindex' => '3' ) ) .
+                               "</td>
+                       </tr>" .
+                       Xml::closeElement( 'table' ) .
+                       Xml::hidden( 'wpEditToken', $token ) .
+                       Xml::closeElement( 'form' ) . "\n"
+               );
 
        }
 
index adcdf24..f0516bc 100644 (file)
@@ -607,7 +607,7 @@ Sie können $1 oder einen der anderen [[{{MediaWiki:grouppage-sysop}}|Administra
 *Sperrgrund: $2
 *Sperrende: $6
 *IP-Adresse: $3
-*Block-ID: #$5
+*Sperr-ID: #$5
 </div>',
 'autoblockedtext'   => 'Ihre IP-Adresse wurde automatisch gesperrt, da sie von einem anderen Benutzer genutzt wurde, der durch $1 gesperrt wurde.
 Als Grund wurde angegeben:
@@ -628,7 +628,7 @@ Sie können $1 oder einen der anderen [[{{MediaWiki:grouppage-sysop}}|Administra
 *Sperrgrund: $2
 *Sperrende: $6
 *IP-Adresse: $3
-*Block-ID: #$5
+*Sperr-ID: #$5
 </div>',
 'blockedoriginalsource'     => "Der Quelltext von '''$1''' wird hier angezeigt:",
 'blockededitsource'         => "Der Quelltext von '''Ihren Änderungen''' an '''$1''':",
@@ -1577,6 +1577,7 @@ Zur Aufhebung der Sperre siehe die [[{{ns:special}}:Ipblocklist|Liste aller akti
 'unblockiptext'               => 'Benutzen Sie das Formular, um eine IP-Adresse oder einen Benutzer freizugeben.',
 'ipusubmit'                   => 'Freigeben',
 'unblocked'                   => '[[User:$1|$1]] wurde freigegeben',
+'unblocked-ID'                => 'Sperr-ID $1 wurde freigegeben',
 'ipblocklist'                 => 'Liste gesperrter Benutzer/IP-Adressen',
 'ipblocklist-summary'         => "Diese Spezialseite führt – ergänzend zum [[Special:Log/block|Benutzersperr-Logbuch]], das alle manuell vorgenommenen (Ent-)Sperrungen protokolliert – die '''aktuell''' gesperrten Benutzer und IP-Adressen auf, einschließlich automatisch gesperrter IP-Adressen in anonymisierter Form.",
 'ipblocklist-submit'          => 'Suche',
index 9928ec6..d322b2e 100644 (file)
@@ -2008,6 +2008,7 @@ pages that were vandalized).",
 to a previously blocked IP address or username.',
 'ipusubmit'            => 'Unblock this address',
 'unblocked' => '[[User:$1|$1]] has been unblocked',
+'unblocked-ID' => 'Block ID $1 has been unblocked',
 'ipblocklist'  => 'List of blocked IP addresses and usernames',
 'ipblocklist-summary'  => '',
 'ipblocklist-submit'    => 'Search',
index d3b2d4e..619a0ab 100644 (file)
@@ -1296,6 +1296,7 @@ $wgMessageStructure = array(
                'unblockiptext',
                'ipusubmit',
                'unblocked',
+               'unblocked-ID',
                'ipblocklist',
                'ipblocklist-summary',
                'ipblocklist-submit',