From 41bf115e866d3e1e8d01f706d639452831c3cfcd Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Tue, 24 Mar 2009 18:48:50 +0000 Subject: [PATCH] Add $wgExportFromNamespaces for enabling/disabling the "export all from namespace" option (disabled by default). --- RELEASE-NOTES | 2 ++ includes/DefaultSettings.php | 5 +++++ includes/specials/SpecialExport.php | 9 ++++++--- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 7a6f6fcdac..f32d7a693c 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -29,6 +29,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN instead of falling back to GD. * Added $wgRedirectOnLogin to allow specifying a specifc page to redirect users to upon logging in (ex: "Main Page") +* Add $wgExportFromNamespaces for enabling/disabling the "export all from + namespace" option (disabled by default) === New features in 1.15 === diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 5040d53164..cab5edbadc 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -2307,6 +2307,11 @@ $wgExportAllowListContributors = false ; */ $wgExportMaxLinkDepth = 0; +/** + * Whether to allow the "export all pages in namespace" option + */ +$wgExportFromNamespaces = false; + /** * Edits matching these regular expressions in body text * will be recognised as spam and rejected automatically. diff --git a/includes/specials/SpecialExport.php b/includes/specials/SpecialExport.php index 04fd43b366..2f40c73203 100644 --- a/includes/specials/SpecialExport.php +++ b/includes/specials/SpecialExport.php @@ -33,6 +33,7 @@ class SpecialExport extends SpecialPage { public function execute( $par ) { global $wgOut, $wgRequest, $wgSitename, $wgExportAllowListContributors; global $wgExportAllowHistory, $wgExportMaxHistory, $wgExportMaxLinkDepth; + global $wgExportFromNamespaces; $this->setHeaders(); $this->outputHeader(); @@ -62,7 +63,7 @@ class SpecialExport extends SpecialPage { } } } - else if( $wgRequest->getCheck( 'addns' ) ) { + else if( $wgRequest->getCheck( 'addns' ) && $wgExportFromNamespaces ) { $page = $wgRequest->getText( 'pages' ); $nsindex = $wgRequest->getText( 'nsindex' ); @@ -149,8 +150,10 @@ class SpecialExport extends SpecialPage { $form .= Xml::inputLabel( wfMsg( 'export-addcattext' ) , 'catname', 'catname', 40 ) . ' '; $form .= Xml::submitButton( wfMsg( 'export-addcat' ), array( 'name' => 'addcat' ) ) . '
'; - $form .= Xml::namespaceSelector( '', null, 'nsindex', wfMsg( 'export-addnstext' ) ) . ' '; - $form .= Xml::submitButton( wfMsg( 'export-addns' ), array( 'name' => 'addns' ) ) . '
'; + if ( $wgExportFromNamespaces ) { + $form .= Xml::namespaceSelector( '', null, 'nsindex', wfMsg( 'export-addnstext' ) ) . ' '; + $form .= Xml::submitButton( wfMsg( 'export-addns' ), array( 'name' => 'addns' ) ) . '
'; + } $form .= Xml::element( 'textarea', array( 'name' => 'pages', 'cols' => 40, 'rows' => 10 ), $page, false ); $form .= '
'; -- 2.20.1