Add $wgExportFromNamespaces for enabling/disabling the "export all from namespace...
authorChad Horohoe <demon@users.mediawiki.org>
Tue, 24 Mar 2009 18:48:50 +0000 (18:48 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Tue, 24 Mar 2009 18:48:50 +0000 (18:48 +0000)
RELEASE-NOTES
includes/DefaultSettings.php
includes/specials/SpecialExport.php

index 7a6f6fc..f32d7a6 100644 (file)
@@ -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 ===
 
index 5040d53..cab5edb 100644 (file)
@@ -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.
index 04fd43b..2f40c73 100644 (file)
@@ -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 ) . '&nbsp;';
                $form .= Xml::submitButton( wfMsg( 'export-addcat' ), array( 'name' => 'addcat' ) ) . '<br />';
                
-               $form .= Xml::namespaceSelector( '', null, 'nsindex', wfMsg( 'export-addnstext' ) ) . '&nbsp;';
-               $form .= Xml::submitButton( wfMsg( 'export-addns' ), array( 'name' => 'addns' ) ) . '<br />';
+               if ( $wgExportFromNamespaces ) {
+                       $form .= Xml::namespaceSelector( '', null, 'nsindex', wfMsg( 'export-addnstext' ) ) . '&nbsp;';
+                       $form .= Xml::submitButton( wfMsg( 'export-addns' ), array( 'name' => 'addns' ) ) . '<br />';
+               }
                
                $form .= Xml::element( 'textarea', array( 'name' => 'pages', 'cols' => 40, 'rows' => 10 ), $page, false );
                $form .= '<br />';