We did something like that for an extension that isn't on the list
yet. Put a hook in it and register the hook here:
http://www.mediawiki.org/wiki/Extension_Hooks_Registry
Note that this is not an "official" mediawiki registry. I created
the page based on thinking it's a good idea and after another denizen
of the list suggested just making the page.
=====================================
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 12, 2007, at 12:57 PM, aretai aretai wrote:
Hi,
Does anyone has an idea how to embed an extension in another one? For
example I have a simple extension:
<?php
$wgExtensionFunctions[] = "wfLCExtension";
function wfLCExtension() {
global $wgParser;
# register the extension with the WikiText parser
# the first parameter is the name of the new tag.
# In this case it defines the tag <mlc> ... </mlc>
# the second parameter is the callback function for
# processing the text between the tags
$wgParser->setHook( "mlc", "rendercontent" );
}
# The callback function for converting the input text to HTML output
function rendercontent( $input, $argv, &$parser ) {
$link = '';
$linking = '';
$localParser = new Parser();
$linking = $localParser->parse($input, $parser->mTitle,
$parser->mOptions);
$link .= $linking->getText();
return $link;
}
?>
It just returns the text put between the <mlc></mlc> tags. I use it
to mark
this section while the article is being imported to xml (which I use
further).
The problem is that I'd like make it possible for users to add
different
content between these tags (including other extensions). For example:
http://meta.wikimedia.org/wiki/Google_extension
but instead of properly rendered content I get sth like:
standard content
<google></google>
standard content
thx in advance,
Regards,
Aretai
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l(a)lists.wikimedia.org
http://lists.wikimedia.org/mailman/listinfo/mediawiki-l