Index: trunk/extensions/QPoll/clientside/qp_user.js |
— | — | @@ -48,7 +48,7 @@ |
49 | 49 | /** |
50 | 50 | * Parses coordinate of poll's input stored in id and |
51 | 51 | * stores it into self.catCoord; |
52 | | - * @param id id attribute of input / select element |
| 52 | + * @param id id attribute of input / textarea / select element |
53 | 53 | * @return true, when value of id has valid coordinate, false otherwise. |
54 | 54 | */ |
55 | 55 | setCatCoord : function( id ) { |
— | — | @@ -87,9 +87,14 @@ |
88 | 88 | applyRadio : function( catElem ) { |
89 | 89 | if ( self.radioIsClicked ) { |
90 | 90 | // deselect all inputs |
91 | | - if ( catElem.nodeName == 'SELECT' || catElem.type == 'text' ) { |
| 91 | + if ( catElem.nodeName != 'INPUT' || catElem.type == 'text' ) { |
| 92 | + // text controls |
92 | 93 | catElem.value = ''; |
| 94 | + if ( catElem.nodeName == 'TEXTAREA' ) { |
| 95 | + catElem.innerHTML = ''; |
| 96 | + } |
93 | 97 | } else { |
| 98 | + // switching controls |
94 | 99 | catElem.checked = false; |
95 | 100 | } |
96 | 101 | } else { |
— | — | @@ -160,6 +165,15 @@ |
161 | 166 | } |
162 | 167 | }, |
163 | 168 | |
| 169 | + setTextRowHandler : function( parent, tagName ) { |
| 170 | + var tags = parent.getElementsByTagName( tagName ); |
| 171 | + for ( j = 0; j < tags.length; j++ ) { |
| 172 | + if ( tags[j].id && tags[j].id.slice( 0, 2 ) == 'tx' ) { |
| 173 | + addEvent( tags[j], "click", self.clickTextRow ); |
| 174 | + } |
| 175 | + } |
| 176 | + }, |
| 177 | + |
164 | 178 | /** |
165 | 179 | * Prepare the Poll for "javascriptable" browsers |
166 | 180 | */ |
— | — | @@ -198,13 +212,8 @@ |
199 | 213 | } |
200 | 214 | } |
201 | 215 | } |
202 | | - var select = bodyContentDiv[i].getElementsByTagName( 'select' ); |
203 | | - for ( j = 0; j < select.length; j++ ) { |
204 | | - // selects currently are used only with question type="text", type="text!" |
205 | | - if ( select[j].id && select[j].id.slice( 0, 2 ) == 'tx' ) { |
206 | | - addEvent( select[j], "click", self.clickTextRow ); |
207 | | - } |
208 | | - } |
| 216 | + self.setTextRowHandler( bodyContentDiv[i], 'select' ); |
| 217 | + self.setTextRowHandler( bodyContentDiv[i], 'textarea' ); |
209 | 218 | } |
210 | 219 | } |
211 | 220 | }; |
Index: trunk/extensions/QPoll/specials/qp_results.php |
— | — | @@ -313,7 +313,12 @@ |
314 | 314 | @unlink( $xls_fname ); |
315 | 315 | exit(); |
316 | 316 | } catch ( Exception $e ) { |
317 | | - die( "Error while exporting poll statistics to Excel table\n" ); |
| 317 | + if ( $e instanceof MWException ) { |
| 318 | + $e->reportHTML(); |
| 319 | + exit(); |
| 320 | + } else { |
| 321 | + die( "Error while exporting poll statistics to Excel table\n" ); |
| 322 | + } |
318 | 323 | } |
319 | 324 | } |
320 | 325 | |
Index: trunk/extensions/QPoll/ctrl/question/qp_textquestion.php |
— | — | @@ -23,23 +23,34 @@ |
24 | 24 | |
25 | 25 | # whether the current option has xml-like attributes specified |
26 | 26 | var $hasAttributes = false; |
| 27 | + ## Category attributes; |
| 28 | + # Defined as xml-like attribute in the first element of options list. |
27 | 29 | var $attributes = array( |
28 | | - ## a value of input text field width in 'em' |
29 | | - # possible values: null, positive int |
30 | | - # defined as first element xml-like attribute of options list, for example: |
31 | | - # <<:: width="12">> or <<:: width="15"|test>> |
32 | | - # currently, it is used only for text inputs (not for select/option list) |
| 30 | + ## width of input text field |
| 31 | + # possible values: null, positive int, 'auto' |
| 32 | + # <<:: width="12">> or <<:: width="15"|test>> or <<:: width="auto"|asd|fgh>> |
| 33 | + # currently, it is used only for text input / textarea (not for select/option list) |
33 | 34 | 'width' => null, |
| 35 | + ## number of text lines in an select / textarea |
| 36 | + # possible values: null, positive int, 'auto' |
| 37 | + # when there is no options or only one option, it produces an textarea |
| 38 | + # when there is more than one option, it produces a scrollable select / options list |
| 39 | + # value 'auto' is meaningful only when there are more than one option given; |
| 40 | + # <<:: height="4">> or <<:: height="10"|prefilled text>> |
| 41 | + 'height' => null, |
34 | 42 | ## whether the text options of current category has to be sorted; |
35 | | - # possible values: null (do not sort), 'asc', 'desc' |
36 | | - # defined as first element xml-like attribute of options list, for example: |
| 43 | + # possible values: null (do not sort), 'asc', 'desc' |
37 | 44 | # <<:: sorting="desc"|a|b|c>> |
38 | 45 | 'sorting' => null, |
39 | 46 | ## whether the checkbox type option of current category has to be checked by default; |
40 | | - # possible value: null (not checked), not null (checked) |
41 | | - # defined as first element xml-like attribute of options list, for example: |
| 47 | + # possible values: null (not checked), not null (checked) |
42 | 48 | # <[checked=""]> |
43 | | - 'checked' => null |
| 49 | + 'checked' => null, |
| 50 | + ## whether the select for current category can have multiple options selected |
| 51 | + # possible values: null (no multiple selection), not null (multiple selection) |
| 52 | + # it is meaningful only for text categories with multiple options defined: |
| 53 | + # <<:: multiple=""|1|2|3>> |
| 54 | + 'multiple' => null |
44 | 55 | ); |
45 | 56 | # a pointer to last element in $this->input_options array |
46 | 57 | var $iopt_last; |
— | — | @@ -103,7 +114,7 @@ |
104 | 115 | # because it is checked in $this->addEmptyOption() |
105 | 116 | $this->hasAttributes = true; |
106 | 117 | # parse attributes string |
107 | | - $option_attributes = qp_Setup::getXmlLikeAttributes( $matches[1], array( 'width', 'sorting' ) ); |
| 118 | + $option_attributes = qp_Setup::getXmlLikeAttributes( $matches[1], array( 'width', 'height', 'sorting', 'multiple' ) ); |
108 | 119 | # apply attributes to current option |
109 | 120 | foreach ( $option_attributes as $attr_name => $attr_val ) { |
110 | 121 | $this->attributes[$attr_name] = $attr_val; |
— | — | @@ -256,14 +267,21 @@ |
257 | 268 | function loadProposalCategory( qp_TextQuestionOptions $opt, $proposalId, $catId ) { |
258 | 269 | global $wgContLang; |
259 | 270 | $name = "q{$this->mQuestionId}p{$proposalId}s{$catId}"; |
260 | | - # default value for unanswered category |
261 | | - # boolean true "checked" checkbox / radiobutton |
262 | | - # string - text input / select option value |
263 | | - $text_answer = false; |
| 271 | + $answered = false; |
| 272 | + $text_answer = ''; |
264 | 273 | # try to load from POST data |
265 | | - if ( $this->poll->mBeingCorrected && $this->mRequest->getVal( $name ) !== null ) { |
| 274 | + if ( $this->poll->mBeingCorrected && |
| 275 | + ( $ta = $this->mRequest->getArray( $name ) ) !== null ) { |
266 | 276 | if ( $opt->type === 'text' ) { |
267 | | - if ( ( $ta = trim( $this->mRequest->getText( $name ) ) ) != '' ) { |
| 277 | + if ( count( $ta ) === 1 ) { |
| 278 | + # fallback to WebRequest::getText(), because it offers useful preprocessing |
| 279 | + $ta = trim( $this->mRequest->getText( $name ) ); |
| 280 | + } else { |
| 281 | + # select multiple values are separated with new lines |
| 282 | + $ta = implode( "\n", array_map( 'trim', $ta ) ); |
| 283 | + } |
| 284 | + if ( $ta != '' ) { |
| 285 | + $answered = true; |
268 | 286 | if ( strlen( $ta ) > qp_Setup::$field_max_len['text_answer'] ) { |
269 | 287 | $text_answer = $wgContLang->truncate( $ta, qp_Setup::$field_max_len['text_answer'] , '' ); |
270 | 288 | } else { |
— | — | @@ -271,34 +289,28 @@ |
272 | 290 | } |
273 | 291 | } |
274 | 292 | } else { |
275 | | - $text_answer = true; |
| 293 | + $answered = true; |
276 | 294 | } |
277 | 295 | } |
278 | 296 | # try to load from pollStore |
279 | 297 | # pollStore optionally overrides POST data |
280 | | - $prev_text_answer = $this->answerExists( $opt->type, $proposalId, $catId ); |
281 | | - if ( is_string( $prev_text_answer ) ) { |
282 | | - $text_answer = $prev_text_answer; |
283 | | - } else { |
284 | | - if ( $prev_text_answer === true ) { |
285 | | - $text_answer = true; |
| 298 | + if ( ( $prev_text_answer = $this->answerExists( $opt->type, $proposalId, $catId ) ) !== false ) { |
| 299 | + $answered = true; |
| 300 | + if ( is_string( $prev_text_answer ) ) { |
| 301 | + $text_answer = $prev_text_answer; |
286 | 302 | } |
287 | 303 | } |
288 | | - if ( $text_answer !== false ) { |
| 304 | + if ( $answered !== false ) { |
289 | 305 | # add category to the list of user answers for current proposal (row) |
290 | 306 | $this->mProposalCategoryId[ $proposalId ][] = $catId; |
291 | | - if ( is_string( $text_answer ) ) { |
292 | | - $this->mProposalCategoryText[ $proposalId ][] = $text_answer; |
293 | | - } else { |
294 | | - $this->mProposalCategoryText[ $proposalId ][] = ''; |
295 | | - if ( $opt->type !== 'text' ) { |
296 | | - $opt->attributes['checked'] = true; |
297 | | - } |
| 307 | + $this->mProposalCategoryText[ $proposalId ][] = $text_answer; |
| 308 | + if ( $opt->type !== 'text' ) { |
| 309 | + $opt->attributes['checked'] = true; |
298 | 310 | } |
299 | 311 | } |
300 | 312 | # finally, add new category input options for the view |
301 | 313 | $opt->closeCategory(); |
302 | | - $this->propview->addCatDef( $opt, $name, $text_answer, $this->poll->mBeingCorrected && $text_answer === false ); |
| 314 | + $this->propview->addCatDef( $opt, $name, $text_answer, $this->poll->mBeingCorrected && !$answered ); |
303 | 315 | } |
304 | 316 | |
305 | 317 | /** |
Index: trunk/extensions/QPoll/qp_user.php |
— | — | @@ -469,8 +469,9 @@ |
470 | 470 | $attr_vals = array(); |
471 | 471 | $match = array(); |
472 | 472 | foreach ( $attr_list as $attr_name ) { |
473 | | - preg_match( '/' . $attr_name . '\s?=\s?"(.*?)"/u', $attr_str, $match ); |
474 | | - $attr_vals[$attr_name] = ( count( $match ) > 1 ) ? $match[1] : null; |
| 473 | + preg_match( '/' . $attr_name . '\s?=\s?(?:"(.*?)"|(\d+))/u', $attr_str, $match ); |
| 474 | + # array_pop() "prefers" to match (\d+), when available |
| 475 | + $attr_vals[$attr_name] = ( count( $match ) > 1 ) ? array_pop( $match ) : null; |
475 | 476 | } |
476 | 477 | return $attr_vals; |
477 | 478 | } |
Index: trunk/extensions/QPoll/view/proposal/qp_textquestionproposalview.php |
— | — | @@ -45,6 +45,8 @@ |
46 | 46 | * @param $name string name of input/select element (used in the view) |
47 | 47 | * @param $text_answer string user's POSTed category answer |
48 | 48 | * (empty string '' means no answer) |
| 49 | + * @param $unanswered boolean indicates whether the category of submitted poll |
| 50 | + * was non-blank (true) or not (false) |
49 | 51 | * @return stdClass object with viewtokens entry |
50 | 52 | */ |
51 | 53 | function addCatDef( qp_TextQuestionOptions $opt, $name, $text_answer, $unanswered ) { |
— | — | @@ -57,10 +59,7 @@ |
58 | 60 | # property 'value' contains value previousely chosen |
59 | 61 | # by user (if any) |
60 | 62 | # property 'attributes' contain extra atttibutes of current category definition |
61 | | - # property 'unanswered' boolean |
62 | | - # true - the question was POSTed but category is unanswered |
63 | | - # false - the question was not POSTed or category is answered |
64 | | - $this->viewtokens[] = (object) array( |
| 63 | + $viewtoken = (object) array( |
65 | 64 | 'type' => $opt->type, |
66 | 65 | 'options' => $opt->input_options, |
67 | 66 | 'name' => $name, |
— | — | @@ -68,6 +67,21 @@ |
69 | 68 | 'unanswered' => $unanswered, |
70 | 69 | 'attributes' => $opt->attributes |
71 | 70 | ); |
| 71 | + # fix values of measurable attributes (allow only non-negative integer values) |
| 72 | + # zero value means attribute is unused |
| 73 | + foreach ( array( 'width', 'height' ) as $measurable ) { |
| 74 | + $val = &$viewtoken->attributes[$measurable]; |
| 75 | + if ( $val === null ) { |
| 76 | + $val = 0; |
| 77 | + } elseif ( is_numeric( $val ) ) { |
| 78 | + if ( ( $val = intval( $val ) ) < 1 ) { |
| 79 | + $val = 0; |
| 80 | + } |
| 81 | + } else { |
| 82 | + $val = 'auto'; |
| 83 | + } |
| 84 | + } |
| 85 | + $this->viewtokens[] = $viewtoken; |
72 | 86 | $this->lastTokenType = 'category'; |
73 | 87 | } |
74 | 88 | |
Index: trunk/extensions/QPoll/view/question/qp_textquestionview.php |
— | — | @@ -51,6 +51,7 @@ |
52 | 52 | # depending on $this->tabularDisplay value |
53 | 53 | var $row; |
54 | 54 | # tagarray with error elements will be merged into adjascent cells |
| 55 | + # (otherwise tabular layout will be broken by proposal errors) |
55 | 56 | var $error; |
56 | 57 | # tagarray with current cell builded for row |
57 | 58 | # cell contains one or multiple tags, describing proposal part or category |
— | — | @@ -63,6 +64,9 @@ |
64 | 65 | $this->reset( '' ); |
65 | 66 | } |
66 | 67 | |
| 68 | + /** |
| 69 | + * Prepare current instance for new proposal row |
| 70 | + */ |
67 | 71 | function reset( $id_prefix ) { |
68 | 72 | $this->id_prefix = $id_prefix; |
69 | 73 | $this->row = array(); |
— | — | @@ -72,6 +76,9 @@ |
73 | 77 | $this->ckey = 0; |
74 | 78 | } |
75 | 79 | |
| 80 | + /** |
| 81 | + * Add proposal error tagarray |
| 82 | + */ |
76 | 83 | function addError( $elem ) { |
77 | 84 | $this->cell[] = array( |
78 | 85 | '__tag' => 'span', |
— | — | @@ -80,57 +87,98 @@ |
81 | 88 | ); |
82 | 89 | } |
83 | 90 | |
| 91 | + /** |
| 92 | + * Add category as input type text / checkbox / radio / textarea tagarray |
| 93 | + */ |
84 | 94 | function addInput( $elem, $className ) { |
| 95 | + $tagName = ( $elem->type === 'text' && $elem->attributes['height'] !== 0 ) ? 'textarea' : 'input'; |
| 96 | + $lines_count = 1; |
| 97 | + # get category value |
85 | 98 | $value = $elem->value; |
86 | 99 | # check, whether the definition of category has "pre-filled" value |
87 | 100 | # single, non-unanswered, non-empty option is a pre-filled value |
88 | 101 | if ( !$elem->unanswered && $elem->value === '' && $elem->options[0] !== '' ) { |
89 | 102 | # input text pre-fill |
90 | 103 | $value = $elem->options[0]; |
| 104 | + if ( $tagName === 'textarea' ) { |
| 105 | + # oversimplicated regexp, but it's enough for our needs |
| 106 | + $value = preg_replace( '/<br[\sA-Z\d="]*\/{0,1}>/i', "\n", $value, -1, $lines_count ); |
| 107 | + $lines_count++; |
| 108 | + } |
91 | 109 | $className .= ' cat_prefilled'; |
92 | 110 | } |
93 | | - $input = array( |
94 | | - '__tag' => 'input', |
| 111 | + $tag = array( |
| 112 | + '__tag' => $tagName, |
95 | 113 | # unique (poll_type,order_id,question,proposal,category) "coordinate" for javascript |
96 | 114 | 'id' => "{$this->id_prefix}c{$this->ckey}", |
97 | 115 | 'class' => $className, |
98 | | - 'type' => $elem->type, |
99 | 116 | 'name' => $elem->name, |
100 | | - 'value' => qp_Setup::specialchars( $value ) |
101 | 117 | ); |
| 118 | + if ( $tagName === 'input' ) { |
| 119 | + $tag['type'] = $elem->type; |
| 120 | + $tag['value'] = qp_Setup::specialchars( $value ); |
| 121 | + } else { /* 'textarea' */ |
| 122 | + $tag[] = qp_Setup::specialchars( $value ); |
| 123 | + if ( is_int( $elem->attributes['height'] ) ) { |
| 124 | + $tag['rows'] = $elem->attributes['height']; |
| 125 | + } else { /* 'auto' */ |
| 126 | + # todo: allow multiline prefilled text and calculate number of new lines |
| 127 | + $tag['rows'] = $lines_count; |
| 128 | + } |
| 129 | + } |
102 | 130 | $this->ckey++; |
103 | | - if ( $elem->type !== 'text' && $elem->attributes['checked'] === true ) { |
104 | | - $input['checked'] = 'checked'; |
| 131 | + if ( $elem->type === 'text' ) { |
| 132 | + # input type text and textarea |
| 133 | + if ( $this->owner->textInputStyle != '' ) { |
| 134 | + # apply poll's textwidth attribute |
| 135 | + $tag['style'] = $this->owner->textInputStyle; |
| 136 | + } |
| 137 | + if ( $elem->attributes['width'] !== 0 ) { |
| 138 | + # apply current category width attribute |
| 139 | + if ( is_int( $elem->attributes['width'] ) ) { |
| 140 | + $tag['style'] = 'width:' . $elem->attributes['width'] . 'em;'; |
| 141 | + } else { /* 'auto' */ |
| 142 | + $tag['style'] = 'width:99%;'; |
| 143 | + } |
| 144 | + } |
| 145 | + } else { |
| 146 | + # checkbox or radiobutton |
| 147 | + if ( $elem->attributes['checked'] === true ) { |
| 148 | + $tag['checked'] = 'checked'; |
| 149 | + } |
105 | 150 | } |
106 | | - if ( $elem->type === 'text' && $this->owner->textInputStyle != '' ) { |
107 | | - # apply poll's textwidth attribute |
108 | | - $input['style'] = $this->owner->textInputStyle; |
109 | | - } |
110 | | - if ( $elem->attributes['width'] !== null ) { |
111 | | - # apply current category width attribute |
112 | | - $input['style'] = 'width:' . intval( $elem->attributes['width'] ) . 'em;'; |
113 | | - } |
114 | | - $this->cell[] = $input; |
| 151 | + $this->cell[] = $tag; |
115 | 152 | } |
116 | 153 | |
| 154 | + /** |
| 155 | + * Add category as select / option list tagarray |
| 156 | + */ |
117 | 157 | function addSelect( $elem, $className ) { |
118 | 158 | if ( $elem->options[0] !== '' ) { |
119 | | - # default element in select/option set always must be empty option |
| 159 | + # default element in select/option set always must be an empty option |
120 | 160 | array_unshift( $elem->options, '' ); |
121 | 161 | } |
122 | 162 | $html_options = array(); |
| 163 | + # prepare the list of selected values |
| 164 | + if ( $elem->attributes['multiple'] !== null ) { |
| 165 | + # new lines are separator for selected multiple options |
| 166 | + $selected_values = explode( "\n", $elem->value ); |
| 167 | + } else { |
| 168 | + $selected_values = array( $elem->value ); |
| 169 | + } |
| 170 | + # generate options list |
123 | 171 | foreach ( $elem->options as $option ) { |
124 | 172 | $html_option = array( |
125 | 173 | '__tag' => 'option', |
126 | 174 | 'value' => qp_Setup::entities( $option ), |
127 | 175 | qp_Setup::specialchars( $option ) |
128 | 176 | ); |
129 | | - if ( $option === $elem->value ) { |
| 177 | + if ( in_array( $option, $selected_values ) ) { |
130 | 178 | $html_option['selected'] = 'selected'; |
131 | 179 | } |
132 | 180 | $html_options[] = $html_option; |
133 | 181 | } |
134 | | - $this->cell[] = array( |
| 182 | + $select = array( |
135 | 183 | '__tag' => 'select', |
136 | 184 | # unique (poll_type,order_id,question,proposal,category) "coordinate" for javascript |
137 | 185 | 'id' => "{$this->id_prefix}c{$this->ckey}", |
— | — | @@ -138,9 +186,29 @@ |
139 | 187 | 'name' => $elem->name, |
140 | 188 | $html_options |
141 | 189 | ); |
| 190 | + # multiple options 'name' attribute should have array hint [] |
| 191 | + if ( $elem->attributes['multiple'] !== null ) { |
| 192 | + $select['multiple'] = 'multiple'; |
| 193 | + $select['name'] .= '[]'; |
| 194 | + } |
| 195 | + # determine visual height of select options list |
| 196 | + if ( ( $size = $elem->attributes['height'] ) !== 0 ) { |
| 197 | + if ( is_int( $size ) ) { |
| 198 | + if ( count( $elem->options ) < $size ) { |
| 199 | + $size = count( $elem->options ); |
| 200 | + } |
| 201 | + } else { /* 'auto' */ |
| 202 | + $size = count( $elem->options ); |
| 203 | + } |
| 204 | + $select['size'] = $size; |
| 205 | + } |
| 206 | + $this->cell[] = $select; |
142 | 207 | $this->ckey++; |
143 | 208 | } |
144 | 209 | |
| 210 | + /** |
| 211 | + * Add tagarray representation of proposal part |
| 212 | + */ |
145 | 213 | function addProposalPart( $elem ) { |
146 | 214 | $this->cell[] = array( |
147 | 215 | '__tag' => 'span', |
— | — | @@ -149,6 +217,11 @@ |
150 | 218 | ); |
151 | 219 | } |
152 | 220 | |
| 221 | + /** |
| 222 | + * Build "final" cell which contain tagarray representation of |
| 223 | + * proposal parts, proposal errors and one adjascent category |
| 224 | + * and then add it to the row |
| 225 | + */ |
153 | 226 | function addCell() { |
154 | 227 | if ( count( $this->error ) > 0 ) { |
155 | 228 | # merge previous errors to current cell |
— | — | @@ -179,6 +252,11 @@ |
180 | 253 | # whether the resulting display table should be transposed |
181 | 254 | # meaningful only when $this->tabularDisplay is true |
182 | 255 | var $transposed = false; |
| 256 | + # how many characters will hold horizontal line of textarea; |
| 257 | + # currently is unused, because textarea 'cols' attribute renders |
| 258 | + # poorly in table cells in modern versions of Firefox, so |
| 259 | + # we are using CSS $this->textInputStyle instead |
| 260 | + # var $textwidth = 0; |
183 | 261 | |
184 | 262 | # default style of text input |
185 | 263 | var $textInputStyle = ''; |
— | — | @@ -206,9 +284,11 @@ |
207 | 285 | $this->transposed = strpos( $layout, 'transpose' ) !== false; |
208 | 286 | } |
209 | 287 | if ( $textwidth !== null ) { |
210 | | - $textwidth = intval( $textwidth ); |
211 | | - if ( $textwidth > 0 ) { |
| 288 | + if ( is_numeric( $textwidth ) && |
| 289 | + $textwidth = intval( $textwidth ) > 0 ) { |
212 | 290 | $this->textInputStyle = 'width:' . $textwidth . 'em;'; |
| 291 | + } elseif ( $textwidth === 'auto' ) { |
| 292 | + $this->textInputStyle = 'width:auto;'; |
213 | 293 | } |
214 | 294 | } |
215 | 295 | } |
— | — | @@ -290,9 +370,9 @@ |
291 | 371 | # create view for proposal/category error message |
292 | 372 | $vr->addError( $elem ); |
293 | 373 | } |
294 | | - # create view for the input options part |
| 374 | + # create view for the input / textarea options part |
295 | 375 | if ( count( $elem->options ) === 1 ) { |
296 | | - # one option produces html text / radio / checkbox input |
| 376 | + # one option produces html text / radio / checkbox input or an textarea |
297 | 377 | $vr->addInput( $elem, $className ); |
298 | 378 | $vr->addCell(); |
299 | 379 | continue; |