Index: trunk/extensions/SemanticForms/includes/forminputs/SF_TextInput.php |
— | — | @@ -6,10 +6,6 @@ |
7 | 7 | * @ingroup SF |
8 | 8 | */ |
9 | 9 | |
10 | | -if ( !defined( 'SF_VERSION' ) ) { |
11 | | - die( 'This file is part of the SemanticForms extension, it is not a valid entry point.' ); |
12 | | -} |
13 | | - |
14 | 10 | /** |
15 | 11 | * The SFTextInput class. |
16 | 12 | * |
— | — | @@ -126,6 +122,9 @@ |
127 | 123 | if ( array_key_exists( 'maxlength', $other_args ) ) { |
128 | 124 | $inputAttrs['maxlength'] = $other_args['maxlength']; |
129 | 125 | } |
| 126 | + if ( array_key_exists( 'placeholder', $other_args ) ) { |
| 127 | + $inputAttrs['placeholder'] = $other_args['placeholder']; |
| 128 | + } |
130 | 129 | $text = Xml::element( 'input', $inputAttrs ); |
131 | 130 | |
132 | 131 | if ( array_key_exists( 'is_uploadable', $other_args ) && $other_args['is_uploadable'] == true ) { |
— | — | @@ -169,6 +168,11 @@ |
170 | 169 | 'description' => wfMsg( 'sf_forminputs_maxlength' ) |
171 | 170 | ); |
172 | 171 | $params[] = array( |
| 172 | + 'name' => 'placeholder', |
| 173 | + 'type' => 'string', |
| 174 | + 'description' => wfMsg( 'sf_forminputs_placeholder' ) |
| 175 | + ); |
| 176 | + $params[] = array( |
173 | 177 | 'name' => 'uploadable', |
174 | 178 | 'type' => 'boolean', |
175 | 179 | 'description' => wfMsg( 'sf_forminputs_uploadable' ) |
Index: trunk/extensions/SemanticForms/includes/forminputs/SF_TextAreaWithAutocompleteInput.php |
— | — | @@ -6,10 +6,6 @@ |
7 | 7 | * @ingroup SF |
8 | 8 | */ |
9 | 9 | |
10 | | -if ( !defined( 'SF_VERSION' ) ) { |
11 | | - die( 'This file is part of the SemanticForms extension, it is not a valid entry point.' ); |
12 | | -} |
13 | | - |
14 | 10 | /** |
15 | 11 | * The SFTextAreaWithAutocompleteInput class. |
16 | 12 | * |
— | — | @@ -94,6 +90,10 @@ |
95 | 91 | $textarea_attrs['onKeyDown'] = $maxLengthJSCheck; |
96 | 92 | $textarea_attrs['onKeyUp'] = $maxLengthJSCheck; |
97 | 93 | } |
| 94 | + if ( array_key_exists( 'placeholder', $other_args ) ) { |
| 95 | + $textarea_attrs = $other_args['placeholder']; |
| 96 | + } |
| 97 | + |
98 | 98 | // Bug in Xml::element()? It doesn't close the textarea tag |
99 | 99 | // properly if the text inside is null - set it to '' instead. |
100 | 100 | if ( is_null( $cur_value ) ) { |
Index: trunk/extensions/SemanticForms/includes/forminputs/SF_TextWithAutocompleteInput.php |
— | — | @@ -6,10 +6,6 @@ |
7 | 7 | * @ingroup SF |
8 | 8 | */ |
9 | 9 | |
10 | | -if ( !defined( 'SF_VERSION' ) ) { |
11 | | - die( 'This file is part of the SemanticForms extension, it is not a valid entry point.' ); |
12 | | -} |
13 | | - |
14 | 10 | /** |
15 | 11 | * The SFTextWithAutocompleteInput class. |
16 | 12 | * |
— | — | @@ -177,6 +173,9 @@ |
178 | 174 | if ( array_key_exists( 'maxlength', $other_args ) ) { |
179 | 175 | $inputAttrs['maxlength'] = $other_args['maxlength']; |
180 | 176 | } |
| 177 | + if ( array_key_exists( 'placeholder', $other_args ) ) { |
| 178 | + $inputAttrs['placeholder'] = $other_args['placeholder']; |
| 179 | + } |
181 | 180 | $text = "\n\t" . Xml::element( 'input', $inputAttrs ) . "\n"; |
182 | 181 | |
183 | 182 | if ( array_key_exists( 'is_uploadable', $other_args ) && $other_args['is_uploadable'] == true ) { |
Index: trunk/extensions/SemanticForms/includes/forminputs/SF_TextAreaInput.php |
— | — | @@ -6,10 +6,6 @@ |
7 | 7 | * @ingroup SF |
8 | 8 | */ |
9 | 9 | |
10 | | -if ( !defined( 'SF_VERSION' ) ) { |
11 | | - die( 'This file is part of the SemanticForms extension, it is not a valid entry point.' ); |
12 | | -} |
13 | | - |
14 | 10 | /** |
15 | 11 | * The SFTextAreaInput class. |
16 | 12 | * |
— | — | @@ -82,6 +78,10 @@ |
83 | 79 | $textarea_attrs['onKeyDown'] = $maxLengthJSCheck; |
84 | 80 | $textarea_attrs['onKeyUp'] = $maxLengthJSCheck; |
85 | 81 | } |
| 82 | + if ( array_key_exists( 'placeholder', $other_args ) ) { |
| 83 | + $textarea_attrs['placeholder'] = $other_args['placeholder']; |
| 84 | + } |
| 85 | + |
86 | 86 | // Bug in Xml::element()? It doesn't close the textarea tag |
87 | 87 | // properly if the text inside is null - set it to '' instead. |
88 | 88 | if ( is_null( $cur_value ) ) { |
— | — | @@ -119,6 +119,11 @@ |
120 | 120 | 'description' => wfMsg( 'sf_forminputs_maxlength' ) |
121 | 121 | ); |
122 | 122 | $params[] = array( |
| 123 | + 'name' => 'placeholder', |
| 124 | + 'type' => 'string', |
| 125 | + 'description' => wfMsg( 'sf_forminputs_placeholder' ) |
| 126 | + ); |
| 127 | + $params[] = array( |
123 | 128 | 'name' => 'autogrow', |
124 | 129 | 'type' => 'boolean', |
125 | 130 | 'description' => wfMsg( 'sf_forminputs_autogrow' ) |