Fix phpcs errors in includes/
[lhc/web/wiklou.git] / includes / specials / SpecialContributions.php
index 5631c3a..c96fd14 100644 (file)
@@ -176,7 +176,7 @@ class SpecialContributions extends IncludableSpecialPage {
                // Add RSS/atom links
                $this->addFeedLinks( $feedParams );
 
-               if ( wfRunHooks( 'SpecialContributionsBeforeMainOutput', array( $id, $userObj, $this ) ) ) {
+               if ( Hooks::run( 'SpecialContributionsBeforeMainOutput', array( $id, $userObj, $this ) ) ) {
                        if ( !$this->including() ) {
                                $out->addHTML( $this->getForm() );
                        }
@@ -386,7 +386,7 @@ class SpecialContributions extends IncludableSpecialPage {
                        );
                }
 
-               wfRunHooks( 'ContributionsToolLinks', array( $id, $userpage, &$tools ) );
+               Hooks::run( 'ContributionsToolLinks', array( $id, $userpage, &$tools ) );
 
                return $tools;
        }
@@ -485,6 +485,8 @@ class SpecialContributions extends IncludableSpecialPage {
                        $filterSelection = Html::rawElement( 'td', array( 'colspan' => 2 ), '' );
                }
 
+               $this->getOutput()->addModules( 'mediawiki.userSuggest' );
+
                $labelNewbies = Xml::radioLabel(
                        $this->msg( 'sp-contributions-newbies' )->text(),
                        'contribs',
@@ -505,9 +507,15 @@ class SpecialContributions extends IncludableSpecialPage {
                        'target',
                        $this->opts['target'],
                        'text',
-                       array( 'size' => '40', 'required' => '', 'class' => 'mw-input mw-ui-input-inline' ) +
-                               ( $this->opts['target'] ? array() : array( 'autofocus' )
-                               )
+                       array(
+                               'size' => '40',
+                               'required' => '',
+                               'class' => array(
+                                       'mw-input',
+                                       'mw-ui-input-inline',
+                                       'mw-autocomplete-user', // used by mediawiki.userSuggest
+                               ),
+                       ) + ( $this->opts['target'] ? array() : array( 'autofocus' ) )
                );
                $targetSelection = Html::rawElement(
                        'td',
@@ -650,7 +658,7 @@ class ContribsPager extends ReverseChronologicalPager {
        public $mDb;
        public $preventClickjacking = false;
 
-       /** @var DatabaseBase */
+       /** @var IDatabase */
        public $mDbSecondary;
 
        /**
@@ -664,10 +672,7 @@ class ContribsPager extends ReverseChronologicalPager {
                $msgs = array(
                        'diff',
                        'hist',
-                       'newarticle',
                        'pipe-separator',
-                       'rev-delundel',
-                       'rollbacklink',
                        'uctop'
                );
 
@@ -706,7 +711,7 @@ class ContribsPager extends ReverseChronologicalPager {
 
        /**
         * This method basically executes the exact same code as the parent class, though with
-        * a hook added, to allow extentions to add additional queries.
+        * a hook added, to allow extensions to add additional queries.
         *
         * @param string $offset Index offset, inclusive
         * @param int $limit Exact query limit
@@ -742,7 +747,7 @@ class ContribsPager extends ReverseChronologicalPager {
                $data = array( $this->mDb->select(
                        $tables, $fields, $conds, $fname, $options, $join_conds
                ) );
-               wfRunHooks(
+               Hooks::run(
                        'ContribsPager::reallyDoQuery',
                        array( &$data, $pager, $offset, $limit, $descending )
                );
@@ -819,7 +824,7 @@ class ContribsPager extends ReverseChronologicalPager {
                        $this->tagFilter
                );
 
-               wfRunHooks( 'ContribsPager::getQueryInfo', array( &$this, &$queryInfo ) );
+               Hooks::run( 'ContribsPager::getQueryInfo', array( &$this, &$queryInfo ) );
 
                return $queryInfo;
        }
@@ -926,7 +931,7 @@ class ContribsPager extends ReverseChronologicalPager {
         * @return string
         */
        function getStartBody() {
-               return "<ul>\n";
+               return "<ul class=\"mw-contributions-list\">\n";
        }
 
        /**
@@ -949,7 +954,6 @@ class ContribsPager extends ReverseChronologicalPager {
         * @return string
         */
        function formatRow( $row ) {
-               wfProfileIn( __METHOD__ );
 
                $ret = '';
                $classes = array();
@@ -1104,7 +1108,7 @@ class ContribsPager extends ReverseChronologicalPager {
                }
 
                // Let extensions add data
-               wfRunHooks( 'ContributionsLineEnding', array( $this, &$ret, $row, &$classes ) );
+               Hooks::run( 'ContributionsLineEnding', array( $this, &$ret, $row, &$classes ) );
 
                if ( $classes === array() && $ret === '' ) {
                        wfDebug( "Dropping Special:Contribution row that could not be formatted\n" );
@@ -1113,8 +1117,6 @@ class ContribsPager extends ReverseChronologicalPager {
                        $ret = Html::rawElement( 'li', array( 'class' => $classes ), $ret ) . "\n";
                }
 
-               wfProfileOut( __METHOD__ );
-
                return $ret;
        }