Index: trunk/phase3/includes/HTMLForm.php |
— | — | @@ -305,7 +305,8 @@ |
306 | 306 | * @param $attribs Array |
307 | 307 | */ |
308 | 308 | public function addHiddenField( $name, $value, $attribs=array() ){ |
309 | | - $this->mHiddenFields[ $name ] = array( $value, $attribs ); |
| 309 | + $attribs += array( 'name' => $name ); |
| 310 | + $this->mHiddenFields[] = array( $value, $attribs ); |
310 | 311 | } |
311 | 312 | |
312 | 313 | public function addButton( $name, $value, $id=null, $attribs=null ){ |
— | — | @@ -377,9 +378,9 @@ |
378 | 379 | $html .= Html::hidden( 'wpEditToken', $wgUser->editToken(), array( 'id' => 'wpEditToken' ) ) . "\n"; |
379 | 380 | $html .= Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) . "\n"; |
380 | 381 | |
381 | | - foreach( $this->mHiddenFields as $name => $value ){ |
382 | | - list( $value, $attribs ) = $value; |
383 | | - $html .= Html::hidden( $name, $value, $attribs ) . "\n"; |
| 382 | + foreach( $this->mHiddenFields as $data ){ |
| 383 | + list( $value, $attribs ) = $data; |
| 384 | + $html .= Html::hidden( $attribs['name'], $value, $attribs ) . "\n"; |
384 | 385 | } |
385 | 386 | |
386 | 387 | return $html; |
— | — | @@ -1397,6 +1398,13 @@ |
1398 | 1399 | |
1399 | 1400 | class HTMLHiddenField extends HTMLFormField { |
1400 | 1401 | |
| 1402 | + public function __construct( $params ){ |
| 1403 | + parent::__construct( $params ); |
| 1404 | + # forcing the 'wp' prefix on hidden field names |
| 1405 | + # is undesirable |
| 1406 | + $this->mName = substr( $this->mName, 2 ); |
| 1407 | + } |
| 1408 | + |
1401 | 1409 | public function getTableRow( $value ){ |
1402 | 1410 | $params = array(); |
1403 | 1411 | if( $this->mID ){ |