r89422 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89421‎ | r89422 | r89423 >
Date:16:50, 3 June 2011
Author:nikerabbit
Status:deferred
Tags:
Comment:
Use readonly instead of disabled to avoid hacks with hidden fields
Modified paths:
  • /trunk/extensions/Translate/tag/SpecialPageTranslationMovePage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/tag/SpecialPageTranslationMovePage.php
@@ -217,15 +217,14 @@
218218
219219 $br = Html::element( 'br' );
220220 $subaction = array( 'name' => 'subaction' );
221 - $disabled = array( 'disabled' => 'disabled' );
 221+ $readonly = array( 'readonly' => 'readonly' );
222222 $formParams = array( 'method' => 'post', 'action' => $this->getTitle( $this->oldText )->getLocalURL() );
223223
224224 $form = array();
225225 $form[] = Xml::fieldset( wfMsg( 'pt-movepage-legend' ) );
226226 $form[] = Html::openElement( 'form', $formParams );
227227 $form[] = Html::hidden( 'wpEditToken', $this->user->editToken() );
228 - $form[] = Html::hidden( 'wpOldTitle', $this->oldText );
229 - $this->addInputLabel( $form, wfMsg( 'pt-movepage-current' ), 'wpOldTitleFake', 30, $this->oldText, $disabled );
 228+ $this->addInputLabel( $form, wfMsg( 'pt-movepage-current' ), 'wpOldTitle', 30, $this->oldText, $readonly );
230229 $this->addInputLabel( $form, wfMsg( 'pt-movepage-new' ), 'wpNewTitle', 30, $this->newText );
231230 $this->addInputLabel( $form, wfMsg( 'pt-movepage-reason' ), 'reason', 60, $this->reason );
232231 $form[] = Xml::checkLabel( wfMsg( 'pt-movepage-subpages' ), 'subpages', 'mw-subpages', $this->moveSubpages ) . $br;
@@ -293,7 +292,7 @@
294293 $wgOut->addWikiMsg( 'pt-movepage-list-count', $wgLang->formatNum( $count ) );
295294
296295 $br = Html::element( 'br' );
297 - $disabled = array( 'disabled' => 'disabled' );
 296+ $readonly = array( 'readonly' => 'readonly' );
298297 $subaction = array( 'name' => 'subaction' );
299298 $formParams = array( 'method' => 'post', 'action' => $this->getTitle( $this->oldText )->getLocalURL() );
300299
@@ -301,14 +300,11 @@
302301 $form[] = Xml::fieldset( wfMsg( 'pt-movepage-legend' ) );
303302 $form[] = Html::openElement( 'form', $formParams );
304303 $form[] = Html::hidden( 'wpEditToken', $this->user->editToken() );
305 - // Apparently HTML spec says that disabled elements are not submitted... ARGH!
306 - $form[] = Html::hidden( 'wpOldTitle', $this->oldText );
307 - $form[] = Html::hidden( 'wpNewTitle', $this->newText );
308 - $this->addInputLabel( $form, wfMsg( 'pt-movepage-current' ), 'wpOldTitleFake', 30, $this->oldText, $disabled );
309 - $this->addInputLabel( $form, wfMsg( 'pt-movepage-new' ), 'wpNewTitleFake', 30, $this->newText, $disabled );
 304+ $this->addInputLabel( $form, wfMsg( 'pt-movepage-current' ), 'wpOldTitle', 30, $this->oldText, $readonly );
 305+ $this->addInputLabel( $form, wfMsg( 'pt-movepage-new' ), 'wpNewTitle', 30, $this->newText, $readonly );
310306 $this->addInputLabel( $form, wfMsg( 'pt-movepage-reason' ), 'reason', 60, $this->reason );
311307 $form[] = Html::hidden( 'subpages', $this->moveSubpages );
312 - $form[] = Xml::checkLabel( wfMsg( 'pt-movepage-subpages' ), 'subpagesFake', 'mw-subpages', $this->moveSubpages, $disabled ) . $br;
 308+ $form[] = Xml::checkLabel( wfMsg( 'pt-movepage-subpages' ), 'subpagesFake', 'mw-subpages', $this->moveSubpages, $readonly ) . $br;
313309 $form[] = Xml::submitButton( wfMsg( 'pt-movepage-action-perform' ), $subaction );
314310 $form[] = Xml::submitButton( wfMsg( 'pt-movepage-action-other' ), $subaction );
315311 $form[] = Html::closeElement( 'form' );

Status & tagging log