Introduce EditFormPreloadText hook, see docs/hooks.txt for more information
authorRob Church <robchurch@users.mediawiki.org>
Wed, 14 Jun 2006 13:12:08 +0000 (13:12 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Wed, 14 Jun 2006 13:12:08 +0000 (13:12 +0000)
RELEASE-NOTES
docs/hooks.txt
includes/EditPage.php

index ed439c4..13fe018 100644 (file)
@@ -494,6 +494,7 @@ Some default configuration options have changed:
 * (bug 6280) Correct GRAMMAR for Slovenian localisation (sl)
 * (bug 6162) Change date format for Dutch Low Saxon (nds-nl)
 * (bug 6296) Update to Indonesian localisation (id) #21
+* Introduce EditFormPreloadText hook, see docs/hooks.txt for more information
 
 == Compatibility ==
 
index f148312..a8c0ff1 100644 (file)
@@ -302,6 +302,10 @@ $diff: DifferenceEngine object that's calling
 $oldRev: Revision object of the "old" revision (may be null/invalid)
 $newRev: Revision object of the "new" revision
 
+'EditFormPreloadText': Allows population of the edit form when creating new pages
+&$text: Text to preload with
+&$title: Title object representing the page being created
+
 'EditFilter': Perform checks on an edit
 $editor: Edit form (see includes/EditPage.php)
 $text: Contents of the edit box
index 01efb1b..a3c98d6 100644 (file)
@@ -304,6 +304,8 @@ class EditPage {
                # checking, etc.
                if ( 'initial' == $this->formtype || $this->firsttime ) {
                        $this->initialiseForm();
+                       if( !$this->mTitle->getArticleId() ) 
+                               wfRunHooks( 'EditFormPreloadText', array( &$this->textbox1, &$this->mTitle ) );
                }
 
                $this->showEditForm();