r100513 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100512‎ | r100513 | r100514 >
Date:20:10, 22 October 2011
Author:johnduhart
Status:ok
Tags:
Comment:
Removing extra stuff that was committed in r100512
Modified paths:
  • /trunk/phase3/includes/HTMLForm.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/HTMLForm.php
@@ -1374,8 +1374,6 @@
13751375 return $p;
13761376 }
13771377
1378 - print_r( $value );
1379 -
13801378 $validOptions = HTMLFormField::flattenOptions( $this->mParams['options'] );
13811379
13821380 if ( in_array( $value, $validOptions ) )
@@ -1401,54 +1399,10 @@
14021400 $select->setAttribute( 'disabled', 'disabled' );
14031401 }
14041402
1405 - if ( !empty( $this->mParams['multiple'] ) ) {
1406 - $select->setAttribute( 'name', $this->mName . '[]' );
1407 - $select->setAttribute( 'multiple', 'multiple' );
1408 -
1409 - if ( !empty( $this->mParams['size'] ) ) {
1410 - $select->setAttribute( 'size', $this->mParams['size'] );
1411 - }
1412 - }
1413 -
14141403 $select->addOptions( $this->mParams['options'] );
14151404
14161405 return $select->getHTML();
14171406 }
1418 -
1419 - /**
1420 - * @param $request WebRequest
1421 - * @return String
1422 - */
1423 - function loadDataFromRequest( $request ) {
1424 - if ( $this->mParent->getMethod() == 'post' ) {
1425 - if( $request->wasPosted() ){
1426 - # Checkboxes are just not added to the request arrays if they're not checked,
1427 - # so it's perfectly possible for there not to be an entry at all
1428 - return $request->getArray( $this->mName, array() );
1429 - } else {
1430 - # That's ok, the user has not yet submitted the form, so show the defaults
1431 - return $this->getDefault();
1432 - }
1433 - } else {
1434 - # This is the impossible case: if we look at $_GET and see no data for our
1435 - # field, is it because the user has not yet submitted the form, or that they
1436 - # have submitted it with all the options unchecked? We will have to assume the
1437 - # latter, which basically means that you can't specify 'positive' defaults
1438 - # for GET forms.
1439 - # @todo FIXME...
1440 - return $request->getArray( $this->mName, array() );
1441 - }
1442 - }
1443 -
1444 - public static function keysAreValues( $array ) {
1445 - $resultArray = array();
1446 -
1447 - foreach ( $array as $name => $value ) {
1448 - $resultArray[$value] = $value;
1449 - }
1450 -
1451 - return $resultArray;
1452 - }
14531407 }
14541408
14551409 /**
@@ -1924,7 +1878,7 @@
19251879
19261880 $this->mParent->addHiddenField(
19271881 $this->mName,
1928 - $value,
 1882+ $this->mDefault,
19291883 $params
19301884 );
19311885

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r100512Adding functions to HTMLForm for setting the submitText and WrapperLegend to ...johnduhart20:03, 22 October 2011

Status & tagging log