I needed similar thing and created subclasses of EditPage so showEditForm method call the original one with $formCallback parameter which referred my function. Additionally, I used CSS to hide the edit box and JavaScript hook to fill the edit box before the saving. But, this is problematic solution. The most problematic part is the call to EditPage::showEditForm because the original parameter can be not null (I save it and call it at the end of my function but isn't good idea) . I think that hook which will be called at the point of the current call to $formCallback inside EditPage:: showEditForm will simplify the subclassing of EditPage class. Assaf Katz
Quoting Jim Hu jimhu@tamu.edu:
Can you just Hook at AlternateEdit and put your functionality in a class that subclasses EditPage? ===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
On Mar 3, 2007, at 8:39 AM, Lisa Ridley wrote:
I'd like to request a hook addition for EditPage.php.
I'm working on some extensions to modify the user interface for the edit page in MediaWiki (specifically, to present the user with data form fields in addition to the standard Mediawiki free-form edit box. The information captured in the data fields will be saved in the article created in a template format and displayed using a template specific for the data). EditPage.php has a hook at the very beginning of the source code; however, I'd like to leverage the existing code as much as possible without having to use an "include" statement or recreate the code in my extension. I'm currently modifying EditPage.php to place a hook at the end of the EditPage::edit() function, right above this line:
$this->showEditForm();
That is similar in function to the one at the beginning of the function:
if ( ! wfRunHooks( 'AlternateEdit', array( &$this ) ) ) return;
but calling it 'AlternateEditForm' instead. It functions in a similar manner. This allows me to leverage the existing code in EditPage:edit().
Ideally, I'd like to place this even further down, but I haven't found a better place for it yet.
If this could be formally added to the MediaWiki source code without requiring users to modify it, that would be wonderful!
Thanks for your consideration .
Lisa Ridley
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program.