summaryrefslogtreecommitdiff
path: root/includes/specials/SpecialContributions.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/specials/SpecialContributions.php')
-rw-r--r--includes/specials/SpecialContributions.php59
1 files changed, 26 insertions, 33 deletions
diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php
index 32a887c4..c2cd8122 100644
--- a/includes/specials/SpecialContributions.php
+++ b/includes/specials/SpecialContributions.php
@@ -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;
}
@@ -478,18 +478,15 @@ class SpecialContributions extends IncludableSpecialPage {
if ( $tagFilter ) {
$filterSelection = Html::rawElement(
'td',
- array( 'class' => 'mw-label' ),
- array_shift( $tagFilter )
- );
- $filterSelection .= Html::rawElement(
- 'td',
- array( 'class' => 'mw-input' ),
- implode( '&#160', $tagFilter )
+ array(),
+ array_shift( $tagFilter ) . implode( '&#160', $tagFilter )
);
} else {
$filterSelection = Html::rawElement( 'td', array( 'colspan' => 2 ), '' );
}
+ $this->getOutput()->addModules( 'mediawiki.userSuggest' );
+
$labelNewbies = Xml::radioLabel(
$this->msg( 'sp-contributions-newbies' )->text(),
'contribs',
@@ -510,9 +507,15 @@ class SpecialContributions extends IncludableSpecialPage {
'target',
$this->opts['target'],
'text',
- array( 'size' => '40', 'required' => '', 'class' => 'mw-input' ) +
- ( $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',
@@ -522,16 +525,12 @@ class SpecialContributions extends IncludableSpecialPage {
$namespaceSelection = Xml::tags(
'td',
- array( 'class' => 'mw-label' ),
+ array(),
Xml::label(
$this->msg( 'namespace' )->text(),
'namespace',
''
- )
- );
- $namespaceSelection .= Html::rawElement(
- 'td',
- null,
+ ) .
Html::namespaceSelector(
array( 'selected' => $this->opts['namespace'], 'all' => '' ),
array(
@@ -617,9 +616,9 @@ class SpecialContributions extends IncludableSpecialPage {
$this->opts['year'] === '' ? MWTimestamp::getInstance()->format( 'Y' ) : $this->opts['year'],
$this->opts['month']
) . ' ' .
- Xml::submitButton(
+ Html::submitButton(
$this->msg( 'sp-contributions-submit' )->text(),
- array( 'class' => 'mw-submit' )
+ array( 'class' => 'mw-submit' ), array( 'mw-ui-progressive' )
)
);
@@ -659,7 +658,7 @@ class ContribsPager extends ReverseChronologicalPager {
public $mDb;
public $preventClickjacking = false;
- /** @var DatabaseBase */
+ /** @var IDatabase */
public $mDbSecondary;
/**
@@ -673,10 +672,7 @@ class ContribsPager extends ReverseChronologicalPager {
$msgs = array(
'diff',
'hist',
- 'newarticle',
'pipe-separator',
- 'rev-delundel',
- 'rollbacklink',
'uctop'
);
@@ -715,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
@@ -751,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 )
);
@@ -828,7 +824,7 @@ class ContribsPager extends ReverseChronologicalPager {
$this->tagFilter
);
- wfRunHooks( 'ContribsPager::getQueryInfo', array( &$this, &$queryInfo ) );
+ Hooks::run( 'ContribsPager::getQueryInfo', array( &$this, &$queryInfo ) );
return $queryInfo;
}
@@ -935,7 +931,7 @@ class ContribsPager extends ReverseChronologicalPager {
* @return string
*/
function getStartBody() {
- return "<ul>\n";
+ return "<ul class=\"mw-contributions-list\">\n";
}
/**
@@ -958,7 +954,6 @@ class ContribsPager extends ReverseChronologicalPager {
* @return string
*/
function formatRow( $row ) {
- wfProfileIn( __METHOD__ );
$ret = '';
$classes = array();
@@ -974,7 +969,7 @@ class ContribsPager extends ReverseChronologicalPager {
try {
$rev = new Revision( $row );
$validRevision = (bool)$rev->getId();
- } catch ( MWException $e ) {
+ } catch ( Exception $e ) {
$validRevision = false;
}
wfRestoreWarnings();
@@ -1113,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" );
@@ -1122,8 +1117,6 @@ class ContribsPager extends ReverseChronologicalPager {
$ret = Html::rawElement( 'li', array( 'class' => $classes ), $ret ) . "\n";
}
- wfProfileOut( __METHOD__ );
-
return $ret;
}