From a052460863b9d0fb3dd4d50854c1c555ac5943e7 Mon Sep 17 00:00:00 2001 From: Jack Phoenix Date: Tue, 10 Jun 2008 16:33:41 +0000 Subject: [PATCH] Two new hooks to EditPage.php, EditPage::AfterEdit:Form and EditPage:BeforeDisplayingTextbox --- RELEASE-NOTES | 2 ++ docs/hooks.txt | 7 +++++++ includes/EditPage.php | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 21ba5914df..8a04839f26 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -151,6 +151,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * Add a new hook LinkerMakeExternalLink to allow extensions to modify the output of external links. * (bug 14132) Allow user to disable bot edits from being output to UDP. +* Two new hooks in EditPage.php: EditPage::AfterEdit:Form and + EditPage:BeforeDisplayingTextbox === Bug fixes in 1.13 === diff --git a/docs/hooks.txt b/docs/hooks.txt index 8451d61f80..64d6756f4b 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -533,10 +533,17 @@ $error: error message to return &$text: Text to preload with &$title: Title object representing the page being created +'EditPage::AfterEdit:Form': After the edit textbox has been displayed +&$this: EditPage instance (object) + 'EditPage::attemptSave': called before an article is saved, that is before insertNewArticle() is called &$editpage_Obj: the current EditPage object +'EditPage:BeforeDisplayingTextbox': Before the edit textbox is displayed +&$this: EditPage instance (object) +&$hidden: extra parameters of the textarea element, by default it is style="display: none;" + 'EditPage::showEditForm:fields': allows injection of form field into edit form &$editor: the EditPage instance for reference &$out: an OutputPage instance to write to diff --git a/includes/EditPage.php b/includes/EditPage.php index 0c428ec73f..939f70a5e0 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -1350,6 +1350,8 @@ END // mode will show an extra newline. A bit annoying. $encodedtext .= "\n"; } + + wfRunHooks( 'EditPage:BeforeDisplayingTextbox', array (&$this, &$hidden) ); $wgOut->addHTML( <<{$encodedtext} END ); + wfRunHooks( 'EditPage::AfterEdit:Form', array (&$this) ); + $wgOut->wrapWikiMsg( "
\n$1\n
", $copywarnMsg ); $wgOut->addHTML( $this->editFormTextAfterWarn ); $wgOut->addHTML( " -- 2.20.1