r83312 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83311‎ | r83312 | r83313 >
Date:19:22, 5 March 2011
Author:jeroendedauw
Status:ok (Comments)
Tags:
Comment:
keep checkbox state when adding cat/ns pages
Modified paths:
  • /trunk/phase3/includes/specials/SpecialExport.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialExport.php
@@ -186,19 +186,34 @@
187187 $form .= '<br />';
188188
189189 if( $wgExportAllowHistory ) {
190 - $form .= Xml::checkLabel( wfMsg( 'exportcuronly' ), 'curonly', 'curonly', true ) . '<br />';
 190+ $form .= Xml::checkLabel(
 191+ wfMsg( 'exportcuronly' ),
 192+ 'curonly',
 193+ 'curonly',
 194+ $wgRequest->wasPosted() ? $wgRequest->getCheck( 'curonly' ) : true
 195+ ) . '<br />';
191196 } else {
192197 $wgOut->addHTML( wfMsgExt( 'exportnohistory', 'parse' ) );
193198 }
194199
195 - $form .= Xml::checkLabel( wfMsg( 'export-templates' ), 'templates', 'wpExportTemplates', false ) . '<br />';
 200+ $form .= Xml::checkLabel(
 201+ wfMsg( 'export-templates' ),
 202+ 'templates',
 203+ 'wpExportTemplates',
 204+ $wgRequest->wasPosted() ? $wgRequest->getCheck( 'templates' ) : false
 205+ ) . '<br />';
196206
197207 if( $wgExportMaxLinkDepth || $this->userCanOverrideExportDepth() ) {
198208 $form .= Xml::inputLabel( wfMsg( 'export-pagelinks' ), 'pagelink-depth', 'pagelink-depth', 20, 0 ) . '<br />';
199209 }
200210 // Enable this when we can do something useful exporting/importing image information. :)
201211 //$form .= Xml::checkLabel( wfMsg( 'export-images' ), 'images', 'wpExportImages', false ) . '<br />';
202 - $form .= Xml::checkLabel( wfMsg( 'export-download' ), 'wpDownload', 'wpDownload', true ) . '<br />';
 212+ $form .= Xml::checkLabel(
 213+ wfMsg( 'export-download' ),
 214+ 'wpDownload',
 215+ 'wpDownload',
 216+ $wgRequest->wasPosted() ? $wgRequest->getCheck( 'wpDownload' ) : true
 217+ ) . '<br />';
203218
204219 $form .= Xml::submitButton( wfMsg( 'export-submit' ), $wgUser->getSkin()->tooltipAndAccessKeyAttribs( 'export' ) );
205220 $form .= Xml::closeElement( 'form' );
@@ -474,4 +489,4 @@
475490 return $pageSet;
476491 }
477492
478 -}
\ No newline at end of file
 493+}

Sign-offs

UserFlagDate
Hasharinspected09:27, 6 March 2011

Comments

#Comment by Hashar (talk | contribs)   09:27, 6 March 2011

Looks like a good candidate for a migration to HTMLForm

#Comment by 😂 (talk | contribs)   13:32, 29 March 2011

Rather than only making these work on POST, why not just cast them to bool regardless? Other than that nitpick, this is ok.

Status & tagging log