r65593 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65592‎ | r65593 | r65594 >
Date:22:45, 27 April 2010
Author:siebrand
Status:deferred
Tags:
Comment:
* Fix duplicate key issue for wgExtensionMessagesFiles['Maps']. Was being used for both messages and magic words.
* Remove trailing whitespace
Modified paths:
  • /trunk/extensions/Maps/Maps.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Maps/Maps.php
@@ -1,21 +1,21 @@
22 <?php
33
4 -/**
 4+/**
55 * Initialization file for the Maps extension.
66 * Extension documentation: http://www.mediawiki.org/wiki/Extension:Maps
77 *
88 * @file Maps.php
99 * @ingroup Maps
10 - *
 10+ *
1111 * @author Jeroen De Dauw
1212 */
1313
1414 /**
1515 * This documenation group collects source code files belonging to Maps.
1616 *
17 - * Please do not use this group name for other code. If you have an extension to
 17+ * Please do not use this group name for other code. If you have an extension to
1818 * Maps, please use your own group defenition.
19 - *
 19+ *
2020 * @defgroup Maps Maps
2121 */
2222
@@ -33,41 +33,41 @@
3434 echo '<b>Warning:</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>.';
3535 }
3636 else {
37 - define( 'Maps_VERSION', '0.6 a17' );
38 -
 37+ define( 'Maps_VERSION', '0.6 a18' );
 38+
3939 // The different coordinate notations.
4040 define( 'Maps_COORDS_FLOAT', 'float' );
4141 define( 'Maps_COORDS_DMS', 'dms' );
4242 define( 'Maps_COORDS_DM', 'dm' );
4343 define( 'Maps_COORDS_DD', 'dd' );
44 -
 44+
4545 // The symbols to use for degrees, minutes and seconds.
4646 define( 'Maps_GEO_DEG', '°' );
4747 define( 'Maps_GEO_MIN', "'" );
48 - define( 'Maps_GEO_SEC', '"' );
49 -
 48+ define( 'Maps_GEO_SEC', '"' );
 49+
5050 $egMapsScriptPath = ( isset( $wgExtensionAssetsPath ) && $wgExtensionAssetsPath ? $wgExtensionAssetsPath : $wgScriptPath . '/extensions' ) . '/Maps';
5151 $egMapsDir = dirname( __FILE__ ) . '/';
52 -
 52+
5353 // To ensure Maps remains compatible with pre 1.16.
5454 if ( version_compare( $wgVersion, '1.16', '<' ) ) {
5555 $wgAutoloadClasses['Html'] = $egMapsDir . 'Compat/Html.php';
5656 }
57 -
58 - $egMapsStyleVersion = $wgStyleVersion . '-' . Maps_VERSION;
59 -
 57+
 58+ $egMapsStyleVersion = $wgStyleVersion . '-' . Maps_VERSION;
 59+
6060 $egMapsFeatures = array();
61 - $egMapsServices = array();
62 -
 61+ $egMapsServices = array();
 62+
6363 // Include the settings file.
6464 require_once( $egMapsDir . 'Maps_Settings.php' );
65 -
 65+
6666 $wgExtensionMessagesFiles['Maps'] = $egMapsDir . 'Maps.i18n.php';
67 -
 67+
6868 if( version_compare( $wgVersion, '1.16alpha', '>=' ) ) {
69 - $wgExtensionMessagesFiles['Maps'] = $egMapsDir . 'Maps.i18n.magic.php';
70 - }
71 -
 69+ $wgExtensionMessagesFiles['MapsMagic'] = $egMapsDir . 'Maps.i18n.magic.php';
 70+ }
 71+
7272 // Register the initialization function of Maps.
7373 $wgExtensionFunctions[] = 'efMapsSetup';
7474
@@ -80,31 +80,31 @@
8181 function efMapsSetup() {
8282 global $wgExtensionCredits, $wgLang, $wgAutoloadClasses, $IP, $wgStyleVersion, $wgScriptPath, $wgJsMimeType, $wgExtensionAssetsPath;
8383 global $egMapsDefaultService, $egMapsAvailableServices, $egMapsServices, $egMapsDefaultGeoService, $egMapsScriptPath;
84 - global $egMapsAvailableGeoServices, $egMapsDir, $egMapsAvailableFeatures, $egMapsUseMinJs, $egMapsJsExt, $egMapsStyleVersion;
85 -
 84+ global $egMapsAvailableGeoServices, $egMapsDir, $egMapsAvailableFeatures, $egMapsUseMinJs, $egMapsJsExt, $egMapsStyleVersion;
 85+
8686 // Autoload the general classes
87 - $wgAutoloadClasses['MapsCoordinateParser'] = $egMapsDir . 'Maps_CoordinateParser.php';
88 - $wgAutoloadClasses['MapsMapper'] = $egMapsDir . 'Maps_Mapper.php';
89 -
 87+ $wgAutoloadClasses['MapsCoordinateParser'] = $egMapsDir . 'Maps_CoordinateParser.php';
 88+ $wgAutoloadClasses['MapsMapper'] = $egMapsDir . 'Maps_Mapper.php';
 89+
9090 wfLoadExtensionMessages( 'Maps' );
9191
9292 wfRunHooks( 'MappingFeatureLoad' );
9393 wfRunHooks( 'MappingServiceLoad' );
94 -
 94+
9595 // Remove all hooked in services that should not be available.
9696 foreach ( $egMapsServices as $service => $data ) {
9797 if ( ! in_array( $service, $egMapsAvailableServices ) ) unset( $egMapsServices[$service] );
9898 }
9999 $egMapsAvailableServices = array_keys( $egMapsServices );
100 -
 100+
101101 // Enure that the default service is one of the enabled ones.
102 - $egMapsDefaultService = in_array( $egMapsDefaultService, $egMapsAvailableServices ) ? $egMapsDefaultService : $egMapsAvailableServices[0];
103 -
 102+ $egMapsDefaultService = in_array( $egMapsDefaultService, $egMapsAvailableServices ) ? $egMapsDefaultService : $egMapsAvailableServices[0];
 103+
104104 // Creation of a list of internationalized service names.
105105 $services = array();
106106 foreach ( array_keys( $egMapsServices ) as $name ) $services[] = wfMsg( 'maps_' . $name );
107107 $services_list = $wgLang->listToText( $services );
108 -
 108+
109109 $wgExtensionCredits['parserhook'][] = array(
110110 'path' => __FILE__,
111111 'name' => wfMsg( 'maps_name' ),
@@ -119,9 +119,9 @@
120120 );
121121
122122 MapsMapper::initialize();
123 -
 123+
124124 $egMapsJsExt = $egMapsUseMinJs ? '.min.js' : '.js';
125 -
 125+
126126 return true;
127127 }
128128
@@ -130,11 +130,11 @@
131131 */
132132 function efMapsAddToAdminLinks( &$admin_links_tree ) {
133133 $displaying_data_section = $admin_links_tree->getSection( wfMsg( 'smw_adminlinks_displayingdata' ) );
134 -
 134+
135135 // Escape if SMW hasn't added links.
136136 if ( is_null( $displaying_data_section ) ) return true;
137137 $smw_docu_row = $displaying_data_section->getRow( 'smw' );
138 -
 138+
139139 $maps_docu_label = wfMsg( 'adminlinks_documentation', wfMsg( 'maps_name' ) );
140140 $smw_docu_row->addItem( AlItem::newFromExternalLink( 'http://www.mediawiki.org/wiki/Extension:Maps', $maps_docu_label ) );
141141

Status & tagging log