X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialExport.php;h=38c52a017895f66728877c44a6be964267f1aa87;hb=02a1d4762ef16d84caf7dbc52a8ecdfb466e43f3;hp=2cf5bfe73e2b4e66e6183584c54d8e5751732457;hpb=2e9b0a1437ad80ebc99c0690d5da38c194c40c7e;p=lhc%2Fweb%2Fwiklou.git
diff --git a/includes/specials/SpecialExport.php b/includes/specials/SpecialExport.php
index 2cf5bfe73e..38c52a0178 100644
--- a/includes/specials/SpecialExport.php
+++ b/includes/specials/SpecialExport.php
@@ -37,12 +37,9 @@ class SpecialExport extends SpecialPage {
}
public function execute( $par ) {
- global $wgSitename, $wgExportAllowListContributors, $wgExportFromNamespaces;
- global $wgExportAllowHistory, $wgExportMaxHistory, $wgExportMaxLinkDepth;
- global $wgExportAllowAll;
-
$this->setHeaders();
$this->outputHeader();
+ $config = $this->getConfig();
// Set some variables
$this->curonly = true;
@@ -74,7 +71,7 @@ class SpecialExport extends SpecialPage {
}
}
}
- } elseif ( $request->getCheck( 'addns' ) && $wgExportFromNamespaces ) {
+ } elseif ( $request->getCheck( 'addns' ) && $config->get( 'ExportFromNamespaces' ) ) {
$page = $request->getText( 'pages' );
$nsindex = $request->getText( 'nsindex', '' );
@@ -87,7 +84,7 @@ class SpecialExport extends SpecialPage {
$page .= "\n" . implode( "\n", $nspages );
}
}
- } elseif ( $request->getCheck( 'exportall' ) && $wgExportAllowAll ) {
+ } elseif ( $request->getCheck( 'exportall' ) && $config->get( 'ExportAllowAll' ) ) {
$this->doExport = true;
$exportall = true;
@@ -108,19 +105,20 @@ class SpecialExport extends SpecialPage {
$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;
}
@@ -152,13 +150,13 @@ class SpecialExport extends SpecialPage {
}
}
- 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;
}
@@ -172,7 +170,7 @@ class SpecialExport extends SpecialPage {
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}" );
}
@@ -197,7 +195,7 @@ class SpecialExport extends SpecialPage {
array( 'name' => 'addcat' )
) . '
';
- if ( $wgExportFromNamespaces ) {
+ if ( $config->get( 'ExportFromNamespaces' ) ) {
$form .= Html::namespaceSelector(
array(
'selected' => $nsindex,
@@ -214,7 +212,7 @@ class SpecialExport extends SpecialPage {
) . '
';
}
- if ( $wgExportAllowAll ) {
+ if ( $config->get( 'ExportAllowAll' ) ) {
$form .= Xml::checkLabel(
$this->msg( 'exportall' )->text(),
'exportall',
@@ -231,7 +229,7 @@ class SpecialExport extends SpecialPage {
);
$form .= '
';
- if ( $wgExportAllowHistory ) {
+ if ( $config->get( 'ExportAllowHistory' ) ) {
$form .= Xml::checkLabel(
$this->msg( 'exportcuronly' )->text(),
'curonly',
@@ -249,7 +247,7 @@ class SpecialExport extends SpecialPage {
$request->wasPosted() ? $request->getCheck( 'templates' ) : false
) . '
';
- if ( $wgExportMaxLinkDepth || $this->userCanOverrideExportDepth() ) {
+ if ( $config->get( 'ExportMaxLinkDepth' ) || $this->userCanOverrideExportDepth() ) {
$form .= Xml::inputLabel(
$this->msg( 'export-pagelinks' )->text(),
'pagelink-depth',
@@ -274,7 +272,7 @@ class SpecialExport extends SpecialPage {
$request->wasPosted() ? $request->getCheck( 'wpDownload' ) : true
) . '
';
- if ( $wgExportAllowListContributors ) {
+ if ( $config->get( 'ExportAllowListContributors' ) ) {
$form .= Xml::checkLabel(
$this->msg( 'exportlistauthors' )->text(),
'listauthors',
@@ -487,15 +485,14 @@ class SpecialExport extends SpecialPage {
* @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;
}
}