From aab3a80bbd5f4ac9f36fb66fb1516424e2ac29b0 Mon Sep 17 00:00:00 2001 From: Raimond Spekking Date: Thu, 17 Apr 2008 09:58:32 +0000 Subject: [PATCH] * Use existing CSS classes for input form aligning * Fix double escaping of the token * Make a proper label when form is called w/o a valid block id * Make the length of both input fields identical. I see no reason why to shorten one. --- includes/SpecialIpblocklist.php | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/includes/SpecialIpblocklist.php b/includes/SpecialIpblocklist.php index b01851001b..85a08f76df 100644 --- a/includes/SpecialIpblocklist.php +++ b/includes/SpecialIpblocklist.php @@ -82,21 +82,18 @@ class IPUnblockForm { * @return $out string: HTML form */ function showForm( $err ) { - global $wgOut, $wgUser, $wgSysopUserBans, $wgContLang; + global $wgOut, $wgUser, $wgSysopUserBans; $wgOut->setPagetitle( wfMsg( 'unblockip' ) ); $wgOut->addWikiMsg( 'unblockiptext' ); - $ipa = wfMsgHtml( $wgSysopUserBans ? 'ipadressorusername' : 'ipaddress' ); $titleObj = SpecialPage::getTitleFor( "Ipblocklist" ); $action = $titleObj->getLocalURL( "action=submit" ); - $alignRight = $wgContLang->isRtl() ? 'left' : 'right'; if ( "" != $err ) { $wgOut->setSubtitle( wfMsg( "formerror" ) ); - $wgOut->addWikiText( "{$err}\n" ); + $wgOut->addWikiText( Xml::tags( 'span', array( 'class' => 'error' ), $err ) . "\n" ); } - $token = htmlspecialchars( $wgUser->editToken() ); $addressPart = false; if ( $this->id ) { @@ -105,42 +102,44 @@ class IPUnblockForm { $encName = htmlspecialchars( $block->getRedactedName() ); $encId = $this->id; $addressPart = $encName . Xml::hidden( 'id', $encId ); + $ipa = wfMsgHtml( $wgSysopUserBans ? 'ipadressorusername' : 'ipaddress' ); } } if ( !$addressPart ) { - $addressPart = Xml::input( 'wpUnblockAddress', 20, $this->ip, array( 'type' => 'text', 'tabindex' => '1' ) ); + $addressPart = Xml::input( 'wpUnblockAddress', 40, $this->ip, array( 'type' => 'text', 'tabindex' => '1' ) ); + $ipa = Xml::label( wfMsg( $wgSysopUserBans ? 'ipadressorusername' : 'ipaddress' ), 'wpUnblockAddress' ); } $wgOut->addHTML( Xml::openElement( 'form', array( 'method' => 'post', 'action' => $action, 'id' => 'unblockip' ) ) . Xml::openElement( 'fieldset' ) . Xml::element( 'legend', null, wfMsg( 'ipb-unblock' ) ) . - Xml::openElement( 'table', array( 'border' => '0', 'id' => 'mw-unblock-table' ) ). + Xml::openElement( 'table', array( 'id' => 'mw-unblock-table' ) ). " - + {$ipa} - + {$addressPart} - " . + " . Xml::label( wfMsg( 'ipbreason' ), 'wpUnblockReason' ) . " - " . + " . Xml::input( 'wpUnblockReason', 40, $this->reason, array( 'type' => 'text', 'tabindex' => '2' ) ) . "   - " . + " . Xml::submitButton( wfMsg( 'ipusubmit' ), array( 'name' => 'wpBlock', 'tabindex' => '3' ) ) . " " . Xml::closeElement( 'table' ) . Xml::closeElement( 'fieldset' ) . - Xml::hidden( 'wpEditToken', $token ) . + Xml::hidden( 'wpEditToken', $wgUser->editToken() ) . Xml::closeElement( 'form' ) . "\n" ); -- 2.20.1