On Sat, Nov 26, 2005 at 12:42:23PM -0500, Amruta Lonkar wrote:
Could anyone please tell me which function gets called
on the 'Save Page'
submit action. I am making chnages to a existing page in the locally
installed wiki. I want to add some data to tables that i have added to the
wiki database. Once a user its submit i want to be able to identify my
tagged text from the text and then insert it. So for this i want ot figure
out whihc function will get called when a user hits 'Save Page' button on
edit page.
See:
http://meta.wikimedia.org/wiki/Write_your_own_MediaWiki_extension
http://meta.wikimedia.org/wiki/MediaWiki_Hooks_and_their_Parameters
http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/docs/hooks.txt?rev=1…
http://wikipedia.sourceforge.net/doc/
"Hooks are registered by adding them to the global $wgHooks array for a given
event."
I don't think the Mediawiki API docs can show all the "wgHooks" (yet),
but by using: grep -r wfRunHooks wiki/includes/* | less
you can see all the existing hooks in the code.
Examples:
# This method will be called before an article is saved
$wgHooks['ArticleSaveComplete'][] = 'myFunction';
# This method will be called before an article is displayed or previewed.
$wgHooks['ParserAfterStrip'][] = 'myOtherFunction';
Jama Poulsen
http://wikicompany.org
http://debianlinux.net