Index: trunk/extensions/Maps/Maps.php |
— | — | @@ -35,123 +35,122 @@ |
36 | 36 | if ( ! defined( 'Validator_VERSION' ) ) { |
37 | 37 | die( '<b>Error:</b> You need to have <a href="http://www.mediawiki.org/wiki/Extension:Validator">Validator</a> installed in order to use <a href="http://www.mediawiki.org/wiki/Extension:Maps">Maps</a>.<br />' ); |
38 | 38 | } |
39 | | -else { |
40 | | - define( 'Maps_VERSION', '0.7.6 alpha' ); |
41 | 39 | |
42 | | - // The different coordinate notations. |
43 | | - define( 'Maps_COORDS_FLOAT', 'float' ); |
44 | | - define( 'Maps_COORDS_DMS', 'dms' ); |
45 | | - define( 'Maps_COORDS_DM', 'dm' ); |
46 | | - define( 'Maps_COORDS_DD', 'dd' ); |
47 | | - |
48 | | - $useExtensionPath = version_compare( $wgVersion, '1.16', '>=' ) && isset( $wgExtensionAssetsPath ) && $wgExtensionAssetsPath; |
49 | | - $egMapsScriptPath = ( $useExtensionPath ? $wgExtensionAssetsPath : $wgScriptPath . '/extensions' ) . '/Maps'; |
50 | | - $egMapsDir = dirname( __FILE__ ) . '/'; |
51 | | - unset( $useExtensionPath ); |
| 40 | +define( 'Maps_VERSION', '0.7.6 alpha' ); |
52 | 41 | |
53 | | - $egMapsStyleVersion = $wgStyleVersion . '-' . Maps_VERSION; |
| 42 | +// The different coordinate notations. |
| 43 | +define( 'Maps_COORDS_FLOAT', 'float' ); |
| 44 | +define( 'Maps_COORDS_DMS', 'dms' ); |
| 45 | +define( 'Maps_COORDS_DM', 'dm' ); |
| 46 | +define( 'Maps_COORDS_DD', 'dd' ); |
54 | 47 | |
55 | | - $wgAutoloadClasses['MapsHooks'] = dirname( __FILE__ ) . '/Maps.hooks.php'; |
56 | | - |
57 | | - // Autoload the "includes/" classes and interfaces. |
58 | | - $incDir = dirname( __FILE__ ) . '/includes/'; |
59 | | - $wgAutoloadClasses['MapsMapper'] = $incDir . 'Maps_Mapper.php'; |
60 | | - $wgAutoloadClasses['MapsCoordinateParser'] = $incDir . 'Maps_CoordinateParser.php'; |
61 | | - $wgAutoloadClasses['MapsDistanceParser'] = $incDir . 'Maps_DistanceParser.php'; |
62 | | - $wgAutoloadClasses['MapsGeoFunctions'] = $incDir . 'Maps_GeoFunctions.php'; |
63 | | - $wgAutoloadClasses['MapsGeocoders'] = $incDir . 'Maps_Geocoders.php'; |
64 | | - $wgAutoloadClasses['MapsGeocoder'] = $incDir . 'Maps_Geocoder.php'; |
65 | | - $wgAutoloadClasses['MapsKMLFormatter'] = $incDir . 'Maps_KMLFormatter.php'; |
66 | | - $wgAutoloadClasses['MapsLayer'] = $incDir . 'Maps_Layer.php'; |
67 | | - $wgAutoloadClasses['MapsLayerPage'] = $incDir . 'Maps_LayerPage.php'; |
68 | | - $wgAutoloadClasses['MapsLayers'] = $incDir . 'Maps_Layers.php'; |
69 | | - $wgAutoloadClasses['MapsLocation'] = $incDir . 'Maps_Location.php'; |
70 | | - $wgAutoloadClasses['iMappingFeature'] = $incDir . 'iMappingFeature.php'; |
71 | | - $wgAutoloadClasses['iMappingService'] = $incDir . 'iMappingService.php'; |
72 | | - $wgAutoloadClasses['MapsMappingServices'] = $incDir . 'Maps_MappingServices.php'; |
73 | | - $wgAutoloadClasses['MapsMappingService'] = $incDir . 'Maps_MappingService.php'; |
74 | | - |
75 | | - // Autoload the "includes/criteria/" classes. |
76 | | - $criDir = $incDir . 'criteria/'; |
77 | | - $wgAutoloadClasses['CriterionIsDistance'] = $criDir . 'CriterionIsDistance.php'; |
78 | | - $wgAutoloadClasses['CriterionIsImage'] = $criDir . 'CriterionIsImage.php'; |
79 | | - $wgAutoloadClasses['CriterionIsLocation'] = $criDir . 'CriterionIsLocation.php'; |
80 | | - $wgAutoloadClasses['CriterionMapDimension'] = $criDir . 'CriterionMapDimension.php'; |
81 | | - $wgAutoloadClasses['CriterionMapLayer'] = $criDir . 'CriterionMapLayer.php'; |
82 | | - |
83 | | - // Autoload the "includes/features/" classes. |
84 | | - $ftDir = $incDir . '/features/'; |
85 | | - $wgAutoloadClasses['MapsBaseMap'] = $ftDir . 'Maps_BaseMap.php'; |
86 | | - $wgAutoloadClasses['MapsBasePointMap'] = $ftDir . 'Maps_BasePointMap.php'; |
87 | | - |
88 | | - // Autoload the "includes/geocoders/" classes. |
89 | | - $geoDir = $incDir . 'geocoders/'; |
90 | | - $wgAutoloadClasses['MapsGeonamesGeocoder'] = $geoDir . 'Maps_GeonamesGeocoder.php'; |
91 | | - $wgAutoloadClasses['MapsGoogleGeocoder'] = $geoDir . 'Maps_GoogleGeocoder.php'; |
92 | | - $wgAutoloadClasses['MapsYahooGeocoder'] = $geoDir . 'Maps_YahooGeocoder.php'; |
93 | | - |
94 | | - // Autoload the "includes/layers/" classes. |
95 | | - $lyrDir = $incDir . 'layers/'; |
96 | | - $wgAutoloadClasses['MapsImageLayer'] = $lyrDir . 'Maps_ImageLayer.php'; |
97 | | - $wgAutoloadClasses['MapsKMLLayer'] = $lyrDir . 'Maps_KMLLayer.php'; |
98 | | - |
99 | | - // Autoload the "includes/manipulations/" classes. |
100 | | - $manDir = $incDir . 'manipulations/'; |
101 | | - $wgAutoloadClasses['ParamManipulationBoolstr'] = $manDir . 'ParamManipulationBoolstr.php'; |
102 | | - $wgAutoloadClasses['MapsParamCoordSet'] = $manDir . 'Maps_ParamCoordSet.php'; |
103 | | - $wgAutoloadClasses['MapsParamDimension'] = $manDir . 'Maps_ParamDimension.php'; |
104 | | - $wgAutoloadClasses['MapsParamGeoService'] = $manDir . 'Maps_ParamGeoService.php'; |
105 | | - $wgAutoloadClasses['MapsParamImage'] = $manDir . 'Maps_ParamImage.php'; |
106 | | - $wgAutoloadClasses['MapsParamImageFull'] = $manDir . 'Maps_ParamImageFull.php'; |
107 | | - $wgAutoloadClasses['MapsParamLocation'] = $manDir . 'Maps_ParamLocation.php'; |
108 | | - $wgAutoloadClasses['MapsParamService'] = $manDir . 'Maps_ParamService.php'; |
109 | | - $wgAutoloadClasses['MapsParamZoom'] = $manDir . 'Maps_ParamZoom.php'; |
110 | | - |
111 | | - // Autoload the "includes/parserHooks/" classes. |
112 | | - $phDir = $incDir . '/parserHooks/'; |
113 | | - $wgAutoloadClasses['MapsCoordinates'] = $phDir . 'Maps_Coordinates.php'; |
114 | | - $wgAutoloadClasses['MapsDisplayMap'] = $phDir . 'Maps_DisplayMap.php'; |
115 | | - $wgAutoloadClasses['MapsDisplayPoint'] = $phDir . 'Maps_DisplayPoint.php'; |
116 | | - $wgAutoloadClasses['MapsDistance'] = $phDir . 'Maps_Distance.php'; |
117 | | - $wgAutoloadClasses['MapsFinddestination'] = $phDir . 'Maps_Finddestination.php'; |
118 | | - $wgAutoloadClasses['MapsGeocode'] = $phDir . 'Maps_Geocode.php'; |
119 | | - $wgAutoloadClasses['MapsGeodistance'] = $phDir . 'Maps_Geodistance.php'; |
120 | | - |
121 | | - // To ensure Maps remains compatible with pre 1.16. |
122 | | - if ( !class_exists( 'Html' ) ) { |
123 | | - $wgAutoloadClasses['Html'] = $egMapsDir . 'compat/Html.php'; |
124 | | - } |
125 | | - |
126 | | - if ( version_compare( $wgVersion, '1.16alpha', '>=' ) ) { |
127 | | - $wgExtensionMessagesFiles['MapsMagic'] = $egMapsDir . 'Maps.i18n.magic.php'; |
128 | | - } |
129 | | - |
130 | | - $wgExtensionMessagesFiles['Maps'] = $egMapsDir . 'Maps.i18n.php'; |
| 48 | +$useExtensionPath = version_compare( $wgVersion, '1.16', '>=' ) && isset( $wgExtensionAssetsPath ) && $wgExtensionAssetsPath; |
| 49 | +$egMapsScriptPath = ( $useExtensionPath ? $wgExtensionAssetsPath : $wgScriptPath . '/extensions' ) . '/Maps'; |
| 50 | +$egMapsDir = dirname( __FILE__ ) . '/'; |
| 51 | +unset( $useExtensionPath ); |
131 | 52 | |
132 | | - // Register the initialization function of Maps. |
133 | | - $wgExtensionFunctions[] = 'efMapsSetup'; |
| 53 | +$egMapsStyleVersion = $wgStyleVersion . '-' . Maps_VERSION; |
134 | 54 | |
135 | | - // Since 0.2 |
136 | | - $wgHooks['AdminLinks'][] = 'MapsHooks::addToAdminLinks'; |
137 | | - |
138 | | - // Since 0.6.5 |
139 | | - $wgHooks['UnitTestsList'][] = 'MapsHooks::registerUnitTests'; |
140 | | - |
141 | | - // Since 0.7 |
142 | | - $wgHooks['SkinAfterBottomScripts'][] = 'MapsHooks::addOnloadFunction'; |
143 | | - |
144 | | - // Since 0.7.1 |
145 | | - $wgHooks['ArticleFromTitle'][] = 'MapsHooks::onArticleFromTitle'; |
146 | | - |
147 | | - $egMapsFeatures = array(); |
148 | | - |
149 | | - // Include the settings file. |
150 | | - require_once $egMapsDir . 'Maps_Settings.php'; |
151 | | - |
152 | | - define( 'Maps_NS_LAYER', $egMapsNamespaceIndex + 0 ); |
153 | | - define( 'Maps_NS_LAYER_TALK', $egMapsNamespaceIndex + 1 ); |
154 | | -} |
| 55 | +$wgAutoloadClasses['MapsHooks'] = dirname( __FILE__ ) . '/Maps.hooks.php'; |
155 | 56 | |
| 57 | +// Autoload the "includes/" classes and interfaces. |
| 58 | +$incDir = dirname( __FILE__ ) . '/includes/'; |
| 59 | +$wgAutoloadClasses['MapsMapper'] = $incDir . 'Maps_Mapper.php'; |
| 60 | +$wgAutoloadClasses['MapsCoordinateParser'] = $incDir . 'Maps_CoordinateParser.php'; |
| 61 | +$wgAutoloadClasses['MapsDistanceParser'] = $incDir . 'Maps_DistanceParser.php'; |
| 62 | +$wgAutoloadClasses['MapsGeoFunctions'] = $incDir . 'Maps_GeoFunctions.php'; |
| 63 | +$wgAutoloadClasses['MapsGeocoders'] = $incDir . 'Maps_Geocoders.php'; |
| 64 | +$wgAutoloadClasses['MapsGeocoder'] = $incDir . 'Maps_Geocoder.php'; |
| 65 | +$wgAutoloadClasses['MapsKMLFormatter'] = $incDir . 'Maps_KMLFormatter.php'; |
| 66 | +$wgAutoloadClasses['MapsLayer'] = $incDir . 'Maps_Layer.php'; |
| 67 | +$wgAutoloadClasses['MapsLayerPage'] = $incDir . 'Maps_LayerPage.php'; |
| 68 | +$wgAutoloadClasses['MapsLayers'] = $incDir . 'Maps_Layers.php'; |
| 69 | +$wgAutoloadClasses['MapsLocation'] = $incDir . 'Maps_Location.php'; |
| 70 | +$wgAutoloadClasses['iMappingFeature'] = $incDir . 'iMappingFeature.php'; |
| 71 | +$wgAutoloadClasses['iMappingService'] = $incDir . 'iMappingService.php'; |
| 72 | +$wgAutoloadClasses['MapsMappingServices'] = $incDir . 'Maps_MappingServices.php'; |
| 73 | +$wgAutoloadClasses['MapsMappingService'] = $incDir . 'Maps_MappingService.php'; |
| 74 | + |
| 75 | +// Autoload the "includes/criteria/" classes. |
| 76 | +$criDir = $incDir . 'criteria/'; |
| 77 | +$wgAutoloadClasses['CriterionIsDistance'] = $criDir . 'CriterionIsDistance.php'; |
| 78 | +$wgAutoloadClasses['CriterionIsImage'] = $criDir . 'CriterionIsImage.php'; |
| 79 | +$wgAutoloadClasses['CriterionIsLocation'] = $criDir . 'CriterionIsLocation.php'; |
| 80 | +$wgAutoloadClasses['CriterionMapDimension'] = $criDir . 'CriterionMapDimension.php'; |
| 81 | +$wgAutoloadClasses['CriterionMapLayer'] = $criDir . 'CriterionMapLayer.php'; |
| 82 | + |
| 83 | +// Autoload the "includes/features/" classes. |
| 84 | +$ftDir = $incDir . '/features/'; |
| 85 | +$wgAutoloadClasses['MapsBaseMap'] = $ftDir . 'Maps_BaseMap.php'; |
| 86 | +$wgAutoloadClasses['MapsBasePointMap'] = $ftDir . 'Maps_BasePointMap.php'; |
| 87 | + |
| 88 | +// Autoload the "includes/geocoders/" classes. |
| 89 | +$geoDir = $incDir . 'geocoders/'; |
| 90 | +$wgAutoloadClasses['MapsGeonamesGeocoder'] = $geoDir . 'Maps_GeonamesGeocoder.php'; |
| 91 | +$wgAutoloadClasses['MapsGoogleGeocoder'] = $geoDir . 'Maps_GoogleGeocoder.php'; |
| 92 | +$wgAutoloadClasses['MapsYahooGeocoder'] = $geoDir . 'Maps_YahooGeocoder.php'; |
| 93 | + |
| 94 | +// Autoload the "includes/layers/" classes. |
| 95 | +$lyrDir = $incDir . 'layers/'; |
| 96 | +$wgAutoloadClasses['MapsImageLayer'] = $lyrDir . 'Maps_ImageLayer.php'; |
| 97 | +$wgAutoloadClasses['MapsKMLLayer'] = $lyrDir . 'Maps_KMLLayer.php'; |
| 98 | + |
| 99 | +// Autoload the "includes/manipulations/" classes. |
| 100 | +$manDir = $incDir . 'manipulations/'; |
| 101 | +$wgAutoloadClasses['ParamManipulationBoolstr'] = $manDir . 'ParamManipulationBoolstr.php'; |
| 102 | +$wgAutoloadClasses['MapsParamCoordSet'] = $manDir . 'Maps_ParamCoordSet.php'; |
| 103 | +$wgAutoloadClasses['MapsParamDimension'] = $manDir . 'Maps_ParamDimension.php'; |
| 104 | +$wgAutoloadClasses['MapsParamGeoService'] = $manDir . 'Maps_ParamGeoService.php'; |
| 105 | +$wgAutoloadClasses['MapsParamImage'] = $manDir . 'Maps_ParamImage.php'; |
| 106 | +$wgAutoloadClasses['MapsParamImageFull'] = $manDir . 'Maps_ParamImageFull.php'; |
| 107 | +$wgAutoloadClasses['MapsParamLocation'] = $manDir . 'Maps_ParamLocation.php'; |
| 108 | +$wgAutoloadClasses['MapsParamService'] = $manDir . 'Maps_ParamService.php'; |
| 109 | +$wgAutoloadClasses['MapsParamZoom'] = $manDir . 'Maps_ParamZoom.php'; |
| 110 | + |
| 111 | +// Autoload the "includes/parserHooks/" classes. |
| 112 | +$phDir = $incDir . '/parserHooks/'; |
| 113 | +$wgAutoloadClasses['MapsCoordinates'] = $phDir . 'Maps_Coordinates.php'; |
| 114 | +$wgAutoloadClasses['MapsDisplayMap'] = $phDir . 'Maps_DisplayMap.php'; |
| 115 | +$wgAutoloadClasses['MapsDisplayPoint'] = $phDir . 'Maps_DisplayPoint.php'; |
| 116 | +$wgAutoloadClasses['MapsDistance'] = $phDir . 'Maps_Distance.php'; |
| 117 | +$wgAutoloadClasses['MapsFinddestination'] = $phDir . 'Maps_Finddestination.php'; |
| 118 | +$wgAutoloadClasses['MapsGeocode'] = $phDir . 'Maps_Geocode.php'; |
| 119 | +$wgAutoloadClasses['MapsGeodistance'] = $phDir . 'Maps_Geodistance.php'; |
| 120 | + |
| 121 | +// To ensure Maps remains compatible with pre 1.16. |
| 122 | +if ( !class_exists( 'Html' ) ) { |
| 123 | + $wgAutoloadClasses['Html'] = $egMapsDir . 'compat/Html.php'; |
| 124 | +} |
| 125 | + |
| 126 | +if ( version_compare( $wgVersion, '1.16alpha', '>=' ) ) { |
| 127 | + $wgExtensionMessagesFiles['MapsMagic'] = $egMapsDir . 'Maps.i18n.magic.php'; |
| 128 | +} |
| 129 | + |
| 130 | +$wgExtensionMessagesFiles['Maps'] = $egMapsDir . 'Maps.i18n.php'; |
| 131 | + |
| 132 | +// Register the initialization function of Maps. |
| 133 | +$wgExtensionFunctions[] = 'efMapsSetup'; |
| 134 | + |
| 135 | +// Since 0.2 |
| 136 | +$wgHooks['AdminLinks'][] = 'MapsHooks::addToAdminLinks'; |
| 137 | + |
| 138 | +// Since 0.6.5 |
| 139 | +$wgHooks['UnitTestsList'][] = 'MapsHooks::registerUnitTests'; |
| 140 | + |
| 141 | +// Since 0.7 |
| 142 | +$wgHooks['SkinAfterBottomScripts'][] = 'MapsHooks::addOnloadFunction'; |
| 143 | + |
| 144 | +// Since 0.7.1 |
| 145 | +$wgHooks['ArticleFromTitle'][] = 'MapsHooks::onArticleFromTitle'; |
| 146 | + |
| 147 | +$egMapsFeatures = array(); |
| 148 | + |
| 149 | +// Include the settings file. |
| 150 | +require_once $egMapsDir . 'Maps_Settings.php'; |
| 151 | + |
| 152 | +define( 'Maps_NS_LAYER', $egMapsNamespaceIndex + 0 ); |
| 153 | +define( 'Maps_NS_LAYER_TALK', $egMapsNamespaceIndex + 1 ); |
| 154 | + |
156 | 155 | /** |
157 | 156 | * Initialization function for the Maps extension. |
158 | 157 | * |
— | — | @@ -180,7 +179,7 @@ |
181 | 180 | wfMsg( 'maps-ns-layer' ) => Maps_NS_LAYER, |
182 | 181 | wfMsg( 'maps-ns-layer-talk' ) => Maps_NS_LAYER_TALK |
183 | 182 | ); |
184 | | - |
| 183 | + |
185 | 184 | wfRunHooks( 'MappingServiceLoad' ); |
186 | 185 | wfRunHooks( 'MappingFeatureLoad' ); |
187 | 186 | |
— | — | @@ -198,7 +197,9 @@ |
199 | 198 | '[http://www.mediawiki.org/wiki/Extension:Maps/Credits ' . wfMsg( 'maps-others' ) . ']' |
200 | 199 | ), |
201 | 200 | 'url' => 'http://www.mediawiki.org/wiki/Extension:Maps', |
202 | | - 'description' => wfMsgExt( 'maps_desc', 'parsemag', $servicesList, count($servicesList) ), |
| 201 | + // Want to "fix" this? Sure, but test your code! |
| 202 | + // This breaks stuff: http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/Maps/Maps.php?r1=82288&r2=82503 |
| 203 | + 'description' => wfMsgExt( 'maps_desc', 'parsemag', $servicesList ), |
203 | 204 | ); |
204 | 205 | |
205 | 206 | return true; |
Index: trunk/extensions/Maps/Maps_Settings.php |
— | — | @@ -21,8 +21,6 @@ |
22 | 22 | |
23 | 23 | |
24 | 24 | |
25 | | -$egMapsUseRL = false; //method_exists( 'OutputPage', 'addModules' ); |
26 | | - |
27 | 25 | # Features configuration |
28 | 26 | # Commenting out the inclusion of any feature will make Maps completely ignore it, and so improve performance. |
29 | 27 | |