Index: trunk/extensions/SemanticForms/includes/SF_FormUtils.inc |
— | — | @@ -517,7 +517,8 @@ |
518 | 518 | * Helper function to display a simple button |
519 | 519 | */ |
520 | 520 | static function buttonHTML($values) { |
521 | | - $button_html = Xml::element('input', $values, ''); |
| 521 | + // for backwards-compatibility with pre-1.13 MW |
| 522 | + $button_html = function_exists("Xml::element") ? Xml::element('input', $values, '') : wfElement('input', $values, ''); |
522 | 523 | return " $button_html\n"; |
523 | 524 | } |
524 | 525 | |
— | — | @@ -589,18 +590,11 @@ |
590 | 591 | $label = wfMsgExt('cancel', array('parseinline')); |
591 | 592 | if ($wgTitle == null) |
592 | 593 | $cancel = ''; |
593 | | - // if this is the special 'AddData' or 'EditData' page, get |
594 | | - // the form name, and link to 'AddPage' with that form name |
595 | | - elseif (($wgTitle->getText() == 'AddData' || $wgTitle->getText() == 'EditData') |
| 594 | + // if we're on the special 'FormEdit' page, just send the user |
| 595 | + // back to the previous page they were on |
| 596 | + elseif ($wgTitle->getText() == 'FormEdit' |
596 | 597 | && $wgTitle->getNamespace() == NS_SPECIAL) { |
597 | | - global $wgRequest; |
598 | | - $title_components = split('/', $wgRequest->getVal('title')); |
599 | | - if (count($title_components) >= 2) { |
600 | | - $add_page_title = Title::makeTitleSafe(NS_SPECIAL, 'AddPage'); |
601 | | - $cancel = $sk->makeKnownLink($add_page_title->getPrefixedText() . '/' . $title_components[1], $label); |
602 | | - } else { |
603 | | - $cancel = ''; |
604 | | - } |
| 598 | + $cancel = '<a href="javascript:history.go(-1);">' . $label . '</a>'; |
605 | 599 | } else |
606 | 600 | $cancel = $sk->makeKnownLink( $wgTitle->getPrefixedText(), $label); |
607 | 601 | $text = " <span class='editHelp'>$cancel</span>\n"; |