Sounds like you'll probably need two things then: a SpecialPage to
process the SQL, and another hook to inject your custom JavaScript.
Either of the aforementioned hooks should work. I haven't used them
in particular, but I've had good experiences with
OutputPageBeforeHTML.
$wgHooks['BeforePageDisplay'][] = 'yourJSInjectingFunction'; // or
OutputPageBeforeHTML
function yourJSInjectingFunction( &$out ) {
global $wgJsMimeType;
$out->addScript( "<script type=\"$wgJsMimeType\"
src=\"path/to/your/script\"></script>" );
// - OR -
$out->addScript( "<script type=\"$wgJsMimeType\">/* your custom
JS
directly in here */</script>" );
return true;
}
-- Jim
On Thu, Feb 28, 2008 at 8:50 AM, Lane, Ryan
<Ryan.Lane(a)ocean.navo.navy.mil> wrote:
Hmmm... I
guess I figured to make a special page I needed a hook.
but im trying to make my ajax image search/ insert (for quick
adds to
edits) into a proper extension.
I have a php function for the sql search, but I need to call
it using
sajax_do_call (java script calls the php function and tells
the putput
where to go.
-Adam
You may be able to use one of these two hooks to inject your javascript
into the headers:
"BeforePageDisplay" (see
http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/Memorize/Mem
orize.php for an example)
"OutputPageParserOutput" (see
http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/SmoothGaller
y/SmoothGallery.php for an example).
V/r,
Ryan Lane
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l