r20952 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r20951‎ | r20952 | r20953 >
Date:21:53, 2 April 2007
Author:daniel
Status:old
Tags:
Comment:
hook point for injecting fields into edit form
Modified paths:
  • /trunk/phase3/docs/hooks.txt (modified) (history)
  • /trunk/phase3/includes/EditPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/docs/hooks.txt
@@ -338,6 +338,11 @@
339339 &$text: Text to preload with
340340 &$title: Title object representing the page being created
341341
 342+'EditPage::showEditForm:fields': allows injection of form field into edit form
 343+&$editor: the EditPage instance for reference
 344+&$out: an OutputPage instance to write to
 345+return value is ignored (should always return true)
 346+
342347 'EditFilter': Perform checks on an edit
343348 $editor: Edit form (see includes/EditPage.php)
344349 $text: Contents of the edit box
Index: trunk/phase3/includes/EditPage.php
@@ -1167,6 +1167,8 @@
11681168 call_user_func_array( $formCallback, array( &$wgOut ) );
11691169 }
11701170
 1171+ wfRunHooks( 'EditPage::showEditForm:fields', array( &$this, &$wgOut ) );
 1172+
11711173 // Put these up at the top to ensure they aren't lost on early form submission
11721174 $wgOut->addHTML( "
11731175 <input type='hidden' value=\"" . htmlspecialchars( $this->section ) . "\" name=\"wpSection\" />