* @param string $par becomes "FOO" when called like Special:Allpages/FOO (default NULL)
*/
function execute( $par ) {
- global $wgContLang;
$request = $this->getRequest();
$out = $this->getOutput();
$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 ) ) ) ?
$out .= Xml::closeElement( 'fieldset' );
$out .= Xml::closeElement( 'form' );
$out .= Xml::closeElement( 'div' );
+
return $out;
}
} else {
$output->addHTML( $this->namespaceForm( $namespace, $from, $to, $hideredirects ) );
}
+
return;
}
* @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 ) );
+
+ $inpointf = str_replace( '_', ' ', $inpoint );
+ $outpointf = str_replace( '_', ' ', $outpoint );
+
// Don't let the length runaway
$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 ) {
$queryParams['hideredirects'] = 1;
}
- $link = htmlspecialchars(
- $this->getTitle()->getLocalURL( $queryParams ) );
+ $url = $this->getTitle()->getLocalURL( $queryParams );
+ $inlink = Html::element( 'a', array( 'href' => $url ), $inpointf );
+ $outlink = Html::element( 'a', array( 'href' => $url ), $outpointf );
$out = $this->msg( 'alphaindexline' )->rawParams(
- "<a href=\"$link\">$inpointf</a></td><td>",
- "</td><td><a href=\"$link\">$outpointf</a>"
+ "$inlink</td><td>",
+ "</td><td>$outlink"
)->escaped();
+
return '<tr><td class="mw-allpages-alphaindexline">' . $out . '</td></tr>';
}
* @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 ) {
)
);
}
-
}
/**