Jim,
I tried that, but unless I'm just way off base, that method greatly increases the amount of code that has to be maintained in the extension, which increases the chance of compatability issues with future MediaWiki versions.
I'd prefer to keep it as simple as possible.
Lisa Ridley
Message: 2 Date: Sat, 3 Mar 2007 10:31:46 -0500 From: Jim Hu jimhu@tamu.edu Subject: Re: [Mediawiki-l] Hook request for EditPage.php To: MediaWiki announcements and site admin list mediawiki-l@lists.wikimedia.org Message-ID: 6FDD1233-DE0B-4821-A53E-71EF339A458D@tamu.edu Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
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