00001 <?php
00002
00026 if ( !defined( 'MEDIAWIKI' ) ) {
00027 die( 'Not an entry point.' );
00028 }
00029
00030 if ( version_compare( $wgVersion, '1.18c', '<' ) ) {
00031 die( '<b>Error:</b> This version of Semantic Maps requires MediaWiki 1.18 or above; use Semantic Maps 1.0.x for MediaWiki 1.17 and Semantic Maps 0.7.x for older versions.' );
00032 }
00033
00034
00035 if ( ! defined( 'Maps_VERSION' ) ) {
00036 die( '<b>Error:</b> You need to have <a href="http://www.mediawiki.org/wiki/Extension:Maps">Maps</a> installed in order to use <a href="http://www.mediawiki.org/wiki/Extension:Semantic Maps">Semantic Maps</a>.<br />' );
00037 }
00038
00039
00040 if ( ! defined( 'SMW_VERSION' ) ) {
00041 die( '<b>Error:</b> You need to have <a href="http://semantic-mediawiki.org/wiki/Semantic_MediaWiki">Semantic MediaWiki</a> installed in order to use <a href="http://www.mediawiki.org/wiki/Extension:Semantic Maps">Semantic Maps</a>.<br />' );
00042 }
00043
00044 if ( version_compare( SMW_VERSION, '1.6.2 alpha', '<' ) ) {
00045 die( '<b>Error:</b> This version of Semantic Maps requires Semantic MediaWiki 1.7 or above; use Semantic Maps 1.0 to 1.0.3 for SMW 1.6 to 1.6.1.' );
00046 }
00047
00048 define( 'SM_VERSION', '1.1 alpha' );
00049
00050 $wgExtensionCredits['semantic'][] = array(
00051 'path' => __FILE__,
00052 'name' => 'Semantic Maps',
00053 'version' => SM_VERSION,
00054 'author' => array(
00055 '[http://www.mediawiki.org/wiki/User:Jeroen_De_Dauw Jeroen De Dauw]'
00056 ),
00057 'url' => 'https://www.mediawiki.org/wiki/Extension:Semantic_Maps',
00058 'descriptionmsg' => 'semanticmaps-desc'
00059 );
00060
00061 $smgScriptPath = ( $wgExtensionAssetsPath === false ? $wgScriptPath . '/extensions' : $wgExtensionAssetsPath ) . '/SemanticMaps';
00062 $smgDir = dirname( __FILE__ ) . '/';
00063
00064 $smgStyleVersion = $wgStyleVersion . '-' . SM_VERSION;
00065
00066
00067 require_once 'SM_Settings.php';
00068
00069 # (named) Array of String. This array contains the available features for Maps.
00070 # Commenting out the inclusion of any feature will make Maps completely ignore it, and so improve performance.
00071
00072 # Query printers
00073 include_once $smgDir . 'includes/queryprinters/SM_QueryPrinters.php';
00074 # Form imputs
00075 include_once $smgDir . 'includes/forminputs/SM_FormInputs.php';
00076
00077 # Include the mapping services that should be loaded into Semantic Maps.
00078 # Commenting or removing a mapping service will cause Semantic Maps to completely ignore it, and so improve performance.
00079
00080 # Google Maps API v3
00081 include_once $smgDir . 'includes/services/GoogleMaps3/SM_GoogleMaps3.php';
00082
00083 # OpenLayers API
00084 include_once $smgDir . 'includes/services/OpenLayers/SM_OpenLayers.php';
00085
00086 # Yahoo! Maps API
00087 include_once $smgDir . 'includes/services/YahooMaps/SM_YahooMaps.php';
00088
00089 $wgExtensionMessagesFiles['SemanticMaps'] = $smgDir . 'SemanticMaps.i18n.php';
00090
00091 $incDir = dirname( __FILE__ ) . '/includes/';
00092
00093 $wgAutoloadClasses['SMGeoCoordsHooks'] = $incDir . 'SM_GeoCoordsHooks.php';
00094
00095
00096 $wgAutoloadClasses['SMGeoCoordsValue'] = $incDir . 'SM_GeoCoordsValue.php';
00097
00098
00099 $wgAutoloadClasses['SMGeoCoordsValueDescription'] = $incDir . 'SM_GeoCoordsValueDescription.php';
00100 $wgAutoloadClasses['SMAreaValueDescription'] = $incDir . 'SM_AreaValueDescription.php';
00101
00102 $wgAutoloadClasses['SemanticMapsHooks'] = dirname( __FILE__ ) . '/SemanticMaps.hooks.php';
00103
00104
00105 $wgHooks['smwInitDatatypes'][] = 'SMGeoCoordsHooks::initGeoCoordsType';
00106
00107
00108 $wgHooks['SMWResultFormat'][] = 'SMGeoCoordsHooks::addGeoCoordsDefaultFormat';
00109
00110
00111 $wgHooks['AdminLinks'][] = 'SemanticMapsHooks::addToAdminLinks';