From bb4370b2abe78f9463a6f6b21c1615108d623d5a Mon Sep 17 00:00:00 2001 From: Daniel Kinzler Date: Mon, 2 Apr 2007 21:53:06 +0000 Subject: [PATCH] hook point for injecting fields into edit form --- docs/hooks.txt | 5 +++++ includes/EditPage.php | 2 ++ 2 files changed, 7 insertions(+) diff --git a/docs/hooks.txt b/docs/hooks.txt index afe2172915..0d0ff78aca 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -338,6 +338,11 @@ saved, that is before insertNewArticle() is called &$text: Text to preload with &$title: Title object representing the page being created +'EditPage::showEditForm:fields': allows injection of form field into edit form +&$editor: the EditPage instance for reference +&$out: an OutputPage instance to write to +return value is ignored (should always return true) + '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 e437349ee4..a486911ab1 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -1167,6 +1167,8 @@ END call_user_func_array( $formCallback, array( &$wgOut ) ); } + wfRunHooks( 'EditPage::showEditForm:fields', array( &$this, &$wgOut ) ); + // Put these up at the top to ensure they aren't lost on early form submission $wgOut->addHTML( " section ) . "\" name=\"wpSection\" /> -- 2.20.1