mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/InputBox
synced 2024-11-13 17:53:26 +00:00
Avoid usage of deprecated $wgContLang global (dep in 1.32)
Change-Id: I1c3d9b6d9de3c7ef24f24f45aad9510be3f8b588
This commit is contained in:
parent
a2611d784f
commit
aab9a97c96
|
@ -6,6 +6,8 @@
|
||||||
* @ingroup Extensions
|
* @ingroup Extensions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use MediaWiki\MediaWikiServices;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* InputBox class
|
* InputBox class
|
||||||
*/
|
*/
|
||||||
|
@ -128,7 +130,7 @@ class InputBox {
|
||||||
* @return string HTML
|
* @return string HTML
|
||||||
*/
|
*/
|
||||||
public function getSearchForm( $type ) {
|
public function getSearchForm( $type ) {
|
||||||
global $wgContLang, $wgNamespaceAliases;
|
global $wgNamespaceAliases;
|
||||||
|
|
||||||
// Use button label fallbacks
|
// Use button label fallbacks
|
||||||
if ( !$this->mButtonLabel ) {
|
if ( !$this->mButtonLabel ) {
|
||||||
|
@ -189,8 +191,9 @@ class InputBox {
|
||||||
// Determine namespace checkboxes
|
// Determine namespace checkboxes
|
||||||
$namespacesArray = explode( ',', $this->mNamespaces );
|
$namespacesArray = explode( ',', $this->mNamespaces );
|
||||||
if ( $this->mNamespaces ) {
|
if ( $this->mNamespaces ) {
|
||||||
$namespaces = $wgContLang->getNamespaces();
|
$contLang = MediaWikiServices::getInstance()->getContentLanguage();
|
||||||
$nsAliases = array_merge( $wgContLang->getNamespaceAliases(), $wgNamespaceAliases );
|
$namespaces = $contLang->getNamespaces();
|
||||||
|
$nsAliases = array_merge( $contLang->getNamespaceAliases(), $wgNamespaceAliases );
|
||||||
$showNamespaces = [];
|
$showNamespaces = [];
|
||||||
$checkedNS = [];
|
$checkedNS = [];
|
||||||
// Check for valid namespaces
|
// Check for valid namespaces
|
||||||
|
|
Loading…
Reference in a new issue