Merge "Convert article delete to use OOUI"
[lhc/web/wiklou.git] / includes / CategoryViewer.php
index facf847..9d692d7 100644 (file)
@@ -108,7 +108,6 @@ class CategoryViewer extends ContextSource {
         * @return string HTML output
         */
        public function getHTML() {
-
                $this->showGallery = $this->getConfig()->get( 'CategoryMagicGallery' )
                        && !$this->getOutput()->mNoGallery;
 
@@ -632,11 +631,12 @@ class CategoryViewer extends ContextSource {
        private function pagingLinks( $first, $last, $type = '' ) {
                $prevLink = $this->msg( 'prev-page' )->text();
 
+               $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
                if ( $first != '' ) {
                        $prevQuery = $this->query;
                        $prevQuery["{$type}until"] = $first;
                        unset( $prevQuery["{$type}from"] );
-                       $prevLink = Linker::linkKnown(
+                       $prevLink = $linkRenderer->makeKnownLink(
                                $this->addFragmentToTitle( $this->title, $type ),
                                $prevLink,
                                [],
@@ -650,7 +650,7 @@ class CategoryViewer extends ContextSource {
                        $lastQuery = $this->query;
                        $lastQuery["{$type}from"] = $last;
                        unset( $lastQuery["{$type}until"] );
-                       $nextLink = Linker::linkKnown(
+                       $nextLink = $linkRenderer->makeKnownLink(
                                $this->addFragmentToTitle( $this->title, $type ),
                                $nextLink,
                                [],
@@ -739,10 +739,7 @@ class CategoryViewer extends ContextSource {
                        // to refresh the incorrect category table entry -- which should be
                        // quick due to the small number of entries.
                        $totalcnt = $rescnt;
-                       $category = $this->cat;
-                       DeferredUpdates::addCallableUpdate( function () use ( $category ) {
-                               $category->refreshCounts();
-                       } );
+                       DeferredUpdates::addCallableUpdate( [ $this->cat, 'refreshCounts' ] );
                } else {
                        // Case 3: hopeless.  Don't give a total count at all.
                        // Messages: category-subcat-count-limited, category-article-count-limited,