Fix phpcs errors in includes/
[lhc/web/wiklou.git] / includes / actions / HistoryAction.php
index 523da68..1e2f889 100644 (file)
@@ -102,15 +102,13 @@ class HistoryAction extends FormlessAction {
                        return; // Client cache fresh and headers sent, nothing more to do.
                }
 
-               wfProfileIn( __METHOD__ );
-
                $this->preCacheMessages();
                $config = $this->context->getConfig();
 
                # Fill in the file cache if not set already
                $useFileCache = $config->get( 'UseFileCache' );
                if ( $useFileCache && HTMLFileCache::useFileCache( $this->getContext() ) ) {
-                       $cache = HTMLFileCache::newFromTitle( $this->getTitle(), 'history' );
+                       $cache = new HTMLFileCache( $this->getTitle(), 'history' );
                        if ( !$cache->isCacheGood( /* Assume up to date */ ) ) {
                                ob_start( array( &$cache, 'saveToFileCache' ) );
                        }
@@ -131,7 +129,6 @@ class HistoryAction extends FormlessAction {
                $feedType = $request->getVal( 'feed' );
                if ( $feedType ) {
                        $this->feed( $feedType );
-                       wfProfileOut( __METHOD__ );
 
                        return;
                }
@@ -151,7 +148,6 @@ class HistoryAction extends FormlessAction {
                                        'msgKey' => array( 'moveddeleted-notice' )
                                )
                        );
-                       wfProfileOut( __METHOD__ );
 
                        return;
                }
@@ -196,11 +192,15 @@ class HistoryAction extends FormlessAction {
                        ) . ' ' .
                        ( $tagSelector ? ( implode( ' ', $tagSelector ) . ' ' ) : '' ) .
                        $checkDeleted .
-                       Xml::submitButton( $this->msg( 'allpagessubmit' )->text() ) . "\n" .
+                       Html::submitButton(
+                               $this->msg( 'allpagessubmit' )->text(),
+                               array(),
+                               array( 'mw-ui-progressive' )
+                       ) . "\n" .
                        '</fieldset></form>'
                );
 
-               wfRunHooks( 'PageHistoryBeforeList', array( &$this->page, $this->getContext() ) );
+               Hooks::run( 'PageHistoryBeforeList', array( &$this->page, $this->getContext() ) );
 
                // Create and output the list.
                $pager = new HistoryPager( $this, $year, $month, $tagFilter, $conds );
@@ -211,7 +211,6 @@ class HistoryAction extends FormlessAction {
                );
                $out->preventClickjacking( $pager->getPreventClickjacking() );
 
-               wfProfileOut( __METHOD__ );
        }
 
        /**
@@ -416,7 +415,7 @@ class HistoryPager extends ReverseChronologicalPager {
                        $queryInfo['options'],
                        $this->tagFilter
                );
-               wfRunHooks( 'PageHistoryPager::getQueryInfo', array( &$this, &$queryInfo ) );
+               Hooks::run( 'PageHistoryPager::getQueryInfo', array( &$this, &$queryInfo ) );
 
                return $queryInfo;
        }
@@ -485,12 +484,10 @@ class HistoryPager extends ReverseChronologicalPager {
                // Button container stored in $this->buttons for re-use in getEndBody()
                $this->buttons = '<div>';
                $className = 'historysubmit mw-history-compareselectedversions-button';
-               if ( $this->getConfig()->get( 'UseMediaWikiUIEverywhere' ) ) {
-                       $className .= ' mw-ui-button mw-ui-constructive';
-               }
+               $attrs = array( 'class' => $className )
+                       + Linker::tooltipAndAccesskeyAttribs( 'compareselectedversions' );
                $this->buttons .= $this->submitButton( $this->msg( 'compareselectedversions' )->text(),
-                       array( 'class' => $className )
-                               + Linker::tooltipAndAccesskeyAttribs( 'compareselectedversions' )
+                       $attrs
                ) . "\n";
 
                if ( $this->getUser()->isAllowed( 'deleterevision' ) ) {
@@ -561,7 +558,7 @@ class HistoryPager extends ReverseChronologicalPager {
        function submitButton( $message, $attributes = array() ) {
                # Disable submit button if history has 1 revision only
                if ( $this->getNumRows() > 1 ) {
-                       return Xml::submitButton( $message, $attributes );
+                       return Html::submitButton( $message, $attributes );
                } else {
                        return '';
                }
@@ -708,7 +705,7 @@ class HistoryPager extends ReverseChronologicalPager {
                        }
                }
                // Allow extension to add their own links here
-               wfRunHooks( 'HistoryRevisionTools', array( $rev, &$tools ) );
+               Hooks::run( 'HistoryRevisionTools', array( $rev, &$tools ) );
 
                if ( $tools ) {
                        $s2 .= ' ' . $this->msg( 'parentheses' )->rawParams( $lang->pipeList( $tools ) )->escaped();
@@ -726,7 +723,7 @@ class HistoryPager extends ReverseChronologicalPager {
                        $s .= ' <span class="mw-changeslist-separator">. .</span> ' . $s2;
                }
 
-               wfRunHooks( 'PageHistoryLineEnding', array( $this, &$row, &$s, &$classes ) );
+               Hooks::run( 'PageHistoryLineEnding', array( $this, &$row, &$s, &$classes ) );
 
                $attribs = array();
                if ( $classes ) {