Index: trunk/phase3/includes/HTMLForm.php |
— | — | @@ -874,7 +874,6 @@ |
875 | 875 | } |
876 | 876 | |
877 | 877 | function getInputHTML( $value ) { |
878 | | - global $wgHtml5; |
879 | 878 | $attribs = array( |
880 | 879 | 'id' => $this->mID, |
881 | 880 | 'name' => $this->mName, |
— | — | @@ -890,20 +889,18 @@ |
891 | 890 | $attribs['disabled'] = 'disabled'; |
892 | 891 | } |
893 | 892 | |
894 | | - if ( $wgHtml5 ) { |
895 | | - # TODO: Enforce pattern, step, required, readonly on the server |
896 | | - # side as well |
897 | | - foreach ( array( 'min', 'max', 'pattern', 'title', 'step', |
898 | | - 'placeholder' ) as $param ) { |
899 | | - if ( isset( $this->mParams[$param] ) ) { |
900 | | - $attribs[$param] = $this->mParams[$param]; |
901 | | - } |
| 893 | + # TODO: Enforce pattern, step, required, readonly on the server side as |
| 894 | + # well |
| 895 | + foreach ( array( 'min', 'max', 'pattern', 'title', 'step', |
| 896 | + 'placeholder' ) as $param ) { |
| 897 | + if ( isset( $this->mParams[$param] ) ) { |
| 898 | + $attribs[$param] = $this->mParams[$param]; |
902 | 899 | } |
903 | | - foreach ( array( 'required', 'autofocus', 'multiple', 'readonly' ) |
904 | | - as $param ) { |
905 | | - if ( isset( $this->mParams[$param] ) ) { |
906 | | - $attribs[$param] = ''; |
907 | | - } |
| 900 | + } |
| 901 | + foreach ( array( 'required', 'autofocus', 'multiple', 'readonly' ) as |
| 902 | + $param ) { |
| 903 | + if ( isset( $this->mParams[$param] ) ) { |
| 904 | + $attribs[$param] = ''; |
908 | 905 | } |
909 | 906 | } |
910 | 907 | |
— | — | @@ -911,23 +908,17 @@ |
912 | 909 | # here, rather than creating a new class for each one which |
913 | 910 | # is essentially just a clone of this one. |
914 | 911 | if ( isset( $this->mParams['type'] ) ) { |
915 | | - # Options that apply only to HTML5 |
916 | | - if( $wgHtml5 ){ |
917 | | - switch ( $this->mParams['type'] ) { |
918 | | - case 'email': |
919 | | - $attribs['type'] = 'email'; |
920 | | - break; |
921 | | - case 'int': |
922 | | - $attribs['type'] = 'number'; |
923 | | - break; |
924 | | - case 'float': |
925 | | - $attribs['type'] = 'number'; |
926 | | - $attribs['step'] = 'any'; |
927 | | - break; |
928 | | - } |
929 | | - } |
930 | | - # Options that apply to HTML4 as well |
931 | | - switch( $this->mParams['type'] ) { |
| 912 | + switch ( $this->mParams['type'] ) { |
| 913 | + case 'email': |
| 914 | + $attribs['type'] = 'email'; |
| 915 | + break; |
| 916 | + case 'int': |
| 917 | + $attribs['type'] = 'number'; |
| 918 | + break; |
| 919 | + case 'float': |
| 920 | + $attribs['type'] = 'number'; |
| 921 | + $attribs['step'] = 'any'; |
| 922 | + break; |
932 | 923 | # Pass through |
933 | 924 | case 'password': |
934 | 925 | case 'file': |
— | — | @@ -953,7 +944,6 @@ |
954 | 945 | } |
955 | 946 | |
956 | 947 | function getInputHTML( $value ) { |
957 | | - global $wgHtml5; |
958 | 948 | $attribs = array( |
959 | 949 | 'id' => $this->mID, |
960 | 950 | 'name' => $this->mName, |
— | — | @@ -969,14 +959,11 @@ |
970 | 960 | $attribs['readonly'] = 'readonly'; |
971 | 961 | } |
972 | 962 | |
973 | | - if ( $wgHtml5 ) { |
974 | | - foreach ( array( 'required', 'autofocus' ) as $param ) { |
975 | | - if ( isset( $this->mParams[$param] ) ) { |
976 | | - $attribs[$param] = ''; |
977 | | - } |
| 963 | + foreach ( array( 'required', 'autofocus' ) as $param ) { |
| 964 | + if ( isset( $this->mParams[$param] ) ) { |
| 965 | + $attribs[$param] = ''; |
978 | 966 | } |
979 | 967 | } |
980 | | - |
981 | 968 | |
982 | 969 | return Html::element( 'textarea', $attribs, $value ); |
983 | 970 | } |