* @param $par Mixed: parameter passed to the page or null
*/
public function execute( $par ) {
- global $wgOut, $wgRequest;
+ $request = $this->getRequest();
+ $out = $this->getOutput();
$this->setHeaders();
global $wgUseDatabaseMessages;
if( !$wgUseDatabaseMessages ) {
- $wgOut->addWikiMsg( 'allmessagesnotsupportedDB' );
+ $out->addWikiMsg( 'allmessagesnotsupportedDB' );
return;
} else {
$this->outputHeader( 'allmessagestext' );
}
- $wgOut->addModuleStyles( 'mediawiki.special' );
+ $out->addModuleStyles( 'mediawiki.special' );
- $this->filter = $wgRequest->getVal( 'filter', 'all' );
- $this->prefix = $wgRequest->getVal( 'prefix', '' );
+ $this->filter = $request->getVal( 'filter', 'all' );
+ $this->prefix = $request->getVal( 'prefix', '' );
$this->table = new AllmessagesTablePager(
$this,
array(),
- wfGetLangObj( $wgRequest->getVal( 'lang', $par ) )
+ wfGetLangObj( $request->getVal( 'lang', $par ) )
);
$this->langCode = $this->table->lang->getCode();
- $wgOut->addHTML( $this->buildForm() .
+ $out->addHTML( $this->buildForm() .
$this->table->getNavigationBar() .
$this->table->getLimitForm() .
$this->table->getBody() .
* @param $par String: becomes "FOO" when called like Special:Allpages/FOO (default NULL)
*/
function execute( $par ) {
- global $wgRequest, $wgOut, $wgContLang;
+ global $wgContLang;
+ $request = $this->getRequest();
+ $out = $this->getOutput();
$this->setHeaders();
$this->outputHeader();
- $wgOut->allowClickjacking();
+ $out->allowClickjacking();
# GET values
- $from = $wgRequest->getVal( 'from', null );
- $to = $wgRequest->getVal( 'to', null );
- $namespace = $wgRequest->getInt( 'namespace' );
+ $from = $request->getVal( 'from', null );
+ $to = $request->getVal( 'to', null );
+ $namespace = $request->getInt( 'namespace' );
$namespaces = $wgContLang->getNamespaces();
- $wgOut->setPagetitle(
+ $out->setPagetitle(
( $namespace > 0 && in_array( $namespace, array_keys( $namespaces) ) ) ?
wfMsg( 'allinnamespace', str_replace( '_', ' ', $namespaces[$namespace] ) ) :
wfMsg( 'allarticles' )
);
- $wgOut->addModuleStyles( 'mediawiki.special' );
+ $out->addModuleStyles( 'mediawiki.special' );
if( isset($par) ) {
$this->showChunk( $namespace, $par, $to );
* @param $to String: list all pages to this name
*/
function showToplevel( $namespace = NS_MAIN, $from = '', $to = '' ) {
- global $wgOut;
+ $output = $this->getOutput();
# TODO: Either make this *much* faster or cache the title index points
# in the querycache table.
if( !empty($lines) ) {
$this->showChunk( $namespace, $from, $to );
} else {
- $wgOut->addHTML( $this->namespaceForm( $namespace, $from, $to ) );
+ $output->addHTML( $this->namespaceForm( $namespace, $from, $to ) );
}
return;
}
$out2 = '';
} else {
if( isset($from) || isset($to) ) {
- global $wgUser;
$out2 = Xml::openElement( 'table', array( 'class' => 'mw-allpages-table-form' ) ).
'<tr>
<td>' .
$nsForm .
'</td>
<td class="mw-allpages-nav">' .
- $wgUser->getSkin()->link( $this->getTitle(), wfMsgHtml ( 'allpages' ),
+ $this->getSkin()->link( $this->getTitle(), wfMsgHtml ( 'allpages' ),
array(), array(), 'known' ) .
"</td>
</tr>" .
$out2 = $nsForm;
}
}
- $wgOut->addHTML( $out2 . $out );
+ $output->addHTML( $out2 . $out );
}
/**
* @param $to String: list all pages to this name (default FALSE)
*/
function showChunk( $namespace = NS_MAIN, $from = false, $to = false ) {
- global $wgOut, $wgUser, $wgContLang, $wgLang;
-
- $sk = $wgUser->getSkin();
+ global $wgContLang, $wgLang;
+ $output = $this->getOutput();
+ $sk = $this->getSkin();
$fromList = $this->getNamespaceKeyAndText($namespace, $from);
$toList = $this->getNamespaceKeyAndText( $namespace, $to );
$out2 .= "</td></tr></table>";
}
- $wgOut->addHTML( $out2 . $out );
+ $output->addHTML( $out2 . $out );
$links = array();
if ( isset( $prevLink ) ) $links[] = $prevLink;
if ( isset( $nextLink ) ) $links[] = $nextLink;
if ( count( $links ) ) {
- $wgOut->addHTML(
+ $output->addHTML(
Html::element( 'hr' ) .
Html::rawElement( 'div', array( 'class' => 'mw-allpages-nav' ),
$wgLang->pipeList( $links )