$this->setHeaders();
$this->outputHeader();
+ $config = $this->getConfig();
// Set some variables
$this->curonly = true;
}
}
}
- } elseif ( $request->getCheck( 'addns' ) && $wgExportFromNamespaces ) {
+ } elseif ( $request->getCheck( 'addns' ) && $config->get( 'ExportFromNamespaces' ) ) {
$page = $request->getText( 'pages' );
$nsindex = $request->getText( 'nsindex', '' );
$page .= "\n" . implode( "\n", $nspages );
}
}
- } elseif ( $request->getCheck( 'exportall' ) && $wgExportAllowAll ) {
+ } elseif ( $request->getCheck( 'exportall' ) && $config->get( 'ExportAllowAll' ) ) {
$this->doExport = true;
$exportall = true;
$offset = null;
}
+ $maxHistory = $config->get( 'ExportMaxHistory' );
$limit = $request->getInt( 'limit' );
$dir = $request->getVal( 'dir' );
$history = array(
'dir' => 'asc',
'offset' => false,
- 'limit' => $wgExportMaxHistory,
+ 'limit' => $maxHistory,
);
$historyCheck = $request->getCheck( 'history' );
if ( $this->curonly ) {
$history = WikiExporter::CURRENT;
} elseif ( !$historyCheck ) {
- if ( $limit > 0 && ( $wgExportMaxHistory == 0 || $limit < $wgExportMaxHistory ) ) {
+ if ( $limit > 0 && ( $maxHistory == 0 || $limit < $maxHistory ) ) {
$history['limit'] = $limit;
}
}
}
- if ( !$wgExportAllowHistory ) {
+ if ( !$config->get( 'ExportAllowHistory' ) ) {
// Override
$history = WikiExporter::CURRENT;
}
$list_authors = $request->getCheck( 'listauthors' );
- if ( !$this->curonly || !$wgExportAllowListContributors ) {
+ if ( !$this->curonly || !$config->get( 'ExportAllowListContributors' ) ) {
$list_authors = false;
}
if ( $request->getCheck( 'wpDownload' ) ) {
// Provide a sane filename suggestion
- $filename = urlencode( $wgSitename . '-' . wfTimestampNow() . '.xml' );
+ $filename = urlencode( $config->get( 'Sitename' ) . '-' . wfTimestampNow() . '.xml' );
$request->response()->header( "Content-disposition: attachment;filename={$filename}" );
}
array( 'name' => 'addcat' )
) . '<br />';
- if ( $wgExportFromNamespaces ) {
+ if ( $config->get( 'ExportFromNamespaces' ) ) {
$form .= Html::namespaceSelector(
array(
'selected' => $nsindex,
) . '<br />';
}
- if ( $wgExportAllowAll ) {
+ if ( $config->get( 'ExportAllowAll' ) ) {
$form .= Xml::checkLabel(
$this->msg( 'exportall' )->text(),
'exportall',
);
$form .= '<br />';
- if ( $wgExportAllowHistory ) {
+ if ( $config->get( 'ExportAllowHistory' ) ) {
$form .= Xml::checkLabel(
$this->msg( 'exportcuronly' )->text(),
'curonly',
$request->wasPosted() ? $request->getCheck( 'templates' ) : false
) . '<br />';
- if ( $wgExportMaxLinkDepth || $this->userCanOverrideExportDepth() ) {
+ if ( $config->get( 'ExportMaxLinkDepth' ) || $this->userCanOverrideExportDepth() ) {
$form .= Xml::inputLabel(
$this->msg( 'export-pagelinks' )->text(),
'pagelink-depth',
$request->wasPosted() ? $request->getCheck( 'wpDownload' ) : true
) . '<br />';
- if ( $wgExportAllowListContributors ) {
+ if ( $config->get( 'ExportAllowListContributors' ) ) {
$form .= Xml::checkLabel(
$this->msg( 'exportlistauthors' )->text(),
'listauthors',
* @return int
*/
private function validateLinkDepth( $depth ) {
- global $wgExportMaxLinkDepth;
-
if ( $depth < 0 ) {
return 0;
}
if ( !$this->userCanOverrideExportDepth() ) {
- if ( $depth > $wgExportMaxLinkDepth ) {
- return $wgExportMaxLinkDepth;
+ $maxLinkDepth = $this->getConfig()->get( 'ExportMaxLinkDepth' );
+ if ( $depth > $maxLinkDepth ) {
+ return $maxLinkDepth;
}
}