hook point for injecting fields into edit form
authorDaniel Kinzler <daniel@users.mediawiki.org>
Mon, 2 Apr 2007 21:53:06 +0000 (21:53 +0000)
committerDaniel Kinzler <daniel@users.mediawiki.org>
Mon, 2 Apr 2007 21:53:06 +0000 (21:53 +0000)
docs/hooks.txt
includes/EditPage.php

index afe2172..0d0ff78 100644 (file)
@@ -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
index e437349..a486911 100644 (file)
@@ -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( "
 <input type='hidden' value=\"" . htmlspecialchars( $this->section ) . "\" name=\"wpSection\" />