Georggi199 has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/329769 )
Change subject: Replaced deprecated Linker::link() usages ...................................................................... Replaced deprecated Linker::link() usages Bug: T149346 Change-Id: Ic872dac40945eae635bd8c566f8a014244110e9a --- M SystemGifts/SpecialViewSystemGifts.php M SystemGifts/TopAwards.php M UserActivity/UserActivity.body.php M UserBoard/SpecialUserBoard.php M UserGifts/SpecialGiveGift.php M UserGifts/SpecialViewGifts.php M UserProfile/UserProfileClass.php M UserProfile/UserProfilePage.php M UserRelationship/SpecialViewRelationships.php M UserStats/TopFansByStat.php M UserStats/TopFansRecent.php M UserStats/TopUsers.php 12 files changed, 45 insertions(+), 26 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SocialProfile refs/changes/69/329769/1 diff --git a/SystemGifts/SpecialViewSystemGifts.php b/SystemGifts/SpecialViewSystemGifts.php index 4714c4e..8ec1f41 100644 --- a/SystemGifts/SpecialViewSystemGifts.php +++ b/SystemGifts/SpecialViewSystemGifts.php @@ -23,6 +23,8 @@ public function execute( $par ) { global $wgUploadPath; + $linkRenderer = $this->getLinkRenderer(); + $out = $this->getOutput(); $request = $this->getRequest(); $user = $this->getUser(); @@ -141,7 +143,7 @@ $output .= '<div class="page-nav">'; if ( $page > 1 ) { - $output .= Linker::link( + $output .= $linkRenderer->makeLink( $page_link, $this->msg( 'ga-previous' )->plain(), array(), @@ -166,7 +168,7 @@ if ( $i == $page ) { $output .= ( $i . ' ' ); } else { - $output .= Linker::link( + $output .= $linkRenderer->makeLink( $page_link, $i, array(), @@ -180,7 +182,7 @@ if ( ( $total - ( $per_page * $page ) ) > 0 ) { $output .= $this->msg( 'word-separator' )->plain() . - Linker::link( + $linkRenderer->makeLink( $page_link, $this->msg( 'ga-next' )->plain(), array(), diff --git a/SystemGifts/TopAwards.php b/SystemGifts/TopAwards.php index 2b39b78..5a18a4a 100644 --- a/SystemGifts/TopAwards.php +++ b/SystemGifts/TopAwards.php @@ -158,6 +158,7 @@ if ( $dbr->numRows( $res ) <= 0 ) { $output .= $this->msg( 'topawards-empty' )->plain(); } else { + $linkRenderer = $this->getLinkRenderer(); foreach ( $res as $row ) { $user_name = $row->sg_user_name; $user_id = $row->sg_user_id; @@ -181,7 +182,7 @@ $x++; } - $userLink = Linker::link( + $userLink = $linkRenderer->makeLink( Title::makeTitle( NS_USER, $row->sg_user_name ), $user_name ); diff --git a/UserActivity/UserActivity.body.php b/UserActivity/UserActivity.body.php index f72f45e..8d5e1fb 100644 --- a/UserActivity/UserActivity.body.php +++ b/UserActivity/UserActivity.body.php @@ -129,7 +129,7 @@ } } - $output .= Linker::link( + $output .= $this->getLinkRenderer()->makeLink( $this->getPageTitle(), $this->msg( 'useractivity-all' )->plain() ); diff --git a/UserBoard/SpecialUserBoard.php b/UserBoard/SpecialUserBoard.php index b230b4c..c2a7936 100644 --- a/UserBoard/SpecialUserBoard.php +++ b/UserBoard/SpecialUserBoard.php @@ -37,6 +37,8 @@ $request = $this->getRequest(); $currentUser = $this->getUser(); + $linkRenderer = $this->getLinkRenderer(); + // Set the page title, robot policies, etc. $this->setHeaders(); @@ -170,7 +172,7 @@ if ( $numofpages > 1 ) { $output .= '<div class="page-nav">'; if ( $page > 1 ) { - $output .= Linker::link( + $output .= $linkRenderer->makeLink( $this->getPageTitle(), $this->msg( 'userboard_prevpage' )->plain(), array(), @@ -195,7 +197,7 @@ if ( $i == $page ) { $output .= ( $i . ' ' ); } else { - $output .= Linker::link( + $output .= $linkRenderer->makeLink( $this->getPageTitle(), $i, array(), @@ -209,7 +211,7 @@ if ( ( $total - ( $per_page * $page ) ) > 0 ) { $output .= $this->msg( 'word-separator' )->plain() . - Linker::link( + $linkRenderer->makeLink( $this->getPageTitle(), $this->msg( 'userboard_nextpage' )->plain(), array(), diff --git a/UserGifts/SpecialGiveGift.php b/UserGifts/SpecialGiveGift.php index 5550bd7..78ec2e5 100644 --- a/UserGifts/SpecialGiveGift.php +++ b/UserGifts/SpecialGiveGift.php @@ -294,6 +294,8 @@ function displayFormAll() { global $wgGiveGiftPerRow, $wgUploadPath; + $linkRenderer = $this->getLinkRenderer(); + $out = $this->getOutput(); $user = Title::makeTitle( NS_USER, $this->user_name_to ); @@ -358,7 +360,7 @@ if ( $numofpages > 1 ) { $output .= '<div class="page-nav">'; if ( $page > 1 ) { - $output .= Linker::link( + $output .= $linkRenderer->makeLink( $giveGiftLink, $this->msg( 'g-previous' )->plain(), array(), @@ -379,7 +381,7 @@ if ( $i == $page ) { $output .= ( $i . ' ' ); } else { - $output .= Linker::link( + $output .= $linkRenderer->makeLink( $giveGiftLink, $i, array(), @@ -393,7 +395,7 @@ if ( ( $total - ( $per_page * $page ) ) > 0 ) { $output .= $this->msg( 'word-separator' )->plain() . - Linker::link( + $linkRenderer->makeLink( $giveGiftLink, $this->msg( 'g-next' )->plain(), array(), diff --git a/UserGifts/SpecialViewGifts.php b/UserGifts/SpecialViewGifts.php index 455c759..40ff634 100644 --- a/UserGifts/SpecialViewGifts.php +++ b/UserGifts/SpecialViewGifts.php @@ -33,6 +33,8 @@ public function execute( $par ) { global $wgUploadPath; + $linkRenderer = $this->getLinkRenderer(); + $out = $this->getOutput(); $request = $this->getRequest(); $currentUser = $this->getUser(); @@ -180,7 +182,7 @@ if ( $numofpages > 1 ) { $output .= '<div class="page-nav">'; if ( $page > 1 ) { - $output .= Linker::link( + $output .= $linkRenderer->makeLink( $pageLink, $this->msg( 'g-previous' )->plain(), array(), @@ -205,7 +207,7 @@ if ( $i == $page ) { $output .= ( $i . ' ' ); } else { - $output .= Linker::link( + $output .= $linkRenderer->makeLink( $pageLink, $i, array(), @@ -219,7 +221,7 @@ if ( ( $total - ( $per_page * $page ) ) > 0 ) { $output .= $this->msg( 'word-separator' )->plain() . - Linker::link( + $linkRenderer->makeLink( $pageLink, $this->msg( 'g-next' )->plain(), array(), diff --git a/UserProfile/UserProfileClass.php b/UserProfile/UserProfileClass.php index 455b5b3..f1ab2c8 100644 --- a/UserProfile/UserProfileClass.php +++ b/UserProfile/UserProfileClass.php @@ -1,4 +1,6 @@ <?php +use MediaWiki\MediaWikiServices; + /** * Class to access profile data for a user */ @@ -227,6 +229,7 @@ static function getEditProfileNav( $current_nav ) { $lines = explode( "\n", wfMessage( 'update_profile_nav' )->inContentLanguage()->text() ); $output = '<div class="profile-tab-bar">'; + $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer(); foreach ( $lines as $line ) { if ( strpos( $line, '*' ) !== 0 ) { @@ -243,7 +246,7 @@ } $output .= '<div class="profile-tab' . ( ( $current_nav == $link_text ) ? '-on' : '' ) . '">'; - $output .= Linker::link( $page, $link_text ); + $output .= $linkRenderer->makeLink( $page, $link_text ); $output .= '</div>'; } } diff --git a/UserProfile/UserProfilePage.php b/UserProfile/UserProfilePage.php index 1a1bac2..2027e25 100644 --- a/UserProfile/UserProfilePage.php +++ b/UserProfile/UserProfilePage.php @@ -1,4 +1,6 @@ <?php +use MediaWiki\MediaWikiServices; + /** * User profile Wiki Page * @@ -1713,7 +1715,8 @@ // If there are more than ten fanboxes, display a "View all" link // instead of listing them all on the profile page if ( $fanbox_count > 10 ) { - $output .= Linker::link( + $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer(); + $output .= $linkRenderer->makeLink( $fanbox_link, wfMessage( 'user-view-all' )->plain(), array(), diff --git a/UserRelationship/SpecialViewRelationships.php b/UserRelationship/SpecialViewRelationships.php index 243abda..017f712 100644 --- a/UserRelationship/SpecialViewRelationships.php +++ b/UserRelationship/SpecialViewRelationships.php @@ -39,6 +39,7 @@ $out = $this->getOutput(); $request = $this->getRequest(); $user = $this->getUser(); + $linkRenderer = $this->getLinkRenderer(); // Set the page title, robot policies, etc. $this->setHeaders(); @@ -198,13 +199,13 @@ if ( $indivRelationship == false ) { $output .= $lang->pipeList( array( - Linker::link( + $linkRenderer->makeLink( $addRelationshipLink, $this->msg( 'ur-add-friend' )->plain(), array(), array( 'user' => $relationship['user_name'], 'rel_type' => 1 ) ), - Linker::link( + $linkRenderer->makeLink( $addRelationshipLink, $this->msg( 'ur-add-foe' )->plain(), array(), @@ -213,7 +214,7 @@ '' ) ); } elseif ( $user_name == $user->getName() ) { - $output .= Linker::link( + $output .= $linkRenderer->makeLink( $removeRelationshipLink, $rem, array(), @@ -222,7 +223,7 @@ $output .= $this->msg( 'pipe-separator' )->escaped(); } - $output .= Linker::link( + $output .= $linkRenderer->makeLink( $giveGiftLink, $this->msg( 'ur-give-gift' )->plain(), array(), @@ -252,7 +253,7 @@ if ( $numofpages > 1 ) { $output .= '<div class="page-nav">'; if ( $page > 1 ) { - $output .= Linker::link( + $output .= $linkRenderer->makeLink( $pageLink, $this->msg( 'ur-previous' )->plain(), array(), @@ -278,7 +279,7 @@ if ( $i == $page ) { $output .= ( $i . ' ' ); } else { - $output .= Linker::link( + $output .= $linkRenderer->makeLink( $pageLink, $i, array(), @@ -293,7 +294,7 @@ if ( ( $total - ( $per_page * $page ) ) > 0 ) { $output .= $this->msg( 'word-separator' )->plain() . - Linker::link( + $linkRenderer->makeLink( $pageLink, $this->msg( 'ur-next' )->plain(), array(), diff --git a/UserStats/TopFansByStat.php b/UserStats/TopFansByStat.php index 27355ef..b4ab7cb 100644 --- a/UserStats/TopFansByStat.php +++ b/UserStats/TopFansByStat.php @@ -138,6 +138,7 @@ $output .= '<h1 class="top-title">' . $this->msg( 'top-fans-by-category-nav-header' )->plain() . '</h1>'; + $linkRenderer = $this->getLinkRenderer(); $lines = explode( "\n", $message->text() ); foreach ( $lines as $line ) { if ( strpos( $line, '*' ) !== 0 ) { @@ -155,7 +156,7 @@ } $output .= '<p>'; - $output .= Linker::link( + $output .= $linkRenderer->makeLink( $this->getPageTitle(), $link_text, array(), diff --git a/UserStats/TopFansRecent.php b/UserStats/TopFansRecent.php index a315d67..ff31884 100644 --- a/UserStats/TopFansRecent.php +++ b/UserStats/TopFansRecent.php @@ -130,6 +130,7 @@ $output .= '<h1 class="top-title">' . $this->msg( 'top-fans-by-category-nav-header' )->plain() . '</h1>'; + $linkRenderer = $this->getLinkRenderer(); $lines = explode( "\n", $message->text() ); foreach ( $lines as $line ) { if ( strpos( $line, '*' ) !== 0 ) { @@ -147,7 +148,7 @@ } $output .= '<p>'; - $output .= Linker::link( + $output .= $linkRenderer->makeLink( $by_category_title, $link_text, array(), diff --git a/UserStats/TopUsers.php b/UserStats/TopUsers.php index 2490653..ca27d49 100644 --- a/UserStats/TopUsers.php +++ b/UserStats/TopUsers.php @@ -109,6 +109,7 @@ $output .= '<h1 style="margin-top:15px !important;">' . $this->msg( 'top-fans-by-category-nav-header' )->plain() . '</h1>'; + $linkRenderer = $this->getLinkRenderer(); $lines = explode( "\n", $byCategoryMessage->text() ); foreach ( $lines as $line ) { if ( strpos( $line, '*' ) !== 0 ) { @@ -126,7 +127,7 @@ } $output .= '<p> '; - $output .= Linker::link( + $output .= $linkRenderer->makeLink( $by_category_title, $link_text, array(), -- To view, visit https://gerrit.wikimedia.org/r/329769 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic872dac40945eae635bd8c566f8a014244110e9a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SocialProfile Gerrit-Branch: master Gerrit-Owner: Georggi199 <bmp2...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits