History page is now using pseudo elements for presentation
[lhc/web/wiklou.git] / includes / Linker.php
index a02d57d..ec3b245 100644 (file)
@@ -1077,16 +1077,18 @@ class Linker {
         * @since 1.16.3
         * @param Revision $rev
         * @param bool $isPublic Show only if all users can see it
+        * @param bool $useParentheses (optional) Wrap comments in parentheses where needed
         * @return string HTML
         */
-       public static function revUserTools( $rev, $isPublic = false ) {
+       public static function revUserTools( $rev, $isPublic = false, $useParentheses = true ) {
                if ( $rev->isDeleted( Revision::DELETED_USER ) && $isPublic ) {
                        $link = wfMessage( 'rev-deleted-user' )->escaped();
                } elseif ( $rev->userCan( Revision::DELETED_USER ) ) {
                        $userId = $rev->getUser( Revision::FOR_THIS_USER );
                        $userText = $rev->getUserText( Revision::FOR_THIS_USER );
                        $link = self::userLink( $userId, $userText )
-                               . self::userToolLinks( $userId, $userText );
+                               . self::userToolLinks( $userId, $userText, false, 0, null,
+                                       $useParentheses );
                } else {
                        $link = wfMessage( 'rev-deleted-user' )->escaped();
                }
@@ -1532,9 +1534,8 @@ class Linker {
                        $stxt = wfMessage( 'historyempty' )->escaped();
                } else {
                        $stxt = wfMessage( 'nbytes' )->numParams( $size )->escaped();
-                       $stxt = wfMessage( 'parentheses' )->rawParams( $stxt )->escaped();
                }
-               return "<span class=\"history-size\">$stxt</span>";
+               return "<span class=\"history-size mw-diff-bytes\">$stxt</span>";
        }
 
        /**
@@ -1710,12 +1711,8 @@ class Linker {
        static function splitTrail( $trail ) {
                $regex = MediaWikiServices::getInstance()->getContentLanguage()->linkTrail();
                $inside = '';
-               if ( $trail !== '' ) {
-                       $m = [];
-                       if ( preg_match( $regex, $trail, $m ) ) {
-                               $inside = $m[1];
-                               $trail = $m[2];
-                       }
+               if ( $trail !== '' && preg_match( $regex, $trail, $m ) ) {
+                       list( , $inside, $trail ) = $m;
                }
                return [ $inside, $trail ];
        }
@@ -1768,7 +1765,15 @@ class Linker {
                        $inner = $context->msg( 'brackets' )->rawParams( $inner )->escaped();
                }
 
-               if ( $context->getUser()->getBoolOption( 'showrollbackconfirmation' ) ) {
+               /**
+                * FIXME
+                * Remove all references to DisableRollbackConfirmationFeature
+                * after release of rollback feature. See T199534
+                */
+               if ( !MediaWikiServices::getInstance()
+                               ->getMainConfig()->get( 'DisableRollbackConfirmationFeature' ) &&
+                        $context->getUser()->getBoolOption( 'showrollbackconfirmation' )
+               ) {
                        $stats = MediaWikiServices::getInstance()->getStatsdDataFactory();
                        $stats->increment( 'rollbackconfirmation.event.load' );
                        $context->getOutput()->addModules( 'mediawiki.page.rollback.confirmation' );
@@ -1876,8 +1881,7 @@ class Linker {
 
                $attrs = [
                        'data-mw' => 'interface',
-                       'title' => $context->msg( 'tooltip-rollback' )->text(),
-                       'data-rollback-count' => (int)$editCount
+                       'title' => $context->msg( 'tooltip-rollback' )->text()
                ];
 
                $options = [ 'known', 'noclasses' ];