Index: trunk/extensions/SemanticForms/includes/SF_FormUtils.inc |
— | — | @@ -395,6 +395,7 @@ |
396 | 396 | } |
397 | 397 | |
398 | 398 | static function hiddenFieldHTML($input_name, $cur_value) { |
| 399 | + $cur_value = str_replace('"', '"', $cur_value); |
399 | 400 | $text =<<<END |
400 | 401 | <input type="hidden" name="$input_name" value="$cur_value" /> |
401 | 402 | |
— | — | @@ -497,6 +498,15 @@ |
498 | 499 | return $text; |
499 | 500 | } |
500 | 501 | |
| 502 | + /** |
| 503 | + * Helper function to display a simple button |
| 504 | + */ |
| 505 | + static function buttonHTML($values) { |
| 506 | + // for backwards-compatibility with pre-1.13 MW |
| 507 | + $button_html = function_exists("Xml::element") ? Xml::element('input', $values, '') : wfElement('input', $values, ''); |
| 508 | + return " $button_html\n"; |
| 509 | + } |
| 510 | + |
501 | 511 | static function saveButtonHTML($is_disabled, $label = null) { |
502 | 512 | global $sfgTabIndex; |
503 | 513 | |
— | — | @@ -514,8 +524,7 @@ |
515 | 525 | 'title' => wfMsg('tooltip-save'), |
516 | 526 | $disabled_text => '', |
517 | 527 | ); |
518 | | - $text = " " . wfElement('input', $temp, '') . "\n"; |
519 | | - return $text; |
| 528 | + return self::buttonHTML($temp); |
520 | 529 | } |
521 | 530 | |
522 | 531 | static function showPreviewButtonHTML($is_disabled, $label = null) { |
— | — | @@ -535,8 +544,7 @@ |
536 | 545 | 'title' => wfMsg('tooltip-preview'), |
537 | 546 | $disabled_text => '', |
538 | 547 | ); |
539 | | - $text = " " . wfElement('input', $temp, '') . "\n"; |
540 | | - return $text; |
| 548 | + return self::buttonHTML($temp); |
541 | 549 | } |
542 | 550 | |
543 | 551 | static function showChangesButtonHTML($is_disabled, $label = null) { |
— | — | @@ -556,8 +564,7 @@ |
557 | 565 | 'title' => wfMsg('tooltip-diff'), |
558 | 566 | $disabled_text => '', |
559 | 567 | ); |
560 | | - $text = " " . wfElement('input', $temp, '') . "\n"; |
561 | | - return $text; |
| 568 | + return self::buttonHTML($temp); |
562 | 569 | } |
563 | 570 | |
564 | 571 | static function cancelLinkHTML($is_disabled, $label = null) { |
— | — | @@ -658,8 +665,7 @@ |
659 | 666 | 'value' => $label, |
660 | 667 | 'title' => $label, |
661 | 668 | ); |
662 | | - $text = " " . wfElement('input', $temp, '') . "\n"; |
663 | | - return $text; |
| 669 | + return self::buttonHTML($temp); |
664 | 670 | } |
665 | 671 | |
666 | 672 | static function getMonthNames() { |