X-Git-Url: https://git.toastfreeware.priv.at/philipp/winterrodeln/mediawiki_extensions/wrmap.git/blobdiff_plain/142dc33879cdbb83d4c2d0de5164853d00c78d48..1b96d2f3682d951792de2f8be8d23e1a4bd1d58b:/wrmap.php diff --git a/wrmap.php b/wrmap.php index 2240e77..2e9924b 100644 --- a/wrmap.php +++ b/wrmap.php @@ -1,21 +1,50 @@ 'Winterrodeln Map', - 'version' => '1.4.0', + 'version' => '2.0.0', 'author' =>'Philipp Spitzer', 'url' => 'http://www.winterrodeln.org/trac/wiki/WrMap', - 'description' => 'This extension creates a map with GoogleMaps to show sledrun routes.' + 'description' => 'This extension creates a map using OpenLayers to show sledruns.' ); + +$wgResourceModules['ext.wrmap'] = array( + 'scripts' => array('openlayers/OpenLayers.js', 'wrmap.js'), + 'styles' => 'openlayers/theme/default/style.css', + + // When your module is loaded, these messages will be available through mw.msg() + //'messages' => array( 'myextension-hello-world', 'myextension-goodbye-world' ), + + // If your scripts need code from other modules, list their identifiers as dependencies + // and ResourceLoader will make sure they're loaded before you. + // You don't need to manually list 'mediawiki' or 'jquery', which are always loaded. + //'dependencies' => array( 'jquery.ui.datepicker' ), + + // You need to declare the base path of the file paths in 'scripts' and 'styles' + 'localBasePath' => dirname( __FILE__ ), + + // ... and the base from the browser as well. For extensions this is made easy, + // you can use the 'remoteExtPath' property to declare it relative to where the wiki + // has $wgExtensionAssetsPath configured: + 'remoteExtPath' => 'wrmap', + + 'position' => 'top' +); + + +$wgAutoloadClasses['WrMap'] = dirname(__FILE__) . '/wrmap.body.php'; + + $wgHooks['ParserFirstCallInit'][] = 'wrMapParserFirstCallInit'; -$wgHooks['ParserAfterTidy'][] = 'wrCommonMarkerAfterTidy'; -require_once dirname(__FILE__) . '/wrmap.body.php'; +function wrMapParserFirstCallInit($parser) { + $parser->setHook('wrgmap', 'WrMap::render'); + return true; +} + ?>