Index: trunk/extensions/SemanticForms/specials/SF_CreateForm.php |
— | — | @@ -307,6 +307,11 @@ |
308 | 308 | 'value' => $cur_value, |
309 | 309 | 'size' => 32 |
310 | 310 | ) ); |
| 311 | + } elseif ( $type == 'text' ) { |
| 312 | + return Xml::element( 'textarea', array( |
| 313 | + 'name' => $paramName . '_' . $fieldFormText, |
| 314 | + 'rows' => 4 |
| 315 | + ), $cur_value ); |
311 | 316 | } elseif ( $type == 'enumeration' ) { |
312 | 317 | $text = '<select name="p[' . htmlspecialchars( $paramName ) . ']">'; |
313 | 318 | $text .= "\n <option value=''></option>\n"; |
— | — | @@ -349,6 +354,7 @@ |
350 | 355 | */ |
351 | 356 | public static function showInputTypeOptions( $inputType, $fieldFormText, $paramValues ) { |
352 | 357 | global $sfgFormPrinter; |
| 358 | + global $wgParser; |
353 | 359 | |
354 | 360 | $text = ''; |
355 | 361 | |
— | — | @@ -365,9 +371,15 @@ |
366 | 372 | foreach ( $params as $i => $param ) { |
367 | 373 | $paramName = $param['name']; |
368 | 374 | $type = $param['type']; |
369 | | - $desc = $param['description']; |
| 375 | + $desc = $wgParser->parse( $param['description'], new Title(), new ParserOptions() )->getText(); |
370 | 376 | |
371 | | - $cur_value = ( array_key_exists( $paramName, $paramValues ) ) ? $paramValues[$paramName] : ''; |
| 377 | + if ( array_key_exists( $paramName, $paramValues ) ) { |
| 378 | + $cur_value = $paramValues[$paramName]; |
| 379 | + } else if ( array_key_exists( 'default', $param ) ) { |
| 380 | + $cur_value = $param['default']; |
| 381 | + } else { |
| 382 | + $cur_value = ''; |
| 383 | + } |
372 | 384 | |
373 | 385 | // 3 values per row, with alternating colors for rows |
374 | 386 | if ( $i % 3 == 0 ) { |
— | — | @@ -378,7 +390,7 @@ |
379 | 391 | $text .= "<div style=\"width: 30%; padding: 5px; float: left;\">$paramName:\n"; |
380 | 392 | |
381 | 393 | $text .= self::inputTypeParamInput( $type, $paramName, $cur_value, $param, array(), $fieldFormText ); |
382 | | - $text .= "\n<br />" . Xml::element( 'em', null, $desc ) . "\n</div>\n"; |
| 394 | + $text .= "\n<br />" . Xml::tags( 'em', null, $desc ) . "\n</div>\n"; |
383 | 395 | |
384 | 396 | if ( $i % 3 == 2 || $i == count( $params ) - 1 ) { |
385 | 397 | $text .= "<div style=\"clear: both\";></div></div>\n"; |