Index: trunk/extensions/Maps/Maps.php |
— | — | @@ -33,7 +33,7 @@ |
34 | 34 | 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>.'; |
35 | 35 | } |
36 | 36 | else { |
37 | | - define('Maps_VERSION', '0.5.1 rc1'); |
| 37 | + define('Maps_VERSION', '0.5.1 rc2'); |
38 | 38 | |
39 | 39 | $egMapsScriptPath = $wgScriptPath . '/extensions/Maps'; |
40 | 40 | $egMapsIP = $IP . '/extensions/Maps'; |
— | — | @@ -44,7 +44,7 @@ |
45 | 45 | require_once($egMapsIP . '/Maps_Settings.php'); |
46 | 46 | |
47 | 47 | // Register the initialization function of Maps. |
48 | | - $wgExtensionFunctions[] = 'efMapsSetup'; |
| 48 | + $wgExtensionFunctions[] = 'efMapsSetup'; |
49 | 49 | |
50 | 50 | $wgExtensionMessagesFiles['Maps'] = $egMapsIP . '/Maps.i18n.php'; |
51 | 51 | |
— | — | @@ -93,28 +93,28 @@ |
94 | 94 | 'description' => wfMsgExt( 'maps_desc', 'parsemag', $services_list ), |
95 | 95 | 'descriptionmsg' => wfMsgExt( 'maps_desc', 'parsemag', $services_list ), |
96 | 96 | ); |
97 | | - |
| 97 | + |
98 | 98 | MapsMapper::initializeMainParams(); |
99 | | - |
100 | | - // These loops take care of everything hooked into Maps. |
| 99 | + |
| 100 | + // Loop through the available mapping features, load and initialize them. |
101 | 101 | foreach($egMapsAvailableFeatures as $key => $values) { |
102 | 102 | // Load and optionally initizlize feature. |
103 | 103 | if (array_key_exists('class', $values) && array_key_exists('file', $values) && array_key_exists('local', $values)) { |
104 | | - $wgAutoloadClasses[$values['class']] = $values['local'] ? $egMapsIP . '/' . $values['file'] : $IP . '/extensions/' . $values['file']; |
| 104 | + $wgAutoloadClasses[$values['class']] = array_key_exists('local', $values) && $values['local'] ? $egMapsIP . '/' . $values['file'] : $IP . '/extensions/' . $values['file']; |
105 | 105 | if (method_exists($values['class'], 'initialize')) call_user_func(array($values['class'], 'initialize')); |
106 | 106 | } |
107 | 107 | } |
108 | | - |
109 | | - // Check for wich services there are handlers for the current fature, and load them |
| 108 | + |
| 109 | + // Loop through the available mapping services to load and initialize their general classes. |
110 | 110 | foreach ($egMapsServices as $serviceData) { |
111 | 111 | if (array_key_exists('classes', $serviceData)) { |
112 | 112 | foreach($serviceData['classes'] as $class) { |
113 | | - $file = $class['local'] ? $egMapsIP . '/' . $class['file'] : $IP . '/extensions/' . $class['file']; |
| 113 | + $file = array_key_exists('local', $class) && $class['local'] ? $egMapsIP . '/' . $class['file'] : $IP . '/extensions/' . $class['file']; |
114 | 114 | $wgAutoloadClasses[$class['class']] = $file; |
115 | 115 | if (method_exists($class['class'], 'initialize')) call_user_func(array($class['class'], 'initialize')); |
116 | 116 | } |
117 | | - } |
118 | | - } |
| 117 | + } |
| 118 | + } |
119 | 119 | |
120 | 120 | return true; |
121 | 121 | } |