aboutsummaryrefslogtreecommitdiffstats
path: root/includes/Html.php
diff options
context:
space:
mode:
authorAryeh Gregor <ayg@aryeh.name>2018-07-29 15:24:54 +0300
committerKunal Mehta <legoktm@member.fsf.org>2018-08-11 22:44:29 -0600
commit90d4f56fe46140f9e97e2fa72698f98b57447fe5 (patch)
treeaafd71518a89d31a647ae7d4340f1003bc33d3a0 /includes/Html.php
parent8f8851325ece1be57c7cd896db7f65b34fee7a88 (diff)
downloadmediawikicore-90d4f56fe46140f9e97e2fa72698f98b57447fe5.tar.gz
mediawikicore-90d4f56fe46140f9e97e2fa72698f98b57447fe5.zip
Mass conversion of $wgContLang to service
Brought to you by vim macros. Bug: T200246 Change-Id: I79e919f4553e3bd3eb714073fed7a43051b4fb2a
Diffstat (limited to 'includes/Html.php')
-rw-r--r--includes/Html.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/includes/Html.php b/includes/Html.php
index ad0130bf8f0d..32375c1f57cb 100644
--- a/includes/Html.php
+++ b/includes/Html.php
@@ -22,6 +22,7 @@
*
* @file
*/
+use MediaWiki\MediaWikiServices;
/**
* This class is a collection of static functions that serve two purposes:
@@ -824,8 +825,6 @@ class Html {
* @return array
*/
public static function namespaceSelectorOptions( array $params = [] ) {
- global $wgContLang;
-
$options = [];
if ( !isset( $params['exclude'] ) || !is_array( $params['exclude'] ) ) {
@@ -838,7 +837,8 @@ class Html {
$options[$params['all']] = wfMessage( 'namespacesall' )->text();
}
// Add all namespaces as options (in the content language)
- $options += $wgContLang->getFormattedNamespaces();
+ $options +=
+ MediaWikiServices::getInstance()->getContentLanguage()->getFormattedNamespaces();
$optionsOut = [];
// Filter out namespaces below 0 and massage labels
@@ -851,7 +851,8 @@ class Html {
// main we don't use "" but the user message describing it (e.g. "(Main)" or "(Article)")
$nsName = wfMessage( 'blanknamespace' )->text();
} elseif ( is_int( $nsId ) ) {
- $nsName = $wgContLang->convertNamespace( $nsId );
+ $nsName = MediaWikiServices::getInstance()->getContentLanguage()->
+ convertNamespace( $nsId );
}
$optionsOut[$nsId] = $nsName;
}