Merge "Convert Special:DeletedContributions to use OOUI."
[lhc/web/wiklou.git] / includes / logging / BlockLogFormatter.php
index aa90d1d..c390232 100644 (file)
@@ -22,6 +22,8 @@
  * @since 1.25
  */
 
+use MediaWiki\MediaWikiServices;
+
 /**
  * This class formats block log entries.
  *
@@ -58,7 +60,8 @@ class BlockLogFormatter extends LogFormatter {
                        // is shown on the correct side of the tooltip text.
                        $durationTooltip = '‎' . htmlspecialchars( $params[4] );
                        $params[4] = Message::rawParam( "<span class='blockExpiry' title='$durationTooltip'>" .
-                               $this->context->getLanguage()->translateBlockExpiry( $params[4] ) . '</span>' );
+                               $this->context->getLanguage()->translateBlockExpiry( $params[4],
+                                       $this->context->getUser() ) . '</span>' );
                        $params[5] = isset( $params[5] ) ?
                                self::formatBlockFlags( $params[5], $this->context->getLanguage() ) : '';
                }
@@ -90,6 +93,7 @@ class BlockLogFormatter extends LogFormatter {
 
        public function getActionLinks() {
                $subtype = $this->entry->getSubtype();
+               $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
                if ( $this->entry->isDeleted( LogPage::DELETED_ACTION ) // Action is hidden
                        || !( $subtype === 'block' || $subtype === 'reblock' )
                        || !$this->context->getUser()->isAllowed( 'block' )
@@ -100,13 +104,13 @@ class BlockLogFormatter extends LogFormatter {
                // Show unblock/change block link
                $title = $this->entry->getTarget();
                $links = [
-                       Linker::linkKnown(
+                       $linkRenderer->makeKnownLink(
                                SpecialPage::getTitleFor( 'Unblock', $title->getDBkey() ),
-                               $this->msg( 'unblocklink' )->escaped()
+                               $this->msg( 'unblocklink' )->text()
                        ),
-                       Linker::linkKnown(
+                       $linkRenderer->makeKnownLink(
                                SpecialPage::getTitleFor( 'Block', $title->getDBkey() ),
-                               $this->msg( 'change-blocklink' )->escaped()
+                               $this->msg( 'change-blocklink' )->text()
                        )
                ];