Merge "Replace use of deprecated methods in Linker and SkinFactory classes"
[lhc/web/wiklou.git] / includes / specials / pagers / BlockListPager.php
index 2b8d1d5..a2dbb72 100644 (file)
@@ -22,7 +22,6 @@
 /**
  * @ingroup Pager
  */
-use MediaWiki\Block\BlockRestriction;
 use MediaWiki\Block\Restriction\Restriction;
 use MediaWiki\Block\Restriction\PageRestriction;
 use MediaWiki\Block\Restriction\NamespaceRestriction;
@@ -191,10 +190,8 @@ class BlockListPager extends TablePager {
                        case 'ipb_params':
                                $properties = [];
 
-                               if ( $this->getConfig()->get( 'EnablePartialBlocks' ) ) {
-                                       if ( $row->ipb_sitewide ) {
-                                               $properties[] = htmlspecialchars( $msg['blocklist-editing-sitewide'] );
-                                       }
+                               if ( $this->getConfig()->get( 'EnablePartialBlocks' ) && $row->ipb_sitewide ) {
+                                       $properties[] = htmlspecialchars( $msg['blocklist-editing-sitewide'] );
                                }
 
                                if ( !$row->ipb_sitewide && $this->restrictions ) {
@@ -252,6 +249,7 @@ class BlockListPager extends TablePager {
         */
        private function getRestrictionListHTML( stdClass $row ) {
                $items = [];
+               $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
 
                foreach ( $this->restrictions as $restriction ) {
                        if ( $restriction->getBlockId() !== (int)$row->ipb_id ) {
@@ -264,20 +262,20 @@ class BlockListPager extends TablePager {
                                                $items[$restriction->getType()][] = Html::rawElement(
                                                        'li',
                                                        [],
-                                                       Linker::link( $restriction->getTitle() )
+                                                       $linkRenderer->makeLink( $restriction->getTitle() )
                                                );
                                        }
                                        break;
                                case NamespaceRestriction::TYPE:
                                        $text = $restriction->getValue() === NS_MAIN
-                                               ? $this->msg( 'blanknamespace' )
+                                               ? $this->msg( 'blanknamespace' )->text()
                                                : $this->getLanguage()->getFormattedNsText(
                                                        $restriction->getValue()
                                                );
                                        $items[$restriction->getType()][] = Html::rawElement(
                                                'li',
                                                [],
-                                               Linker::link(
+                                               $linkRenderer->makeLink(
                                                        SpecialPage::getTitleValueFor( 'Allpages' ),
                                                        $text,
                                                        [],
@@ -421,7 +419,8 @@ class BlockListPager extends TablePager {
                if ( $partialBlocks ) {
                        // Mutations to the $row object are not persisted. The restrictions will
                        // need be stored in a separate store.
-                       $this->restrictions = BlockRestriction::loadByBlockId( $partialBlocks );
+                       $blockRestrictionStore = MediaWikiServices::getInstance()->getBlockRestrictionStore();
+                       $this->restrictions = $blockRestrictionStore->loadByBlockId( $partialBlocks );
                }
 
                $lb->execute();