[Mediawiki-l] Feature request for extensions...

Muzaffer Ozakca mozakca at indiana.edu
Thu Dec 16 18:00:54 UTC 2004


Oh wait, I guess I should have done some tests before sending... Sorry.

Muzaffer

> -----Original Message-----
> From: mediawiki-l-bounces at Wikimedia.org [mailto:mediawiki-l-
> bounces at Wikimedia.org] On Behalf Of Muzaffer Ozakca
> Sent: Thursday, December 16, 2004 12:56 PM
> To: 'MediaWiki announcements and site admin list'
> Subject: [Mediawiki-l] Feature request for extensions...
> 
> Hi,
> 
> I'm going to write a couple functions for a bunch of new tags. All tags
> will
> call the same function:
> 
> $wgParser->setHook( "tag1", "func" );
> $wgParser->setHook( "tag2", "func" );
> $wgParser->setHook( "tag3", "func" );
> ...
> 
> What do you say about passing the tag to the callback function?
> 
> So, instead of,
> function func ( $input )
> 
> it could be,
> function func ( $input, $tag )
> 
> so, a switch within the function can tell which tag caused the call. I
> looked at the source code, Parser.php, it looks like a simple
> modification:
> 
> In the Parser.php, line 365 (ver 1.3.9) this:
> $ext_content[$tag][$marker] = $callback( $content );
> 
> Can be changed to this:
> $ext_content[$tag][$marker] = $callback( $content, $tag );
> 
> I already did this change on my code, I was wondering this could be
> officially added to MediaWiki.
> 
> Just a suggestion to see if this would make life for some easier :)
> 
> Muzaffer
> 
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l at Wikimedia.org
> http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
> 





More information about the MediaWiki-l mailing list