Initial check in for the SVGZoom tool.
[lhc/web/wiklou.git] / extensions / SVGZoom / SVGZoom.hooks.php
1 <?php
2 /**
3 * Hooks for Usability Initiative extensions
4 *
5 * @file
6 * @ingroup Extensions
7 */
8
9 class SVGZoomHooks {
10
11 /* Static Members */
12
13 /**
14 * BeforePageDisplay hook
15 * Adds scripts
16 */
17 public static function addResources( $out ) {
18 global $wgTitle, $wgJsMimeType, $wgScriptPath, $wgSVGZoomScriptVersion;
19
20 /*
21 * We should probably check if we are in the image namespace, and if the $wgTitle->getText() ends in .svg
22 */
23
24 $out->addScript(
25 Xml::element(
26 'script',
27 array(
28 'type' => $wgJsMimeType,
29 'src' => "{$wgScriptPath}/extensions/SVGZoom/SVGZoom.js?{$wgSVGZoomScriptVersion}",
30 ),
31 '',
32 false
33 )
34 );
35 return true;
36 }
37 }