Two new hooks to EditPage.php, EditPage::AfterEdit:Form and EditPage:BeforeDisplaying...
authorJack Phoenix <ashley@users.mediawiki.org>
Tue, 10 Jun 2008 16:33:41 +0000 (16:33 +0000)
committerJack Phoenix <ashley@users.mediawiki.org>
Tue, 10 Jun 2008 16:33:41 +0000 (16:33 +0000)
RELEASE-NOTES
docs/hooks.txt
includes/EditPage.php

index 21ba591..8a04839 100644 (file)
@@ -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 ===
 
index 8451d61..64d6756 100644 (file)
@@ -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
index 0c428ec..939f70a 100644 (file)
@@ -1350,6 +1350,8 @@ END
                        // mode will show an extra newline. A bit annoying.
                        $encodedtext .= "\n";
                }
+               
+               wfRunHooks( 'EditPage:BeforeDisplayingTextbox', array (&$this, &$hidden) );
 
                $wgOut->addHTML( <<<END
 $recreate
@@ -1361,6 +1363,8 @@ cols='{$cols}'{$ew} $hidden>{$encodedtext}</textarea>
 END
 );
 
+               wfRunHooks( 'EditPage::AfterEdit:Form', array (&$this) );
+
                $wgOut->wrapWikiMsg( "<div id=\"editpage-copywarn\">\n$1\n</div>", $copywarnMsg );
                $wgOut->addHTML( $this->editFormTextAfterWarn );
                $wgOut->addHTML( "