Index: trunk/extensions/Maps/Maps.i18n.php |
— | — | @@ -32,6 +32,8 @@ |
33 | 33 | 'maps-error-no-layertype' => 'You need to specify the layer type. {{PLURAL:$2|Only this type is|These types are}} supported: $1', |
34 | 34 | 'validation-error-invalid-layer' => 'Parameter $1 must be a valid layer.', |
35 | 35 | 'validation-error-invalid-layers' => 'Parameter $1 must be one or more valid layers.', |
| 36 | + 'maps-layer-of-type' => 'Layer of type $1', |
| 37 | + 'maps-layer-type-supported-by' => 'This layer type can {{PLURAL:$2|only be used with the $1 mapping service|be used with these mapping services: $1}}.', |
36 | 38 | |
37 | 39 | // Validation |
38 | 40 | 'validation-error-invalid-location' => 'Parameter $1 must be a valid location.', |
Index: trunk/extensions/Maps/includes/layers/Maps_ImageLayer.php |
— | — | @@ -51,7 +51,7 @@ |
52 | 52 | /** |
53 | 53 | * @see MapsLayer::getJavaScriptDefinition |
54 | 54 | * |
55 | | - * @since 0.7.1 |
| 55 | + * @since 0.7.2 |
56 | 56 | * |
57 | 57 | * @return string |
58 | 58 | */ |
Index: trunk/extensions/Maps/includes/layers/Maps_KMLLayer.php |
— | — | @@ -44,7 +44,7 @@ |
45 | 45 | /** |
46 | 46 | * @see MapsLayer::getJavaScriptDefinition |
47 | 47 | * |
48 | | - * @since 0.7.1 |
| 48 | + * @since 0.7.2 |
49 | 49 | * |
50 | 50 | * @return string |
51 | 51 | */ |
Index: trunk/extensions/Maps/includes/Maps_Layers.php |
— | — | @@ -22,7 +22,7 @@ |
23 | 23 | protected static $classes = array(); |
24 | 24 | |
25 | 25 | /** |
26 | | - * List that maps layer types (keys) to the services that support them (values). |
| 26 | + * List that maps layer types (keys) to the services that they support (values). |
27 | 27 | * |
28 | 28 | * @since 0.7.2 |
29 | 29 | * |
— | — | @@ -79,6 +79,19 @@ |
80 | 80 | return $layers; |
81 | 81 | } |
82 | 82 | } |
| 83 | + |
| 84 | + /** |
| 85 | + * Returns the mapping services supported by the provided layer type. |
| 86 | + * |
| 87 | + * @since 0.7.2 |
| 88 | + * |
| 89 | + * @param string $type |
| 90 | + * |
| 91 | + * @return array |
| 92 | + */ |
| 93 | + public static function getServicesForType( $type ) { |
| 94 | + return array_key_exists( $type, self::$services ) ? self::$services[$type] : array(); |
| 95 | + } |
83 | 96 | |
84 | 97 | /** |
85 | 98 | * Returns if there is a layer class for the provided layer type. |
Index: trunk/extensions/Maps/includes/Maps_LayerPage.php |
— | — | @@ -49,7 +49,7 @@ |
50 | 50 | * @since 0.7.1 |
51 | 51 | */ |
52 | 52 | public function view() { |
53 | | - global $wgOut; |
| 53 | + global $wgOut, $wgLang; |
54 | 54 | |
55 | 55 | $wgOut->setPageTitle( $this->mTitle->getPrefixedText() ); |
56 | 56 | |
— | — | @@ -57,10 +57,23 @@ |
58 | 58 | $layerType = $this->getLayerType(); |
59 | 59 | |
60 | 60 | if ( $layerType !== false && MapsLayers::hasLayer( $layerType ) ) { |
| 61 | + $wgOut->addHTML( |
| 62 | + Html::element( |
| 63 | + 'h3', |
| 64 | + array(), |
| 65 | + wfMsgExt( 'maps-layer-of-type', 'parsemag', $layerType ) |
| 66 | + ) |
| 67 | + ); |
| 68 | + |
| 69 | + $supportedServices = MapsLayers::getServicesForType( $layerType ); |
| 70 | + |
| 71 | + $wgOut->addHTML( |
| 72 | + wfMsgExt( 'maps-layer-type-supported-by', 'parsemag', $wgLang->listToText( $supportedServices ), count( $supportedServices ) ) |
| 73 | + ); |
| 74 | + |
61 | 75 | $this->displayLayerDefinition(); |
62 | 76 | } |
63 | 77 | else { |
64 | | - global $wgLang; |
65 | 78 | $availableLayerTypes = MapsLayers::getAvailableLayers(); |
66 | 79 | |
67 | 80 | if ( $layerType === false ) { |
— | — | @@ -117,13 +130,11 @@ |
118 | 131 | '</span><br />' |
119 | 132 | ); |
120 | 133 | |
121 | | - if ( count( $layer->getErrorMessages() ) - count( $messages ) > 0 ) { |
122 | | - $errorHeader = Html::element( |
123 | | - 'th', |
124 | | - array( 'width' => '50%' ), |
125 | | - wfMsg( 'maps-layer-errors' ) |
126 | | - ); |
127 | | - } |
| 134 | + $errorHeader = Html::element( |
| 135 | + 'th', |
| 136 | + array( 'width' => '50%' ), |
| 137 | + wfMsg( 'maps-layer-errors' ) |
| 138 | + ); |
128 | 139 | } |
129 | 140 | |
130 | 141 | $rows = array(); |
— | — | @@ -138,7 +149,7 @@ |
139 | 150 | ) . |
140 | 151 | Html::element( |
141 | 152 | 'th', |
142 | | - array(), |
| 153 | + array( 'colspan' ), |
143 | 154 | wfMsg( 'maps-layer-value' ) |
144 | 155 | ) . $errorHeader |
145 | 156 | ); |