From 11ea8511f293b33416c07b090433289c2fdadfcb Mon Sep 17 00:00:00 2001 From: Rob Church Date: Wed, 14 Jun 2006 13:12:08 +0000 Subject: [PATCH] Introduce EditFormPreloadText hook, see docs/hooks.txt for more information --- RELEASE-NOTES | 1 + docs/hooks.txt | 4 ++++ includes/EditPage.php | 2 ++ 3 files changed, 7 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index ed439c4335..13fe018983 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 == diff --git a/docs/hooks.txt b/docs/hooks.txt index f1483127d3..a8c0ff1821 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -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 diff --git a/includes/EditPage.php b/includes/EditPage.php index 01efb1b8c4..a3c98d676f 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -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(); -- 2.20.1