r59681 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r59680‎ | r59681 | r59682 >
Date:21:22, 2 December 2009
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Modified paths:
  • /trunk/extensions/Maps/Maps.php (modified) (history)
  • /trunk/extensions/Maps/Maps_Mapper.php (modified) (history)
  • /trunk/extensions/Maps/OpenStreetMap/Maps_OSM.php (modified) (history)
  • /trunk/extensions/Maps/OpenStreetMap/Maps_OSMDispMap.php (modified) (history)
  • /trunk/extensions/Maps/OpenStreetMap/Maps_OSMDispPoint.php (modified) (history)
  • /trunk/extensions/Maps/OpenStreetMap/OSMFunctions.js (modified) (history)
  • /trunk/extensions/Maps/ParserFunctions/Maps_ParserFunctions.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Maps/ParserFunctions/Maps_ParserFunctions.php
@@ -63,7 +63,7 @@
6464 'in_array' => $egMapsAvailableServices
6565 ),
6666 'default' => $egMapsDefaultService
67 - ),
 67+ ),
6868 'coordinates' => array(
6969 'aliases' => array('coords', 'location', 'locations'),
7070 'criteria' => array(
Index: trunk/extensions/Maps/Maps.php
@@ -28,7 +28,7 @@
2929 include_once('extensions/Validator/Validator.php');
3030 }
3131
32 -define('Maps_VERSION', '0.5 a12');
 32+define('Maps_VERSION', '0.5 a13');
3333
3434 $egMapsScriptPath = $wgScriptPath . '/extensions/Maps';
3535 $egMapsIP = $IP . '/extensions/Maps';
Index: trunk/extensions/Maps/OpenStreetMap/Maps_OSMDispMap.php
@@ -54,7 +54,7 @@
5555 <script type='$wgJsMimeType'>slippymaps['$this->mapName'] = new slippymap_map('$this->mapName', {
5656 mode: 'osm-wm',
5757 layer: 'osm-like',
58 - locale: 'en',
 58+ locale: '$this->lang',
5959 lat: $this->centre_lat,
6060 lon: $this->centre_lon,
6161 zoom: $this->zoom,
Index: trunk/extensions/Maps/OpenStreetMap/OSMFunctions.js
@@ -176,6 +176,7 @@
177177 return map;
178178 }
179179
 180+/*
180181 slippymap_map.prototype.resetPosition = function() {
181182 this.map.setCenter(new OpenLayers.LonLat(this.lon, this.lat).transform(new OpenLayers.Projection('EPSG:4326'), this.map.getProjectionObject()), this.zoom);
182183 }
@@ -190,6 +191,7 @@
191192 "<slippymap lat=" + LL.lat + " lon=" + LL.lon + " zoom=" + Z + " width=" + size.w + " height=" + size.h + " mode=" + this.mode + " layer=" + this.layer + (this.marker == 0 ? "" : " marker=" + this.marker) + " />"
192193 );
193194 }
 195+*/
194196
195197 function getOSMMarkerData(lon, lat, title, label, icon) {
196198 lonLat = new OpenLayers.LonLat(lon, lat);
@@ -201,6 +203,7 @@
202204 };
203205 }
204206
 207+
205208 function getOSMMarker(markerLayer, markerData, projectionObject) {
206209 var marker;
207210
Index: trunk/extensions/Maps/OpenStreetMap/Maps_OSM.php
@@ -47,17 +47,25 @@
4848 }
4949
5050 private static function initializeParams() {
 51+ global $wgLang;
5152 global $egMapsServices, $egMapsOSMZoom, $egMapsOSMControls;
5253
5354 $egMapsServices[self::SERVICE_NAME]['parameters'] = array(
54 - 'zoom' => array(
55 - 'default' => $egMapsOSMZoom,
56 - ),
57 - 'controls' => array(
58 - 'criteria' => array(), // TODO
59 - 'default' => implode(',', $egMapsOSMControls)
60 - ),
61 - );
 55+ 'zoom' => array(
 56+ 'default' => $egMapsOSMZoom,
 57+ ),
 58+ 'controls' => array(
 59+ 'criteria' => array(), // TODO
 60+ 'default' => implode(',', $egMapsOSMControls)
 61+ ),
 62+ 'lang' => array(
 63+ 'aliases' => array('locale', 'language'),
 64+ 'criteria' => array(
 65+ 'in_array' => array_keys( Language::getLanguageNames( false ) )
 66+ ),
 67+ 'default' => $wgLang->getCode()
 68+ ),
 69+ );
6270 }
6371
6472 // TODO: create a modular system for this SlippyMap code
Index: trunk/extensions/Maps/OpenStreetMap/Maps_OSMDispPoint.php
@@ -67,7 +67,7 @@
6868 <script type='$wgJsMimeType'>slippymaps['$this->mapName'] = new slippymap_map('$this->mapName', {
6969 mode: 'osm-wm',
7070 layer: 'osm-like',
71 - locale: 'en',
 71+ locale: '$this->lang',
7272 lat: $this->centre_lat,
7373 lon: $this->centre_lon,
7474 zoom: $this->zoom,
@@ -75,7 +75,6 @@
7676 height: $this->height,
7777 markers: [$this->markerString],
7878 controls: [$controlItems]
79 -
8079 });</script>
8180
8281 <!-- map div -->
Index: trunk/extensions/Maps/Maps_Mapper.php
@@ -22,13 +22,13 @@
2323 * @var array
2424 */
2525 private static $mainParams;
26 -
 26+
2727 public static function initializeMainParams() {
2828 global $egMapsAvailableServices, $egMapsDefaultService, $egMapsAvailableGeoServices, $egMapsDefaultGeoService, $egMapsDefaultCentre;
2929 global $egMapsSizeRestrictions, $egMapsMapWidth, $egMapsMapHeight, $egMapsDefaultTitle, $egMapsDefaultLabel;
30 -
 30+
3131 self::$mainParams = array
32 - (
 32+ (
3333 'zoom' => array(
3434 'aliases' => array(),
3535 'criteria' => array(
@@ -50,22 +50,15 @@
5151 'is_numeric' => array(),
5252 'in_range' => $egMapsSizeRestrictions['height']
5353 ),
54 - 'default' => $egMapsMapHeight
 54+ 'default' => $egMapsMapHeight
5555 ),
5656 'controls' => array(
5757 'aliases' => array(),
5858 'criteria' => array(),
59 - ),
60 - 'lang' => array(
61 - 'aliases' => array('locale', 'language'),
62 - 'criteria' => array(
63 - 'not_empty' => array()
64 - ),
65 - 'default' => ''
66 - ),
 59+ ),
6760 );
68 - }
69 -
 61+ }
 62+
7063 /**
7164 * Returns the main parameters array.
7265 *

Status & tagging log