X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2Fspecials%2FSpecialAllpages.php;h=98ec4f665c0d8b5ce941b74d223b67321009ab1e;hb=5d3dbc64aada672802b5316f293b36095555d1c7;hp=942b7672163a121e546a9e81da47a62c6c2502fe;hpb=cf0872c783946242698bfaf9bd134d503fc393fc;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialAllpages.php b/includes/specials/SpecialAllpages.php index 942b767216..98ec4f665c 100644 --- a/includes/specials/SpecialAllpages.php +++ b/includes/specials/SpecialAllpages.php @@ -71,7 +71,6 @@ class SpecialAllpages extends IncludableSpecialPage { * @param string $par becomes "FOO" when called like Special:Allpages/FOO (default NULL) */ function execute( $par ) { - global $wgContLang; $request = $this->getRequest(); $out = $this->getOutput(); @@ -85,7 +84,7 @@ class SpecialAllpages extends IncludableSpecialPage { $namespace = $request->getInt( 'namespace' ); $hideredirects = $request->getBool( 'hideredirects', false ); - $namespaces = $wgContLang->getNamespaces(); + $namespaces = $this->getContext()->getLanguage()->getNamespaces(); $out->setPageTitle( ( $namespace > 0 && in_array( $namespace, array_keys( $namespaces ) ) ) ? @@ -160,6 +159,7 @@ class SpecialAllpages extends IncludableSpecialPage { $out .= Xml::closeElement( 'fieldset' ); $out .= Xml::closeElement( 'form' ); $out .= Xml::closeElement( 'div' ); + return $out; } @@ -259,6 +259,7 @@ class SpecialAllpages extends IncludableSpecialPage { } else { $output->addHTML( $this->namespaceForm( $namespace, $from, $to, $hideredirects ) ); } + return; } @@ -305,6 +306,7 @@ class SpecialAllpages extends IncludableSpecialPage { * @return string */ function showline( $inpoint, $outpoint, $namespace = NS_MAIN, $hideRedirects = false ) { + // Use content language since page titles are considered to use content language global $wgContLang; $inpointf = htmlspecialchars( str_replace( '_', ' ', $inpoint ) ); $outpointf = htmlspecialchars( str_replace( '_', ' ', $outpoint ) ); @@ -312,12 +314,12 @@ class SpecialAllpages extends IncludableSpecialPage { $inpointf = $wgContLang->truncate( $inpointf, $this->maxPageLength ); $outpointf = $wgContLang->truncate( $outpointf, $this->maxPageLength ); - $queryParams = array ( + $queryParams = array( 'from' => $inpoint, 'to' => $outpoint, ); - if( $namespace ) { + if ( $namespace ) { $queryParams['namespace'] = $namespace; } if ( $hideRedirects ) { @@ -331,22 +333,22 @@ class SpecialAllpages extends IncludableSpecialPage { "$inpointf", "$outpointf" )->escaped(); + return '' . $out . ''; } /** - * @param $namespace Integer (Default NS_MAIN) + * @param int $namespace Namespace (Default NS_MAIN) * @param string $from list all pages from this name (default FALSE) * @param string $to list all pages to this name (default FALSE) * @param bool $hideredirects dont show redirects (default FALSE) */ function showChunk( $namespace = NS_MAIN, $from = false, $to = false, $hideredirects = false ) { - global $wgContLang; $output = $this->getOutput(); $fromList = $this->getNamespaceKeyAndText( $namespace, $from ); $toList = $this->getNamespaceKeyAndText( $namespace, $to ); - $namespaces = $wgContLang->getNamespaces(); + $namespaces = $this->getContext()->getLanguage()->getNamespaces(); $n = 0; if ( !$fromList || !$toList ) { @@ -532,7 +534,6 @@ class SpecialAllpages extends IncludableSpecialPage { ) ); } - } /**