X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FSpecialBlockip.php;h=d45603572d2fa37d9d131b87020b8f5f2ec7193c;hb=5516fef269e71b5962afa34bd7e7403b13b57d12;hp=e93f6f693a6a17e8820df43e8e6738a2a1547d03;hpb=6cbacc93d49e560019a7d4c7fbae023d5637e757;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/SpecialBlockip.php b/includes/SpecialBlockip.php index e93f6f693a..d45603572d 100644 --- a/includes/SpecialBlockip.php +++ b/includes/SpecialBlockip.php @@ -2,7 +2,8 @@ /** * Constructor for Special:Blockip page * - * @addtogroup SpecialPage + * @file + * @ingroup SpecialPage */ /** @@ -39,7 +40,7 @@ function wfSpecialBlockip( $par ) { /** * Form object for the Special:Blockip page. * - * @addtogroup SpecialPage + * @ingroup SpecialPage */ class IPBlockForm { var $BlockAddress, $BlockExpiry, $BlockReason; @@ -62,35 +63,32 @@ class IPBlockForm { $this->BlockCreateAccount = $wgRequest->getBool( 'wpCreateAccount', $byDefault ); $this->BlockEnableAutoblock = $wgRequest->getBool( 'wpEnableAutoblock', $byDefault ); $this->BlockEmail = $wgRequest->getBool( 'wpEmailBan', false ); + $this->BlockWatchUser = $wgRequest->getBool( 'wpWatchUser', false ); # Re-check user's rights to hide names, very serious, defaults to 0 $this->BlockHideName = ( $wgRequest->getBool( 'wpHideName', 0 ) && $wgUser->isAllowed( 'hideuser' ) ) ? 1 : 0; } function showForm( $err ) { - global $wgOut, $wgUser, $wgSysopUserBans, $wgContLang; + global $wgOut, $wgUser, $wgSysopUserBans; $wgOut->setPagetitle( wfMsg( 'blockip' ) ); - $wgOut->addWikiText( wfMsg( 'blockiptext' ) ); + $wgOut->addWikiMsg( 'blockiptext' ); if($wgSysopUserBans) { $mIpaddress = Xml::label( wfMsg( 'ipadressorusername' ), 'mw-bi-target' ); } else { - $mIpaddress = Xml::label( wfMsg( 'ipadress' ), 'mw-bi-target' ); + $mIpaddress = Xml::label( wfMsg( 'ipaddress' ), 'mw-bi-target' ); } $mIpbexpiry = Xml::label( wfMsg( 'ipbexpiry' ), 'wpBlockExpiry' ); $mIpbother = Xml::label( wfMsg( 'ipbother' ), 'mw-bi-other' ); - $mIpbothertime = wfMsgHtml( 'ipbotheroption' ); $mIpbreasonother = Xml::label( wfMsg( 'ipbreason' ), 'wpBlockReasonList' ); $mIpbreason = Xml::label( wfMsg( 'ipbotherreason' ), 'mw-bi-reason' ); - $mIpbreasonotherlist = wfMsgHtml( 'ipbreasonotherlist' ); $titleObj = SpecialPage::getTitleFor( 'Blockip' ); - $action = $titleObj->escapeLocalURL( "action=submit" ); - $alignRight = $wgContLang->isRtl() ? 'left' : 'right'; if ( "" != $err ) { $wgOut->setSubtitle( wfMsgHtml( 'formerror' ) ); - $wgOut->addHTML( "
{$err}
\n" ); + $wgOut->addHTML( Xml::tags( 'p', array( 'class' => 'error' ), $err ) ); } $scBlockExpiryOptions = wfMsgForContent( 'ipboptions' ); @@ -99,176 +97,164 @@ class IPBlockForm { if (!$showblockoptions) $mIpbother = $mIpbexpiry; - $blockExpiryFormOptions = ""; + $blockExpiryFormOptions = Xml::option( wfMsg( 'ipbotheroption' ), 'other' ); foreach (explode(',', $scBlockExpiryOptions) as $option) { if ( strpos($option, ":") === false ) $option = "$option:$option"; list($show, $value) = explode(":", $option); $show = htmlspecialchars($show); $value = htmlspecialchars($value); - $selected = ""; - if ($this->BlockExpiry === $value) - $selected = ' selected="selected"'; - $blockExpiryFormOptions .= ""; + $blockExpiryFormOptions .= Xml::option( $show, $value, $this->BlockExpiry === $value ? true : false ) . "\n"; } - $scBlockReasonList = wfMsgForContent( 'ipbreason-dropdown' ); - $blockReasonList = ''; - if ( $scBlockReasonList != '' && $scBlockReasonList != '-' ) { - $blockReasonList = ""; - $optgroup = ""; - foreach ( explode( "\n", $scBlockReasonList ) as $option) { - $value = trim( htmlspecialchars($option) ); - if ( $value == '' ) { - continue; - } elseif ( substr( $value, 0, 1) == '*' && substr( $value, 1, 1) != '*' ) { - // A new group is starting ... - $value = trim( substr( $value, 1 ) ); - $blockReasonList .= "$optgroup"; - } elseif ( substr( $value, 0, 2) == '**' ) { - // groupmember - $selected = ""; - $value = trim( substr( $value, 2 ) ); - if ( $this->BlockReasonList === $value) - $selected = ' selected="selected"'; - $blockReasonList .= ""; - } else { - // groupless block reason - $selected = ""; - if ( $this->BlockReasonList === $value) - $selected = ' selected="selected"'; - $blockReasonList .= "$optgroup"; - $optgroup = ""; - } - } - $blockReasonList .= $optgroup; - } - - $token = $wgUser->editToken(); + $reasonDropDown = Xml::listDropDown( 'wpBlockReasonList', + wfMsgForContent( 'ipbreason-dropdown' ), + wfMsgForContent( 'ipbreasonotherlist' ), '', 'wpBlockDropDown', 4 ); global $wgStylePath, $wgStyleVersion; - $wgOut->addHTML( " - - - -\n" ); +' . implode( ' | ', $links ) . '
'; @@ -532,4 +487,3 @@ class IPBlockForm { } } } -