summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>2022-01-09 04:26:31 +0000
committerGerrit Code Review <gerrit@wikimedia.org>2022-01-09 04:26:31 +0000
commit77c3feac09049784cf60aa931ea9ec01c141e0f0 (patch)
treeae5065948a0f08a8a7804e606e7a1286dca5ec34
parentffd04facb204cea9648e084be81ff5ff2bb950c0 (diff)
parent427da4fe33d3a1f6827468e2ecad9a4849b52168 (diff)
Merge "Rename FormSpecialPage::[pre|post]Text() to *Html()"
-rw-r--r--RELEASE-NOTES-1.382
-rw-r--r--includes/specialpage/FormSpecialPage.php26
2 files changed, 26 insertions, 2 deletions
diff --git a/RELEASE-NOTES-1.38 b/RELEASE-NOTES-1.38
index 663e1897e804..2d0ff2e03100 100644
--- a/RELEASE-NOTES-1.38
+++ b/RELEASE-NOTES-1.38
@@ -418,6 +418,8 @@ generic `mediawiki.pager.styles`.
getPreHtml, setPreHtml, addPreHtml, getPostHtml, setPostHtml, addPostHtml,
getHeaderHtml, setHeaderHtml, addHeaderHtml, getFooterHtml, setFooterHtml
and addFooterHtml respectively.
+* The FormSpecialPage methods preText and postText have been renamed to
+ preHtml and postHtml respectively.
* …
=== Other changes in 1.38 ===
diff --git a/includes/specialpage/FormSpecialPage.php b/includes/specialpage/FormSpecialPage.php
index e948da3ebaf5..5e6ade118a01 100644
--- a/includes/specialpage/FormSpecialPage.php
+++ b/includes/specialpage/FormSpecialPage.php
@@ -48,19 +48,39 @@ abstract class FormSpecialPage extends SpecialPage {
abstract protected function getFormFields();
/**
+ * Add pre-HTML to the form
+ * @return string HTML which will be sent to $form->addPreHtml()
+ * @since 1.38
+ */
+ protected function preHtml() {
+ return '';
+ }
+
+ /**
+ * Add post-HTML to the form
+ * @return string HTML which will be sent to $form->addPostHtml()
+ * @since 1.38
+ */
+ protected function postHtml() {
+ return '';
+ }
+
+ /**
* Add pre-text to the form
* @return string HTML which will be sent to $form->addPreText()
+ * @deprecated since 1.38, use preHtml() instead
*/
protected function preText() {
- return '';
+ return $this->preHtml();
}
/**
* Add post-text to the form
* @return string HTML which will be sent to $form->addPostText()
+ * @deprecated since 1.38, use postHtml() instead
*/
protected function postText() {
- return '';
+ return $this->postHtml();
}
/**
@@ -131,6 +151,8 @@ abstract class FormSpecialPage extends SpecialPage {
$form->addHeaderText( $headerMsg->parseAsBlock() );
}
+ // preText / postText are deprecated, but we need to keep calling them until the end of
+ // the deprecation process so a subclass overriding *Text and *Html both work
$form->addPreText( $this->preText() );
$form->addPostText( $this->postText() );
$this->alterForm( $form );