Index: trunk/extensions/Maps/Services/Maps_MappingService.php |
— | — | @@ -111,18 +111,6 @@ |
112 | 112 | } |
113 | 113 | |
114 | 114 | /** |
115 | | - * Initializes the service parameters. |
116 | | - * |
117 | | - * You can override this method to set service specific parameters in the inheriting class. |
118 | | - * |
119 | | - * @since 0.6.3 |
120 | | - * |
121 | | - * @param array $parameters |
122 | | - */ |
123 | | - protected function initParameterInfo( array &$parameters ) { |
124 | | - } |
125 | | - |
126 | | - /** |
127 | 115 | * @see iMappingService::createMarkersJs |
128 | 116 | * |
129 | 117 | * @since 0.6.5 |
— | — | @@ -188,74 +176,71 @@ |
189 | 177 | } |
190 | 178 | |
191 | 179 | /** |
192 | | - * Adds a dependency that is needed for this service. It will be passed along with the next |
193 | | - * call to getDependencyHtml or addDependencies. |
| 180 | + * @see iMappingService::addDependency |
194 | 181 | * |
195 | 182 | * @since 0.6.3 |
196 | | - * |
197 | | - * @param string $dependencyHtml |
198 | 183 | */ |
199 | 184 | public final function addDependency( $dependencyHtml ) { |
200 | 185 | $this->dependencies[] = $dependencyHtml; |
201 | 186 | } |
202 | 187 | |
203 | 188 | /** |
204 | | - * Returns a list of html fragments, such as script includes, the current service depends on. |
| 189 | + * @see iMappingService::getName |
205 | 190 | * |
206 | 191 | * @since 0.6.3 |
| 192 | + */ |
| 193 | + public function getName() { |
| 194 | + return $this->serviceName; |
| 195 | + } |
| 196 | + |
| 197 | + /** |
| 198 | + * @see iMappingService::getFeature |
207 | 199 | * |
208 | | - * @return array |
| 200 | + * @since 0.6.3 |
209 | 201 | */ |
210 | | - protected function getDependencies() { |
211 | | - return array(); |
| 202 | + public function getFeature( $featureName ) { |
| 203 | + return array_key_exists( $featureName, $this->features ) ? $this->features[$featureName] : false; |
212 | 204 | } |
213 | 205 | |
214 | 206 | /** |
215 | | - * Returns the internal name of the service. |
| 207 | + * @see iMappingService::getAliases |
216 | 208 | * |
217 | 209 | * @since 0.6.3 |
218 | | - * |
219 | | - * @return string |
220 | 210 | */ |
221 | | - public function getName() { |
222 | | - return $this->serviceName; |
| 211 | + public function getAliases() { |
| 212 | + return $this->aliases; |
223 | 213 | } |
224 | 214 | |
225 | 215 | /** |
226 | | - * Returns the name of the class that handles the provided feature in this service, or false if there is none. |
| 216 | + * @see iMappingService::hasAlias |
227 | 217 | * |
228 | 218 | * @since 0.6.3 |
229 | | - * |
230 | | - * @param string $featureName. |
231 | | - * |
232 | | - * @return mixed String or false |
233 | 219 | */ |
234 | | - public function getFeature( $featureName ) { |
235 | | - return array_key_exists( $featureName, $this->features ) ? $this->features[$featureName] : false; |
| 220 | + public function hasAlias( $alias ) { |
| 221 | + return in_array( $alias, $this->aliases ); |
236 | 222 | } |
237 | 223 | |
238 | 224 | /** |
239 | | - * Returns a list of aliases. |
| 225 | + * Returns a list of html fragments, such as script includes, the current service depends on. |
240 | 226 | * |
241 | 227 | * @since 0.6.3 |
242 | 228 | * |
243 | 229 | * @return array |
244 | 230 | */ |
245 | | - public function getAliases() { |
246 | | - return $this->aliases; |
| 231 | + protected function getDependencies() { |
| 232 | + return array(); |
247 | 233 | } |
248 | 234 | |
249 | 235 | /** |
250 | | - * Returns if the service has a certain alias or not. |
| 236 | + * Initializes the service parameters. |
251 | 237 | * |
| 238 | + * You can override this method to set service specific parameters in the inheriting class. |
| 239 | + * |
252 | 240 | * @since 0.6.3 |
253 | 241 | * |
254 | | - * @param string $alias |
255 | | - * |
256 | | - * @return boolean |
257 | | - */ |
258 | | - public function hasAlias( $alias ) { |
259 | | - return in_array( $alias, $this->aliases ); |
260 | | - } |
| 242 | + * @param array $parameters |
| 243 | + */ |
| 244 | + protected function initParameterInfo( array &$parameters ) { |
| 245 | + } |
261 | 246 | |
262 | 247 | } |
\ No newline at end of file |
Index: trunk/extensions/Maps/Services/iMappingService.php |
— | — | @@ -21,6 +21,15 @@ |
22 | 22 | interface iMappingService { |
23 | 23 | |
24 | 24 | /** |
| 25 | + * Returns the internal name of the service. |
| 26 | + * |
| 27 | + * @since 0.6.5 |
| 28 | + * |
| 29 | + * @return string |
| 30 | + */ |
| 31 | + function getName(); |
| 32 | + |
| 33 | + /** |
25 | 34 | * Adds the dependencies to the parser output as head items. |
26 | 35 | * |
27 | 36 | * @since 0.6.3 |
— | — | @@ -40,6 +49,47 @@ |
41 | 50 | function getParameterInfo(); |
42 | 51 | |
43 | 52 | /** |
| 53 | + * Adds a dependency that is needed for this service. It will be passed along with the next |
| 54 | + * call to getDependencyHtml or addDependencies. |
| 55 | + * |
| 56 | + * @since 0.6.5 |
| 57 | + * |
| 58 | + * @param string $dependencyHtml |
| 59 | + */ |
| 60 | + function addDependency( $dependencyHtml ); |
| 61 | + |
| 62 | + /** |
| 63 | + * Returns the name of the class that handles the provided feature in this service, or false if there is none. |
| 64 | + * |
| 65 | + * @since 0.6.5 |
| 66 | + * |
| 67 | + * @param string $featureName. |
| 68 | + * |
| 69 | + * @return mixed String or false |
| 70 | + */ |
| 71 | + function getFeature( $featureName ); |
| 72 | + |
| 73 | + /** |
| 74 | + * Returns a list of aliases. |
| 75 | + * |
| 76 | + * @since 0.6.5 |
| 77 | + * |
| 78 | + * @return array |
| 79 | + */ |
| 80 | + function getAliases(); |
| 81 | + |
| 82 | + /** |
| 83 | + * Returns if the service has a certain alias or not. |
| 84 | + * |
| 85 | + * @since 0.6.5 |
| 86 | + * |
| 87 | + * @param string $alias |
| 88 | + * |
| 89 | + * @return boolean |
| 90 | + */ |
| 91 | + function hasAlias( $alias ); |
| 92 | + |
| 93 | + /** |
44 | 94 | * Returns the default zoomlevel for the mapping service. |
45 | 95 | * |
46 | 96 | * @since 0.6.5 |
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.6.5 a5' ); |
| 37 | + define( 'Maps_VERSION', '0.6.5 a6' ); |
38 | 38 | |
39 | 39 | // The different coordinate notations. |
40 | 40 | define( 'Maps_COORDS_FLOAT', 'float' ); |
Index: trunk/extensions/Maps/Features/iMappingFeature.php |
— | — | @@ -21,6 +21,7 @@ |
22 | 22 | * @author Jeroen De Dauw |
23 | 23 | */ |
24 | 24 | interface iMappingFeature { |
| 25 | + |
25 | 26 | /** |
26 | 27 | * Adds the HTML specific to the mapping service to the output. |
27 | 28 | * |
— | — | @@ -39,4 +40,5 @@ |
40 | 41 | * @return array |
41 | 42 | */ |
42 | 43 | function getSpecificParameterInfo(); |
| 44 | + |
43 | 45 | } |
\ No newline at end of file |