Index: trunk/phase3/includes/HTMLForm.php |
— | — | @@ -21,6 +21,7 @@ |
22 | 22 | 'int' => 'HTMLIntField', |
23 | 23 | 'float' => 'HTMLFloatField', |
24 | 24 | 'info' => 'HTMLInfoField', |
| 25 | + 'password' => 'HTMLPasswordField', |
25 | 26 | 'selectorother' => 'HTMLSelectOrOtherField', |
26 | 27 | # HTMLTextField will output the correct type="" attribute automagically. |
27 | 28 | # There are about four zillion other HTML 5 input types, like url, but |
— | — | @@ -515,6 +516,9 @@ |
516 | 517 | } |
517 | 518 | |
518 | 519 | class HTMLTextField extends HTMLFormField { |
| 520 | + # Override in derived classes to use other Xml::... functions |
| 521 | + protected $mFunction = 'input'; |
| 522 | + |
519 | 523 | function getSize() { |
520 | 524 | return isset( $this->mParams['size'] ) ? $this->mParams['size'] : 45; |
521 | 525 | } |
— | — | @@ -562,7 +566,8 @@ |
563 | 567 | } |
564 | 568 | } |
565 | 569 | |
566 | | - return Xml::input( |
| 570 | + $func = $this->mFunction; |
| 571 | + return Xml::$func( |
567 | 572 | $this->mName, |
568 | 573 | $this->getSize(), |
569 | 574 | $value, |
— | — | @@ -571,6 +576,10 @@ |
572 | 577 | } |
573 | 578 | } |
574 | 579 | |
| 580 | +class HTMLPasswordField extends HTMLTextField { |
| 581 | + protected $mFunction = 'password'; |
| 582 | +} |
| 583 | + |
575 | 584 | class HTMLFloatField extends HTMLTextField { |
576 | 585 | function getSize() { |
577 | 586 | return isset( $this->mParams['size'] ) ? $this->mParams['size'] : 20; |