Replace wfRunHooks calls with direct Hooks::run calls
[lhc/web/wiklou.git] / includes / specials / SpecialBlock.php
index 3297c17..144d39b 100644 (file)
@@ -98,6 +98,7 @@ class SpecialBlock extends FormSpecialPage {
                $form->setWrapperLegendMsg( 'blockip-legend' );
                $form->setHeaderText( '' );
                $form->setSubmitCallback( array( __CLASS__, 'processUIForm' ) );
+               $form->setSubmitDestructive();
 
                $msg = $this->alreadyBlocked ? 'ipb-change-block' : 'ipbsubmit';
                $form->setSubmitTextMsg( $msg );
@@ -135,6 +136,7 @@ class SpecialBlock extends FormSpecialPage {
                                'autofocus' => true,
                                'required' => true,
                                'validation-callback' => array( __CLASS__, 'validateTargetField' ),
+                               'cssclass' => 'mw-autocomplete-user', // used by mediawiki.userSuggest
                        ),
                        'Expiry' => array(
                                'type' => !count( $suggestedDurations ) ? 'text' : 'selectorother',
@@ -146,6 +148,7 @@ class SpecialBlock extends FormSpecialPage {
                        ),
                        'Reason' => array(
                                'type' => 'selectandother',
+                               'maxlength' => 255,
                                'label-message' => 'ipbreason',
                                'options-message' => 'ipbreason-dropdown',
                        ),
@@ -217,7 +220,7 @@ class SpecialBlock extends FormSpecialPage {
                $this->maybeAlterFormDefaults( $a );
 
                // Allow extensions to add more fields
-               wfRunHooks( 'SpecialBlockModifyFormFields', array( $this, &$a ) );
+               Hooks::run( 'SpecialBlockModifyFormFields', array( $this, &$a ) );
 
                return $a;
        }
@@ -307,14 +310,14 @@ class SpecialBlock extends FormSpecialPage {
         * @return string
         */
        protected function preText() {
-               $this->getOutput()->addModules( 'mediawiki.special.block' );
+               $this->getOutput()->addModules( array( 'mediawiki.special.block', 'mediawiki.userSuggest' ) );
 
                $text = $this->msg( 'blockiptext' )->parse();
 
                $otherBlockMessages = array();
                if ( $this->target !== null ) {
                        # Get other blocks, i.e. from GlobalBlocking or TorBlock extension
-                       wfRunHooks( 'OtherBlockLogLink', array( &$otherBlockMessages, $this->target ) );
+                       Hooks::run( 'OtherBlockLogLink', array( &$otherBlockMessages, $this->target ) );
 
                        if ( count( $otherBlockMessages ) ) {
                                $s = Html::rawElement(
@@ -698,7 +701,7 @@ class SpecialBlock extends FormSpecialPage {
                $block->mHideName = $data['HideUser'];
 
                $reason = array( 'hookaborted' );
-               if ( !wfRunHooks( 'BlockIp', array( &$block, &$performer, &$reason ) ) ) {
+               if ( !Hooks::run( 'BlockIp', array( &$block, &$performer, &$reason ) ) ) {
                        return $reason;
                }
 
@@ -759,7 +762,7 @@ class SpecialBlock extends FormSpecialPage {
                        $logaction = 'block';
                }
 
-               wfRunHooks( 'BlockIpComplete', array( $block, $performer ) );
+               Hooks::run( 'BlockIpComplete', array( $block, $performer ) );
 
                # Set *_deleted fields if requested
                if ( $data['HideUser'] ) {