MediaWiki r48756 - Code Review

Jump to: navigation, search
Repository:MediaWiki
Revision:r48755‎ | r48756 (on ViewVC)‎ | r48757 >
Date:18:48, 24 March 2009
Author:demon
Status:ok (Comments)
Tags:
Comment:
Add $wgExportFromNamespaces for enabling/disabling the "export all from namespace" option (disabled by default).
Modified paths:

Diff [purge]

Index: trunk/phase3/includes/DefaultSettings.php
@@ -2308,6 +2308,11 @@
23092309 $wgExportMaxLinkDepth = 0;
23102310
23112311 /**
 2312+ * Whether to allow the "export all pages in namespace" option
 2313+ */
 2314+$wgExportFromNamespaces = false;
 2315+
 2316+/**
23122317 * Edits matching these regular expressions in body text
23132318 * will be recognised as spam and rejected automatically.
23142319 *
Index: trunk/phase3/includes/specials/SpecialExport.php
@@ -33,6 +33,7 @@
3434 public function execute( $par ) {
3535 global $wgOut, $wgRequest, $wgSitename, $wgExportAllowListContributors;
3636 global $wgExportAllowHistory, $wgExportMaxHistory, $wgExportMaxLinkDepth;
 37+ global $wgExportFromNamespaces;
3738
3839 $this->setHeaders();
3940 $this->outputHeader();
@@ -62,7 +63,7 @@
6364 }
6465 }
6566 }
66 - else if( $wgRequest->getCheck( 'addns' ) ) {
 67+ else if( $wgRequest->getCheck( 'addns' ) && $wgExportFromNamespaces ) {
6768 $page = $wgRequest->getText( 'pages' );
6869 $nsindex = $wgRequest->getText( 'nsindex' );
6970
@@ -149,8 +150,10 @@
150151 $form .= Xml::inputLabel( wfMsg( 'export-addcattext' ) , 'catname', 'catname', 40 ) . ' ';
151152 $form .= Xml::submitButton( wfMsg( 'export-addcat' ), array( 'name' => 'addcat' ) ) . '<br />';
152153
153 - $form .= Xml::namespaceSelector( '', null, 'nsindex', wfMsg( 'export-addnstext' ) ) . '&nbsp;';
154 - $form .= Xml::submitButton( wfMsg( 'export-addns' ), array( 'name' => 'addns' ) ) . '<br />';
 154+ if ( $wgExportFromNamespaces ) {
 155+ $form .= Xml::namespaceSelector( '', null, 'nsindex', wfMsg( 'export-addnstext' ) ) . '&nbsp;';
 156+ $form .= Xml::submitButton( wfMsg( 'export-addns' ), array( 'name' => 'addns' ) ) . '<br />';
 157+ }
155158
156159 $form .= Xml::element( 'textarea', array( 'name' => 'pages', 'cols' => 40, 'rows' => 10 ), $page, false );
157160 $form .= '<br />';
Index: trunk/phase3/RELEASE-NOTES
@@ -29,6 +29,8 @@
3030 instead of falling back to GD.
3131 * Added $wgRedirectOnLogin to allow specifying a specifc page to redirect users
3232 to upon logging in (ex: "Main Page")
 33+* Add $wgExportFromNamespaces for enabling/disabling the "export all from
 34+ namespace" option (disabled by default)
3335
3436 === New features in 1.15 ===
3537

Comments

#Comment by Jidanni (talk | contribs)   02:55, 26 March 2009

OK, with this change it will become much less likely that other people will remind you that you still ought to please take a look at Bug #18031 !

Status & tagging log