jenkins-bot has submitted this change and it was merged.
Change subject: Use context in NewsletterLinksGenerator::getSubtitleLinks()
......................................................................
Use context in NewsletterLinksGenerator::getSubtitleLinks()
Pass IContextSource as a parameter and get rid of globals.
Change-Id: Ifc202372096edc1c82539af55a505e0d1f73a850
---
M includes/specials/NewsletterLinksGenerator.php
M includes/specials/SpecialNewsletter.php
M includes/specials/SpecialNewsletterCreate.php
M includes/specials/SpecialNewsletterManage.php
M includes/specials/SpecialNewsletters.php
5 files changed, 9 insertions(+), 9 deletions(-)
Approvals:
01tonythomas: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/specials/NewsletterLinksGenerator.php
b/includes/specials/NewsletterLinksGenerator.php
index c4b7bb2..d5c9463 100644
--- a/includes/specials/NewsletterLinksGenerator.php
+++ b/includes/specials/NewsletterLinksGenerator.php
@@ -9,11 +9,11 @@
/**
* Get links to newsletter special pages shown in the subtitle
*
+ * @param IContextSource $context
+ *
* @return string
*/
- public static function getSubtitleLinks() {
- global $wgLang;
-
+ public static function getSubtitleLinks( IContextSource $context ) {
$pages = array(
'list' => 'Newsletters',
'create' => 'NewsletterCreate',
@@ -27,11 +27,11 @@
// 'newsletter-subtitlelinks-manage'
$links[] = Linker::linkKnown(
SpecialPage::getTitleFor( $title ),
- wfMessage( 'newsletter-subtitlelinks-' . $txt
)->escaped()
+ $context->msg( 'newsletter-subtitlelinks-' .
$txt )->escaped()
);
}
- return wfMessage( 'parentheses' )->rawParams(
$wgLang->pipeList( $links ) )->escaped();
+ return $context->msg( 'parentheses' )->rawParams(
$context->getLanguage()->pipeList( $links ) )->escaped();
}
}
diff --git a/includes/specials/SpecialNewsletter.php
b/includes/specials/SpecialNewsletter.php
index e15d399..6309fef 100644
--- a/includes/specials/SpecialNewsletter.php
+++ b/includes/specials/SpecialNewsletter.php
@@ -65,7 +65,7 @@
// Just show an error message if we couldn't find a
newsletter
$out->showErrorPage( 'newsletter-notfound',
'newsletter-not-found-id' );
}
- $out->setSubtitle( NewsletterLinksGenerator::getSubtitleLinks()
);
+ $out->setSubtitle( NewsletterLinksGenerator::getSubtitleLinks(
$this->getContext() ) );
}
/**
diff --git a/includes/specials/SpecialNewsletterCreate.php
b/includes/specials/SpecialNewsletterCreate.php
index ff8261e..293c6b3 100644
--- a/includes/specials/SpecialNewsletterCreate.php
+++ b/includes/specials/SpecialNewsletterCreate.php
@@ -16,7 +16,7 @@
public function execute( $par ) {
$this->requireLogin();
parent::execute( $par );
- $this->getOutput()->setSubtitle(
NewsletterLinksGenerator::getSubtitleLinks() );
+ $this->getOutput()->setSubtitle(
NewsletterLinksGenerator::getSubtitleLinks( $this->getContext() ) );
}
/**
diff --git a/includes/specials/SpecialNewsletterManage.php
b/includes/specials/SpecialNewsletterManage.php
index 22fedca..1d1fcd8 100644
--- a/includes/specials/SpecialNewsletterManage.php
+++ b/includes/specials/SpecialNewsletterManage.php
@@ -17,7 +17,7 @@
$this->setHeaders();
$output = $this->getOutput();
$output->addModules( 'ext.newslettermanage' );
- $output->setSubtitle(
NewsletterLinksGenerator::getSubtitleLinks() );
+ $output->setSubtitle(
NewsletterLinksGenerator::getSubtitleLinks( $this->getContext() ) );
$this->requireLogin();
# Create HTML forms
diff --git a/includes/specials/SpecialNewsletters.php
b/includes/specials/SpecialNewsletters.php
index e18868a..9d989ee 100644
--- a/includes/specials/SpecialNewsletters.php
+++ b/includes/specials/SpecialNewsletters.php
@@ -22,7 +22,7 @@
$out->addModuleStyles( 'ext.newsletter.styles' );
$out->addModules( 'ext.newsletter' );
}
- $out->setSubtitle( NewsletterLinksGenerator::getSubtitleLinks()
);
+ $out->setSubtitle( NewsletterLinksGenerator::getSubtitleLinks(
$this->getContext() ) );
$pager = new NewsletterTablePager();
if ( $pager->getNumRows() > 0 ) {
--
To view, visit https://gerrit.wikimedia.org/r/249994
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ifc202372096edc1c82539af55a505e0d1f73a850
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Newsletter
Gerrit-Branch: master
Gerrit-Owner: Glaisher <[email protected]>
Gerrit-Reviewer: 01tonythomas <[email protected]>
Gerrit-Reviewer: Addshore <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits