Index: trunk/extensions/SemanticMaps/SemanticMaps.php |
— | — | @@ -151,14 +151,20 @@ |
152 | 152 | function smfSelectFormInputHTML($coordinates, $input_name, $is_mandatory, $is_disabled, $field_args) { |
153 | 153 | global $egMapsServices; |
154 | 154 | |
155 | | - // If service_name is set, use this value, and ignore any given service parameters |
156 | | - // This will prevent ..input type=googlemaps|service=yahoo.. from shwoing up a Yahoo! Maps map |
157 | | - if (array_key_exists('service_name', $field_args)) $field_args['service'] = $field_args['service_name']; |
158 | | - |
159 | | - $field_args['service'] = MapsMapper::getValidService($field_args['service']); |
| 155 | + // If service_name is set, use this value, and ignore any given |
| 156 | + // service parameters |
| 157 | + // This will prevent ..input type=googlemaps|service=yahoo.. from |
| 158 | + // showing up as a Yahoo! Maps map |
| 159 | + if (array_key_exists('service_name', $field_args)) |
| 160 | + $service_name = $field_args['service_name']; |
| 161 | + elseif (array_key_exists('service', $field_args)) |
| 162 | + $service_name = $field_args['service']; |
| 163 | + else |
| 164 | + $service_name = null; |
| 165 | + $service_name = MapsMapper::getValidService($service_name); |
160 | 166 | |
161 | | - if (array_key_exists('fi', $egMapsServices[$field_args['service']])) { |
162 | | - $formInput = new $egMapsServices[$field_args['service']]['fi']['class'](); |
| 167 | + if (array_key_exists('fi', $egMapsServices[$service_name])) { |
| 168 | + $formInput = new $egMapsServices[$service_name]['fi']['class'](); |
163 | 169 | |
164 | 170 | // Get and return the form input HTML from the hook corresponding with the provided service |
165 | 171 | return $formInput->formInputHTML($coordinates, $input_name, $is_mandatory, $is_disabled, $field_args); |