Index: trunk/phase3/includes/HTMLForm.php |
— | — | @@ -1374,8 +1374,6 @@ |
1375 | 1375 | return $p; |
1376 | 1376 | } |
1377 | 1377 | |
1378 | | - print_r( $value ); |
1379 | | - |
1380 | 1378 | $validOptions = HTMLFormField::flattenOptions( $this->mParams['options'] ); |
1381 | 1379 | |
1382 | 1380 | if ( in_array( $value, $validOptions ) ) |
— | — | @@ -1401,54 +1399,10 @@ |
1402 | 1400 | $select->setAttribute( 'disabled', 'disabled' ); |
1403 | 1401 | } |
1404 | 1402 | |
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 | | - |
1414 | 1403 | $select->addOptions( $this->mParams['options'] ); |
1415 | 1404 | |
1416 | 1405 | return $select->getHTML(); |
1417 | 1406 | } |
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 | | - } |
1453 | 1407 | } |
1454 | 1408 | |
1455 | 1409 | /** |
— | — | @@ -1924,7 +1878,7 @@ |
1925 | 1879 | |
1926 | 1880 | $this->mParent->addHiddenField( |
1927 | 1881 | $this->mName, |
1928 | | - $value, |
| 1882 | + $this->mDefault, |
1929 | 1883 | $params |
1930 | 1884 | ); |
1931 | 1885 | |