MediaWiki r20952 - Code Review

Jump to: navigation, search
Repository:MediaWiki
Revision:r20951‎ | r20952 (on ViewVC)‎ | r20953 >
Date:21:53, 2 April 2007
Author:daniel
Status:old
Tags:
Comment:
hook point for injecting fields into edit form
Modified paths:

Diff [purge]

Index: trunk/phase3/docs/hooks.txt
===================================================================
--- trunk/phase3/docs/hooks.txt	(revision 20951)
+++ trunk/phase3/docs/hooks.txt	(revision 20952)
@@ -338,6 +338,11 @@
 &$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: trunk/phase3/includes/EditPage.php
===================================================================
--- trunk/phase3/includes/EditPage.php	(revision 20951)
+++ trunk/phase3/includes/EditPage.php	(revision 20952)
@@ -1167,6 +1167,8 @@
 			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\" />
Personal tools
Namespaces
Variants
Views
Actions
Site
Support
Download
Development
Communication
Toolbox