r58878 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r58877‎ | r58878 | r58879 >
Date:21:18, 10 November 2009
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Modified paths:
  • /tags/extensions/SemanticMaps/REL_0_4_1 (added) (history)
  • /tags/extensions/SemanticMaps/REL_0_4_1/COPYING (added) (history)
  • /tags/extensions/SemanticMaps/REL_0_4_1/FormInputs (added) (history)
  • /tags/extensions/SemanticMaps/REL_0_4_1/FormInputs/SM_FormInput.php (added) (history)
  • /tags/extensions/SemanticMaps/REL_0_4_1/FormInputs/SM_FormInputFactory.php (added) (history)
  • /tags/extensions/SemanticMaps/REL_0_4_1/FormInputs/SM_FormInputs.php (added) (history)
  • /tags/extensions/SemanticMaps/REL_0_4_1/GoogleMaps (added) (history)
  • /tags/extensions/SemanticMaps/REL_0_4_1/GoogleMaps/SM_GoogleMaps.php (added) (history)
  • /tags/extensions/SemanticMaps/REL_0_4_1/GoogleMaps/SM_GoogleMapsFormInput.php (added) (history)
  • /tags/extensions/SemanticMaps/REL_0_4_1/GoogleMaps/SM_GoogleMapsFunctions.js (added) (history)
  • /tags/extensions/SemanticMaps/REL_0_4_1/GoogleMaps/SM_GoogleMapsQP.php (added) (history)
  • /tags/extensions/SemanticMaps/REL_0_4_1/INSTALL (added) (history)
  • /tags/extensions/SemanticMaps/REL_0_4_1/OpenLayers (added) (history)
  • /tags/extensions/SemanticMaps/REL_0_4_1/OpenLayers/SM_OpenLayers.php (added) (history)
  • /tags/extensions/SemanticMaps/REL_0_4_1/OpenLayers/SM_OpenLayersFormInput.php (added) (history)
  • /tags/extensions/SemanticMaps/REL_0_4_1/OpenLayers/SM_OpenLayersFunctions.js (added) (history)
  • /tags/extensions/SemanticMaps/REL_0_4_1/OpenLayers/SM_OpenLayersQP.php (added) (history)
  • /tags/extensions/SemanticMaps/REL_0_4_1/OpenStreetMap (added) (history)
  • /tags/extensions/SemanticMaps/REL_0_4_1/OpenStreetMap/SM_OSM.php (added) (history)
  • /tags/extensions/SemanticMaps/REL_0_4_1/QueryPrinters (added) (history)
  • /tags/extensions/SemanticMaps/REL_0_4_1/QueryPrinters/SM_MapPrinter.php (added) (history)
  • /tags/extensions/SemanticMaps/REL_0_4_1/QueryPrinters/SM_Mapper.php (added) (history)
  • /tags/extensions/SemanticMaps/REL_0_4_1/QueryPrinters/SM_QueryPrinters.php (added) (history)
  • /tags/extensions/SemanticMaps/REL_0_4_1/README (added) (history)
  • /tags/extensions/SemanticMaps/REL_0_4_1/RELEASE-NOTES (added) (history)
  • /tags/extensions/SemanticMaps/REL_0_4_1/SM_Settings.php (added) (history)
  • /tags/extensions/SemanticMaps/REL_0_4_1/SemanticMaps.i18n.php (added) (history)
  • /tags/extensions/SemanticMaps/REL_0_4_1/SemanticMaps.php (added) (history)
  • /tags/extensions/SemanticMaps/REL_0_4_1/YahooMaps (added) (history)
  • /tags/extensions/SemanticMaps/REL_0_4_1/YahooMaps/SM_YahooMaps.php (added) (history)
  • /tags/extensions/SemanticMaps/REL_0_4_1/YahooMaps/SM_YahooMapsFormInput.php (added) (history)
  • /tags/extensions/SemanticMaps/REL_0_4_1/YahooMaps/SM_YahooMapsFunctions.js (added) (history)
  • /tags/extensions/SemanticMaps/REL_0_4_1/YahooMaps/SM_YahooMapsQP.php (added) (history)

Diff [purge]

Index: tags/extensions/SemanticMaps/REL_0_4_1/YahooMaps/SM_YahooMapsFunctions.js
@@ -0,0 +1,54 @@
 2+ /**
 3+ * Javascript functions for Yahoo! Maps functionallity in Semantic Maps
 4+ *
 5+ * @file SM_YahooMapsFunctions.js
 6+ * @ingroup SMYahooMaps
 7+ *
 8+ * @author Jeroen De Dauw
 9+ */
 10+
 11+/**
 12+ * This function holds spesific functionallity for the Yahoo! Maps form input of Semantic Maps
 13+ * TODO: Refactor as much code as possible to non specific functions
 14+ */
 15+function makeFormInputYahooMap(mapName, locationFieldName, lat, lon, zoom, type, types, controls, scrollWheelZoom, marker_lat, marker_lon) {
 16+ var map = createYahooMap(document.getElementById(mapName), new YGeoPoint(lat, lon), zoom, type, types, controls, scrollWheelZoom, [getYMarkerData(marker_lat, marker_lon, '', '', '')]);
 17+
 18+ // Show a starting marker only if marker coordinates are provided
 19+ if (marker_lat != null && marker_lon != null) {
 20+ map.addOverlay(createYMarker(new YGeoPoint(marker_lat, marker_lon)));
 21+ }
 22+
 23+ // Click event handler for updating the location of the marker
 24+ YEvent.Capture(map, EventsList.MouseClick,
 25+ function(_e, point) {
 26+ var loc = new YGeoPoint(point.Lat, point.Lon)
 27+ map.removeMarkersAll();
 28+ document.getElementById(locationFieldName).value = convertLatToDMS(point.Lat)+', '+convertLngToDMS(point.Lon);
 29+ map.addMarker(loc);
 30+ map.panToLatLon(loc);
 31+ }
 32+ );
 33+
 34+ // Make the map variable available for other functions
 35+ if (!window.YMaps) window.YMaps = new Object;
 36+ eval("window.YMaps." + mapName + " = map;");
 37+}
 38+
 39+/**
 40+ * This function holds spesific functionallity for the Yahoo! Maps form input of Semantic Maps
 41+ * TODO: Refactor as much code as possible to non specific functions
 42+ */
 43+function showYAddress(address, mapName, outputElementName, notFoundFormat) {
 44+ var map = YMaps[mapName];
 45+
 46+ map.removeMarkersAll();
 47+ map.drawZoomAndCenter(address);
 48+
 49+ YEvent.Capture(map, EventsList.onEndGeoCode,
 50+ function(resultObj) {
 51+ map.addOverlay(new YMarker(resultObj.GeoPoint));
 52+ document.getElementById(outputElementName).value = convertLatToDMS(resultObj.GeoPoint.Lat) + ', ' + convertLngToDMS(resultObj.GeoPoint.Lon);
 53+ }
 54+ );
 55+}
\ No newline at end of file
Index: tags/extensions/SemanticMaps/REL_0_4_1/YahooMaps/SM_YahooMaps.php
@@ -0,0 +1,24 @@
 2+<?php
 3+
 4+/**
 5+ * This groupe contains all Yahoo! Maps related files of the Semantic Maps extension.
 6+ *
 7+ * @defgroup SMYahooMaps Yahoo! Maps
 8+ * @ingroup SemanticMaps
 9+ */
 10+
 11+/**
 12+ * This file holds the general information for the Yahoo! Maps service.
 13+ *
 14+ * @file SM_YahooMaps.php
 15+ * @ingroup SMYahooMaps
 16+ *
 17+ * @author Jeroen De Dauw
 18+ */
 19+
 20+if( !defined( 'MEDIAWIKI' ) ) {
 21+ die( 'Not an entry point.' );
 22+}
 23+
 24+$egMapsServices['yahoomaps']['qp'] = array('class' => 'SMYahooMapsQP', 'file' => 'SemanticMaps/YahooMaps/SM_YahooMapsQP.php', 'local' => false);
 25+$egMapsServices['yahoomaps']['fi'] = array('class' => 'SMYahooMapsFormInput', 'file' => 'SemanticMaps/YahooMaps/SM_YahooMapsFormInput.php', 'local' => false);
\ No newline at end of file
Index: tags/extensions/SemanticMaps/REL_0_4_1/YahooMaps/SM_YahooMapsQP.php
@@ -0,0 +1,87 @@
 2+<?php
 3+/**
 4+ * A query printer for maps using the Yahoo Maps API
 5+ *
 6+ * @file SM_YahooMaps.php
 7+ * @ingroup SMYahooMaps
 8+ *
 9+ * @author Jeroen De Dauw
 10+ */
 11+
 12+if( !defined( 'MEDIAWIKI' ) ) {
 13+ die( 'Not an entry point.' );
 14+}
 15+
 16+final class SMYahooMapsQP extends SMMapPrinter {
 17+
 18+ public $serviceName = MapsYahooMapsUtils::SERVICE_NAME;
 19+
 20+ /**
 21+ * @see SMMapPrinter::setQueryPrinterSettings()
 22+ *
 23+ */
 24+ protected function setQueryPrinterSettings() {
 25+ global $egMapsYahooMapsZoom, $egMapsYahooMapsPrefix;
 26+
 27+ $this->elementNamePrefix = $egMapsYahooMapsPrefix;
 28+
 29+ $this->defaultZoom = $egMapsYahooMapsZoom;
 30+
 31+ $this->defaultParams = MapsYahooMapsUtils::getDefaultParams();
 32+ }
 33+
 34+ /**
 35+ * @see SMMapPrinter::doMapServiceLoad()
 36+ *
 37+ */
 38+ protected function doMapServiceLoad() {
 39+ global $egYahooMapsOnThisPage;
 40+
 41+ MapsYahooMapsUtils::addYMapDependencies($this->output);
 42+ $egYahooMapsOnThisPage++;
 43+
 44+ $this->elementNr = $egYahooMapsOnThisPage;
 45+ }
 46+
 47+ /**
 48+ * @see SMMapPrinter::addSpecificMapHTML()
 49+ *
 50+ */
 51+ protected function addSpecificMapHTML() {
 52+ global $wgJsMimeType;
 53+
 54+ $this->type = MapsYahooMapsUtils::getYMapType($this->type, true);
 55+ $this->controls = MapsYahooMapsUtils::createControlsString($this->controls);
 56+
 57+ $this->autozoom = MapsYahooMapsUtils::getAutozoomJSValue($this->autozoom);
 58+
 59+ $markerItems = array();
 60+
 61+ foreach ($this->m_locations as $location) {
 62+ // Create a string containing the marker JS
 63+ list($lat, $lon, $title, $label, $icon) = $location;
 64+
 65+ $title = str_replace("'", "\'", $title);
 66+ $label = str_replace("'", "\'", $label);
 67+
 68+ $markerItems[] = "getYMarkerData($lat, $lon, '$title', '$label', '$icon')";
 69+ }
 70+
 71+ $markersString = implode(',', $markerItems);
 72+
 73+ $this->types = explode(",", $this->types);
 74+
 75+ $typesString = MapsYahooMapsUtils::createTypesString($this->types);
 76+
 77+ $this->output .= "
 78+ <div id='$this->mapName' style='width: {$this->width}px; height: {$this->height}px;'></div>
 79+
 80+ <script type='$wgJsMimeType'>/*<![CDATA[*/
 81+ addOnloadHook(
 82+ initializeYahooMap('$this->mapName', $this->centre_lat, $this->centre_lon, $this->zoom, $this->type, [$typesString], [$this->controls], $this->autozoom, [$markersString])
 83+ );
 84+ /*]]>*/</script>";
 85+
 86+ }
 87+
 88+}
\ No newline at end of file
Index: tags/extensions/SemanticMaps/REL_0_4_1/YahooMaps/SM_YahooMapsFormInput.php
@@ -0,0 +1,103 @@
 2+<?php
 3+
 4+/**
 5+* Form input hook that adds an Yahoo! Maps map format to Semantic Forms
 6+ *
 7+ * @file SM_YahooMapsFormInput.php
 8+ * @ingroup SMYahooMaps
 9+ *
 10+ * @author Jeroen De Dauw
 11+ */
 12+
 13+if( !defined( 'MEDIAWIKI' ) ) {
 14+ die( 'Not an entry point.' );
 15+}
 16+
 17+final class SMYahooMapsFormInput extends SMFormInput {
 18+
 19+ public $serviceName = MapsYahooMapsUtils::SERVICE_NAME;
 20+
 21+ /**
 22+ * @see MapsMapFeature::setMapSettings()
 23+ *
 24+ */
 25+ protected function setMapSettings() {
 26+ global $egMapsYahooMapsZoom, $egMapsYahooMapsPrefix;
 27+
 28+ $this->elementNamePrefix = $egMapsYahooMapsPrefix;
 29+ $this->showAddresFunction = 'showYAddress';
 30+
 31+ $this->earthZoom = 17;
 32+
 33+ $this->defaultParams = MapsYahooMapsUtils::getDefaultParams();
 34+ $this->defaultZoom = $egMapsYahooMapsZoom;
 35+ }
 36+
 37+ /**
 38+ * @see MapsMapFeature::addFormDependencies()
 39+ *
 40+ */
 41+ protected function addFormDependencies() {
 42+ global $wgJsMimeType;
 43+ global $smgScriptPath, $smgYahooFormsOnThisPage;
 44+
 45+ MapsYahooMapsUtils::addYMapDependencies($this->output);
 46+
 47+ if (empty($smgYahooFormsOnThisPage)) {
 48+ $smgYahooFormsOnThisPage = 0;
 49+ $this->output .= "<script type='$wgJsMimeType' src='$smgScriptPath/YahooMaps/SM_YahooMapsFunctions.js'></script>";
 50+ }
 51+ }
 52+
 53+ /**
 54+ * @see MapsMapFeature::doMapServiceLoad()
 55+ *
 56+ */
 57+ protected function doMapServiceLoad() {
 58+ global $egYahooMapsOnThisPage, $smgYahooFormsOnThisPage;
 59+
 60+ self::addFormDependencies();
 61+
 62+ $egYahooMapsOnThisPage++;
 63+ $smgYahooFormsOnThisPage++;
 64+
 65+ $this->elementNr = $egYahooMapsOnThisPage;
 66+ }
 67+
 68+ /**
 69+ * @see MapsMapFeature::addSpecificMapHTML()
 70+ *
 71+ */
 72+ protected function addSpecificMapHTML() {
 73+ global $wgJsMimeType;
 74+
 75+ $type = MapsYahooMapsUtils::getYMapType($this->type, true);
 76+
 77+ $this->autozoom = MapsYahooMapsUtils::getAutozoomJSValue($this->autozoom);
 78+
 79+ $controlItems = MapsYahooMapsUtils::createControlsString($this->controls);
 80+
 81+ $this->types = explode(",", $this->types);
 82+
 83+ $typesString = MapsYahooMapsUtils::createTypesString($this->types);
 84+
 85+ $this->output .="
 86+ <div id='".$this->mapName."' style='width: {$this->width}px; height: {$this->height}px;'></div>
 87+
 88+ <script type='$wgJsMimeType'>/*<![CDATA[*/
 89+ addOnloadHook(makeFormInputYahooMap('$this->mapName', '$this->coordsFieldName', $this->centre_lat, $this->centre_lon, $this->zoom, $type, [$typesString], [$controlItems], $this->autozoom, $this->marker_lat, $this->centre_lon));
 90+ /*]]>*/</script>";
 91+ }
 92+
 93+ /**
 94+ * @see SMFormInput::manageGeocoding()
 95+ *
 96+ */
 97+ protected function manageGeocoding() {
 98+ global $egYahooMapsKey;
 99+ $this->enableGeocoding = strlen(trim($egYahooMapsKey)) > 0;
 100+ if ($this->enableGeocoding) MapsYahooMapsUtils::addYMapDependencies($this->output);
 101+ }
 102+
 103+
 104+}
Index: tags/extensions/SemanticMaps/REL_0_4_1/OpenLayers/SM_OpenLayersFunctions.js
@@ -0,0 +1,118 @@
 2+ /**
 3+ * Javascript functions for OpenLayers functionallity in Semantic Maps
 4+ *
 5+ * @file SM_OpenLayersFunctions.js
 6+ * @ingroup SMOpenLayers
 7+ *
 8+ * @author Jeroen De Dauw
 9+ */
 10+
 11+/**
 12+ * This function holds spesific functionallity for the Open Layers form input of Semantic Maps
 13+ * TODO: Refactor as much code as possible to non specific functions
 14+ */
 15+function makeFormInputOpenLayer(mapName, locationFieldName, lat, lon, zoom, marker_lat, marker_lon, layers, controls, height) {
 16+ var markers = Array();
 17+
 18+ // Show a starting marker only if marker coordinates are provided
 19+ if (marker_lat != null && marker_lon != null) {
 20+ markers.push(getOLMarkerData(marker_lon, marker_lat, '', ''));
 21+ }
 22+
 23+ // Click event handler for updating the location of the marker
 24+ // TODO / FIXME: This will probably cause problems when used for multiple maps on one page.
 25+ OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, {
 26+ defaultHandlerOptions: {
 27+ 'single': true,
 28+ 'double': false,
 29+ 'pixelTolerance': 0,
 30+ 'stopSingle': false,
 31+ 'stopDouble': false
 32+ },
 33+
 34+ initialize: function(options) {
 35+ this.handlerOptions = OpenLayers.Util.extend(
 36+ {}, this.defaultHandlerOptions
 37+ );
 38+ OpenLayers.Control.prototype.initialize.apply(
 39+ this, arguments
 40+ );
 41+ this.handler = new OpenLayers.Handler.Click(
 42+ this, {
 43+ 'click': this.trigger
 44+ }, this.handlerOptions
 45+ );
 46+ },
 47+
 48+ trigger: function(e) {
 49+ replaceMarker(mapName, map.getLonLatFromViewPortPx(e.xy));
 50+ document.getElementById(locationFieldName).value = convertLatToDMS(map.getLonLatFromViewPortPx(e.xy).lat)+', '+convertLngToDMS(map.getLonLatFromViewPortPx(e.xy).lon);
 51+ }
 52+
 53+ });
 54+
 55+ var clickHanler = new OpenLayers.Control.Click();
 56+ controls.push(clickHanler);
 57+
 58+ var map = initOpenLayer(mapName, lon, lat, zoom, layers, controls, markers, height);
 59+
 60+ // Make the map variable available for other functions
 61+ if (!window.OLMaps) window.OLMaps = new Object;
 62+ eval("window.OLMaps." + mapName + " = map;");
 63+}
 64+
 65+
 66+/**
 67+ * This function holds spesific functionallity for the Open Layers form input of Semantic Maps
 68+ * TODO: Refactor as much code as possible to non specific functions
 69+ */
 70+function showOLAddress(address, mapName, outputElementName, notFoundFormat) {
 71+
 72+ var map = OLMaps[mapName];
 73+ var geocoder = new GClientGeocoder();
 74+
 75+ geocoder.getLatLng(address,
 76+ function(point) {
 77+ if (!point) {
 78+ window.alert(address + ' ' + notFoundFormat);
 79+ } else {
 80+ var loc = new OpenLayers.LonLat(point.x, point.y);
 81+
 82+ replaceMarker(mapName, loc);
 83+ document.getElementById(outputElementName).value = convertLatToDMS(point.y) + ', ' + convertLngToDMS(point.x);
 84+ }
 85+ }
 86+ );
 87+
 88+}
 89+
 90+/**
 91+ * Remove all markers from an OL map (that's in window.OLMaps), and pplace a new one.
 92+ *
 93+ * @param mapName Name of the map as in OLMaps[mapName].
 94+ * @param newLocation The location for the new marker.
 95+ * @return
 96+ */
 97+function replaceMarker(mapName, newLocation) {
 98+ var map = OLMaps[mapName];
 99+ var markerLayer = map.getLayer('markerLayer');
 100+
 101+ removeMarkers(markerLayer);
 102+ markerLayer.addMarker(getOLMarker(markerLayer, getOLMarkerData(newLocation.lon, newLocation.lat, '', ''), map.getProjectionObject()));
 103+
 104+ map.panTo(newLocation);
 105+}
 106+
 107+/**
 108+ * Removes all markers from a marker layer.
 109+ *
 110+ * @param markerLayer The layer to remove all markers from.
 111+ * @return
 112+ */
 113+function removeMarkers(markerLayer) {
 114+ var markerCollection = markerLayer.markers;
 115+
 116+ for (i in markerCollection) {
 117+ markerLayer.removeMarker(markerCollection[i]);
 118+ }
 119+}
\ No newline at end of file
Index: tags/extensions/SemanticMaps/REL_0_4_1/OpenLayers/SM_OpenLayers.php
@@ -0,0 +1,24 @@
 2+<?php
 3+
 4+/**
 5+ * This groupe contains all OpenLayers related files of the Semantic Maps extension.
 6+ *
 7+ * @defgroup SMOpenLayers OpenLayers
 8+ * @ingroup SemanticMaps
 9+ */
 10+
 11+/**
 12+ * This file holds the general information for the OpenLayers service.
 13+ *
 14+ * @file SM_OpenLayers.php
 15+ * @ingroup SMOpenLayers
 16+ *
 17+ * @author Jeroen De Dauw
 18+ */
 19+
 20+if( !defined( 'MEDIAWIKI' ) ) {
 21+ die( 'Not an entry point.' );
 22+}
 23+
 24+$egMapsServices['openlayers']['qp'] = array('class' => 'SMOpenLayersQP', 'file' => 'SemanticMaps/OpenLayers/SM_OpenLayersQP.php', 'local' => false);
 25+$egMapsServices['openlayers']['fi'] = array('class' => 'SMOpenLayersFormInput', 'file' => 'SemanticMaps/OpenLayers/SM_OpenLayersFormInput.php', 'local' => false);
\ No newline at end of file
Index: tags/extensions/SemanticMaps/REL_0_4_1/OpenLayers/SM_OpenLayersQP.php
@@ -0,0 +1,80 @@
 2+<?php
 3+
 4+/**
 5+ * A query printer for maps using the Open Layers API
 6+ *
 7+ * @file SM_OpenLayers.php
 8+ * @ingroup SMOpenLayers
 9+ *
 10+ * @author Jeroen De Dauw
 11+ */
 12+
 13+if( !defined( 'MEDIAWIKI' ) ) {
 14+ die( 'Not an entry point.' );
 15+}
 16+
 17+final class SMOpenLayersQP extends SMMapPrinter {
 18+
 19+ public $serviceName = MapsOpenLayersUtils::SERVICE_NAME;
 20+
 21+ /**
 22+ * @see SMMapPrinter::setQueryPrinterSettings()
 23+ *
 24+ */
 25+ protected function setQueryPrinterSettings() {
 26+ global $egMapsOpenLayersZoom, $egMapsOpenLayersPrefix;
 27+
 28+ $this->elementNamePrefix = $egMapsOpenLayersPrefix;
 29+ $this->defaultZoom = $egMapsOpenLayersZoom;
 30+
 31+ $this->defaultParams = MapsOpenLayersUtils::getDefaultParams();
 32+ }
 33+
 34+ /**
 35+ * @see SMMapPrinter::doMapServiceLoad()
 36+ *
 37+ */
 38+ protected function doMapServiceLoad() {
 39+ global $egOpenLayersOnThisPage;
 40+
 41+ MapsOpenLayersUtils::addOLDependencies($this->output);
 42+ $egOpenLayersOnThisPage++;
 43+
 44+ $this->elementNr = $egOpenLayersOnThisPage;
 45+ }
 46+
 47+ /**
 48+ * @see SMMapPrinter::addSpecificMapHTML()
 49+ *
 50+ */
 51+ protected function addSpecificMapHTML() {
 52+ global $wgJsMimeType;
 53+
 54+ $controlItems = MapsOpenLayersUtils::createControlsString($this->controls);
 55+
 56+ MapsMapper::enforceArrayValues($this->layers);
 57+ $layerItems = MapsOpenLayersUtils::createLayersStringAndLoadDependencies($this->output, $this->layers);
 58+
 59+ $markerItems = array();
 60+
 61+ foreach ($this->m_locations as $location) {
 62+ // Create a string containing the marker JS
 63+ list($lat, $lon, $title, $label, $icon) = $location;
 64+
 65+ $title = str_replace("'", "\'", $title);
 66+ $label = str_replace("'", "\'", $label);
 67+
 68+ $markerItems[] = "getOLMarkerData($lon, $lat, '$title', '$label', '$icon')";
 69+ }
 70+
 71+ $markersString = implode(',', $markerItems);
 72+
 73+ $this->output .= "<div id='$this->mapName' style='width: {$this->width}px; height: {$this->height}px; background-color: #cccccc;'></div>
 74+ <script type='$wgJsMimeType'> /*<![CDATA[*/
 75+ addOnloadHook(
 76+ initOpenLayer('$this->mapName', $this->centre_lon, $this->centre_lat, $this->zoom, [$layerItems], [$controlItems], [$markersString], $this->height)
 77+ );
 78+ /*]]>*/ </script>";
 79+ }
 80+
 81+}
Index: tags/extensions/SemanticMaps/REL_0_4_1/OpenLayers/SM_OpenLayersFormInput.php
@@ -0,0 +1,94 @@
 2+<?php
 3+
 4+/**
 5+ * Form input hook that adds an Open Layers map format to Semantic Forms
 6+ *
 7+ * @file SM_OpenLayersFormInput.php
 8+ * @ingroup SMOpenLayers
 9+ *
 10+ * @author Jeroen De Dauw
 11+ */
 12+
 13+if( !defined( 'MEDIAWIKI' ) ) {
 14+ die( 'Not an entry point.' );
 15+}
 16+
 17+final class SMOpenLayersFormInput extends SMFormInput {
 18+
 19+ public $serviceName = MapsOpenLayersUtils::SERVICE_NAME;
 20+
 21+ /**
 22+ * @see MapsMapFeature::setMapSettings()
 23+ *
 24+ */
 25+ protected function setMapSettings() {
 26+ global $egMapsOpenLayersZoom, $egMapsOpenLayersPrefix;
 27+
 28+ $this->elementNamePrefix = $egMapsOpenLayersPrefix;
 29+ $this->showAddresFunction = 'showOLAddress';
 30+
 31+ $this->earthZoom = 1;
 32+
 33+ $this->defaultParams = MapsOpenLayersUtils::getDefaultParams();
 34+ $this->defaultZoom = $egMapsOpenLayersZoom;
 35+ }
 36+
 37+ /**
 38+ * @see MapsMapFeature::addFormDependencies()
 39+ *
 40+ */
 41+ protected function addFormDependencies() {
 42+ global $wgJsMimeType;
 43+ global $smgScriptPath, $smgOLFormsOnThisPage;
 44+
 45+ MapsOpenLayersUtils::addOLDependencies($this->output);
 46+
 47+ if (empty($smgOLFormsOnThisPage)) {
 48+ $smgOLFormsOnThisPage = 0;
 49+ $this->output .= "<script type='$wgJsMimeType' src='$smgScriptPath/OpenLayers/SM_OpenLayersFunctions.js'></script>";
 50+ }
 51+ }
 52+
 53+ /**
 54+ * @see MapsMapFeature::doMapServiceLoad()
 55+ *
 56+ */
 57+ protected function doMapServiceLoad() {
 58+ global $egOpenLayersOnThisPage, $smgOLFormsOnThisPage;
 59+
 60+ self::addFormDependencies();
 61+
 62+ $egOpenLayersOnThisPage++;
 63+ $smgOLFormsOnThisPage++;
 64+
 65+ $this->elementNr = $egOpenLayersOnThisPage;
 66+ }
 67+
 68+ /**
 69+ * @see MapsMapFeature::addSpecificMapHTML()
 70+ *
 71+ */
 72+ protected function addSpecificMapHTML() {
 73+ global $wgJsMimeType;
 74+
 75+ $controlItems = MapsOpenLayersUtils::createControlsString($this->controls);
 76+
 77+ $layerItems = MapsOpenLayersUtils::createLayersStringAndLoadDependencies($this->output, $this->layers);
 78+
 79+ $this->output .="
 80+ <div id='".$this->mapName."' style='width: {$this->width}px; height: {$this->height}px; background-color: #cccccc;'></div>
 81+
 82+ <script type='$wgJsMimeType'>/*<![CDATA[*/
 83+ addOnloadHook(makeFormInputOpenLayer('".$this->mapName."', '".$this->coordsFieldName."', ".$this->centre_lat.", ".$this->centre_lon.", ".$this->zoom.", ".$this->marker_lat.", ".$this->marker_lon.", [$layerItems], [$controlItems], $this->height));
 84+ /*]]>*/</script>";
 85+ }
 86+
 87+ /**
 88+ * @see SMFormInput::manageGeocoding()
 89+ *
 90+ */
 91+ protected function manageGeocoding() {
 92+ $this->enableGeocoding = false;
 93+ }
 94+
 95+}
Index: tags/extensions/SemanticMaps/REL_0_4_1/SM_Settings.php
@@ -0,0 +1,55 @@
 2+<?php
 3+
 4+/**
 5+ * File defining the settings for the Semantic Maps extension
 6+ * More info can be found at http://www.mediawiki.org/wiki/Extension:Semantic_Maps#Settings
 7+ *
 8+ * NOTICE:
 9+ * Changing one of these settings can be done by copieng or cutting it,
 10+ * and placing it in LocalSettings.php, AFTER the inclusion of Semantic Maps.
 11+ *
 12+ * @file SM_Settings.php
 13+ * @ingroup SemanticMaps
 14+ *
 15+ * @author Jeroen De Dauw
 16+ */
 17+
 18+if( !defined( 'MEDIAWIKI' ) ) {
 19+ die( 'Not an entry point.' );
 20+}
 21+
 22+
 23+
 24+
 25+# Map features configuration
 26+# (named) Array of String. This array contains the available features for Maps.
 27+# The array element name contains an abbriviation, used for code references,
 28+# and in the service data arrays, the value is the human readible version for displaying purpouses.
 29+$egMapsAvailableFeatures['qp'] = array(
 30+ 'name' => 'Query Printer',
 31+ 'class' => 'SMQueryPrinters',
 32+ 'file' => 'SemanticMaps/QueryPrinters/SM_QueryPrinters.php',
 33+ 'local' => false
 34+ );
 35+
 36+$egMapsAvailableFeatures['fi'] = array(
 37+ 'name' => 'Form input',
 38+ 'class' => 'SMFormInputs',
 39+ 'file' => 'SemanticMaps/FormInputs/SM_FormInputs.php',
 40+ 'local' => false
 41+ );
 42+
 43+
 44+
 45+
 46+
 47+# Mapping services configuration
 48+
 49+# Include the mapping services that should be loaded into Semantic Maps.
 50+# Commenting or removing a mapping service will cause Semantic Maps to completely ignore it, and so improve performance.
 51+include_once $smgIP . '/GoogleMaps/SM_GoogleMaps.php'; // Google Maps
 52+include_once $smgIP . '/OpenLayers/SM_OpenLayers.php'; // OpenLayers
 53+include_once $smgIP . '/YahooMaps/SM_YahooMaps.php'; // Yahoo! Maps
 54+include_once $smgIP . '/OpenStreetMap/SM_OSM.php'; // OpenLayers optimized for OSM
 55+
 56+
Index: tags/extensions/SemanticMaps/REL_0_4_1/FormInputs/SM_FormInputFactory.php
@@ -0,0 +1,61 @@
 2+<?php
 3+
 4+/**
 5+ * Factory method for form input handling classes
 6+ *
 7+ * @file SM_FormInputFactory.php
 8+ * @ingroup SemanticMaps
 9+ *
 10+ * @author Jeroen De Dauw
 11+ */
 12+
 13+if( !defined( 'MEDIAWIKI' ) ) {
 14+ die( 'Not an entry point.' );
 15+}
 16+
 17+class SMFormInputFactory {
 18+
 19+ public static function getFormInputHtml() {
 20+ global $egMapsServices;
 21+
 22+ // If service_name is set, use this value, and ignore any given
 23+ // service parameters
 24+ // This will prevent ..input type=googlemaps|service=yahoo.. from
 25+ // showing up as a Yahoo! Maps map
 26+ if (array_key_exists('service_name', $field_args)) {
 27+ $service_name = $field_args['service_name'];
 28+ }
 29+ elseif (array_key_exists('service', $field_args)) {
 30+ $service_name = $field_args['service'];
 31+ }
 32+ else{
 33+ $service_name = null;
 34+ }
 35+
 36+ $service_name = MapsMapper::getValidService($service_name, 'fi');
 37+
 38+ $formInput = self::getFormInputInstance();
 39+
 40+ // Get and return the form input HTML from the hook corresponding with the provided service
 41+ return $formInput->formInputHTML($coordinates, $input_name, $is_mandatory, $is_disabled, $field_args);
 42+ }
 43+
 44+ private static function getFormInputInstance($serviceName) {
 45+ return new $egMapsServices[$service_name]['fi']['class']();
 46+ }
 47+
 48+}
 49+
 50+/**
 51+ * Class for the form input type 'map'. The relevant form input class is called depending on the provided service.
 52+ *
 53+ * @param unknown_type $coordinates
 54+ * @param unknown_type $input_name
 55+ * @param unknown_type $is_mandatory
 56+ * @param unknown_type $is_disabled
 57+ * @param array $field_args
 58+ * @return unknown
 59+ */
 60+function smfSelectFormInputHTML($coordinates, $input_name, $is_mandatory, $is_disabled, array $field_args) {
 61+
 62+}
\ No newline at end of file
Index: tags/extensions/SemanticMaps/REL_0_4_1/FormInputs/SM_FormInput.php
@@ -0,0 +1,167 @@
 2+<?php
 3+
 4+/**
 5+ * Abstract class that provides the common functionallity for all map form inputs
 6+ *
 7+ * @file SM_FormInput.php
 8+ * @ingroup SemanticMaps
 9+ *
 10+ * @author Jeroen De Dauw
 11+ */
 12+
 13+if( !defined( 'MEDIAWIKI' ) ) {
 14+ die( 'Not an entry point.' );
 15+}
 16+
 17+abstract class SMFormInput extends MapsMapFeature {
 18+
 19+ /**
 20+ * Determine if geocoding will be enabled and load the required dependencies.
 21+ */
 22+ protected abstract function manageGeocoding();
 23+
 24+ /**
 25+ * Ensures all dependencies for the used map are loaded, and increases that map service's count
 26+ */
 27+ protected abstract function addFormDependencies();
 28+
 29+ protected $marker_lat;
 30+ protected $marker_lon;
 31+
 32+ protected $earthZoom;
 33+
 34+ protected $showAddresFunction;
 35+
 36+ protected $enableGeocoding = false;
 37+
 38+ private $startingCoords ='';
 39+
 40+ private $coordinates;
 41+
 42+ /**
 43+ * This function is a hook for Semantic Forms, and returns the HTML needed in
 44+ * the form to handle coordinate data.
 45+ */
 46+ public final function formInputHTML($coordinates, $input_name, $is_mandatory, $is_disabled, $field_args) {
 47+ // TODO: Use function args for sf stuffz
 48+ global $sfgTabIndex;
 49+
 50+ $this->coordinates = $coordinates;
 51+
 52+ $this->manageGeocoding();
 53+
 54+ $this->setMapSettings();
 55+
 56+ $this->doMapServiceLoad();
 57+
 58+ $this->manageMapProperties($field_args, __CLASS__);
 59+
 60+ $this->setCoordinates();
 61+ $this->setCentre();
 62+ $this->setZoom();
 63+
 64+ // Create html element names
 65+ $this->setMapName();
 66+ $this->mapName .= '_'.$sfgTabIndex;
 67+ $this->geocodeFieldName = $this->elementNamePrefix.'_geocode_'.$this->elementNr.'_'.$sfgTabIndex;
 68+ $this->coordsFieldName = $this->elementNamePrefix.'_coords_'.$this->elementNr.'_'.$sfgTabIndex;
 69+ $this->infoFieldName = $this->elementNamePrefix.'_info_'.$this->elementNr.'_'.$sfgTabIndex;
 70+
 71+ // Create the non specific form HTML
 72+ $this->output .= "
 73+ <input id='".$this->coordsFieldName."' name='$input_name' type='text' value='$this->startingCoords' size='40' tabindex='$sfgTabIndex'>
 74+ <span id='".$this->infoFieldName."' class='error_message'></span>";
 75+
 76+ if ($this->enableGeocoding) {
 77+ $sfgTabIndex++;
 78+
 79+ // Retrieve language valuess
 80+ $enter_address_here_text = wfMsg('semanticmaps_enteraddresshere');
 81+ $lookup_coordinates_text = wfMsg('semanticmaps_lookupcoordinates');
 82+ $not_found_text = wfMsg('semanticmaps_notfound');
 83+
 84+ $adress_field = SMFormInput::getDynamicInput($this->geocodeFieldName, $enter_address_here_text, 'size="30" name="geocode" style="color: #707070" tabindex="'.$sfgTabIndex.'"');
 85+ $this->output .= "
 86+ <p>
 87+ $adress_field
 88+ <input type='submit' onClick=\"$this->showAddresFunction(document.forms['createbox'].$this->geocodeFieldName.value, '$this->mapName', '$this->coordsFieldName', '$not_found_text'); return false\" value='$lookup_coordinates_text' />
 89+ </p>";
 90+ }
 91+
 92+ $this->addSpecificMapHTML();
 93+
 94+ return array($this->output, '');
 95+ }
 96+
 97+ /**
 98+ * Sets the zoom so the whole map is visible in case there is no maker yet,
 99+ * and sets it to the default when there is a marker but no zoom parameter.
 100+ */
 101+ private function setZoom() {
 102+ if (empty($this->coordinates)) {
 103+ $this->zoom = $this->earthZoom;
 104+ } else if (strlen($this->zoom) < 1) {
 105+ $this->zoom = $this->defaultZoom;
 106+ }
 107+ }
 108+
 109+ /**
 110+ * Sets the $marler_lon and $marler_lat fields and when set, the starting coordinates
 111+ *
 112+ */
 113+ private function setCoordinates() {
 114+ if (empty($this->coordinates)) {
 115+ // If no coordinates exist yet, no marker should be displayed
 116+ $this->marker_lat = 'null';
 117+ $this->marker_lon = 'null';
 118+ }
 119+ else {
 120+ $marker = MapsUtils::getLatLon($this->coordinates);
 121+ $this->marker_lat = $marker['lat'];
 122+ $this->marker_lon = $marker['lon'];
 123+ $this->startingCoords = MapsUtils::latDecimal2Degree($this->marker_lat) . ', ' . MapsUtils::lonDecimal2Degree($this->marker_lon);
 124+ }
 125+ }
 126+
 127+ /**
 128+ * Sets the $centre_lat and $centre_lon fields.
 129+ * Note: this needs to be done AFTRE the maker coordinates are set.
 130+ *
 131+ */
 132+ private function setCentre() {
 133+ if (empty($this->centre)) {
 134+ if (isset($this->coordinates)) {
 135+ $this->centre_lat = $this->marker_lat;
 136+ $this->centre_lon = $this->marker_lon;
 137+ }
 138+ else {
 139+ $this->centre_lat = '0';
 140+ $this->centre_lon = '0';
 141+ }
 142+ }
 143+ else {
 144+ // Geocode and convert if required.
 145+ $centre = MapsGeocodeUtils::attemptToGeocode($this->centre, $this->geoservice, $this->serviceName);
 146+ $centre = MapsUtils::getLatLon($centre);
 147+
 148+ $this->centre_lat = $centre['lat'];
 149+ $this->centre_lon = $centre['lon'];
 150+ }
 151+ }
 152+
 153+ /**
 154+ * Returns html for an html input field with a default value that will automatically dissapear when
 155+ * the user clicks in it, and reappers when the focus on the field is lost and it's still empty.
 156+ *
 157+ * @author Jeroen De Dauw
 158+ *
 159+ * @param string $id
 160+ * @param string $value
 161+ * @param string $args
 162+ * @return html
 163+ */
 164+ private static function getDynamicInput($id, $value, $args='') {
 165+ return '<input id="'.$id.'" '.$args.' value="'.$value.'" onfocus="if (this.value==\''.$value.'\') {this.value=\'\';}" onblur="if (this.value==\'\') {this.value=\''.$value.'\';}" />';
 166+ }
 167+}
 168+
Index: tags/extensions/SemanticMaps/REL_0_4_1/FormInputs/SM_FormInputs.php
@@ -0,0 +1,110 @@
 2+<?php
 3+
 4+/**
 5+ * Initialization file for form input functionality in the Maps extension
 6+ *
 7+ * @file SM_FormInputs.php
 8+ * @ingroup SemanticMaps
 9+ *
 10+ * @author Jeroen De Dauw
 11+ */
 12+
 13+if( !defined( 'MEDIAWIKI' ) ) {
 14+ die( 'Not an entry point.' );
 15+}
 16+
 17+final class SMFormInputs {
 18+
 19+ public static function initialize() {
 20+ global $smgIP, $wgAutoloadClasses, $egMapsServices, $sfgFormPrinter;
 21+
 22+ $wgAutoloadClasses['SMFormInput'] = $smgIP . '/FormInputs/SM_FormInput.php';
 23+
 24+ // This feature can only be enbled when Semantic Forms is loaded.
 25+ if (isset($sfgFormPrinter)) {
 26+ $hasFormInputs = false;
 27+
 28+ foreach($egMapsServices as $serviceName => $serviceData) {
 29+ // Check if the service has a form input
 30+ $hasFI = array_key_exists('fi', $serviceData);
 31+
 32+ // If the service has no FI, skipt it and continue with the next one.
 33+ if (!$hasFI) continue;
 34+
 35+ // At least one form input will be enabled when this point is reached.
 36+ $hasFormInputs = true;
 37+
 38+ // Add the result form input type for the service name.
 39+ self::initFormHook($serviceName, $serviceData['fi']);
 40+
 41+ // Loop through the service alliases, and add them as form input types.
 42+ foreach ($serviceData['aliases'] as $alias) self::initFormHook($alias, $serviceData['fi'], $serviceName);
 43+ }
 44+
 45+ // Add the 'map' form input type if there are mapping services that have FI's loaded.
 46+ if ($hasFormInputs) self::initFormHook('map');
 47+
 48+ }
 49+
 50+ }
 51+
 52+ /**
 53+ * Adds a mapping service's form hook
 54+ *
 55+ * @param string $service
 56+ * @param array $fi
 57+ * @param strig $mainName
 58+ */
 59+ private static function initFormHook($service, array $fi = null, $mainName = '') {
 60+ global $wgAutoloadClasses, $sfgFormPrinter, $smgIP;
 61+
 62+ if (isset($fi)) {
 63+ if (! array_key_exists($fi['class'], $wgAutoloadClasses)) {
 64+ $file = $fi['local'] ? $smgIP . '/' . $fi['file'] : $fi['file'];
 65+ $wgAutoloadClasses[$fi['class']] = $file;
 66+ }
 67+ }
 68+
 69+ // Add the form input hook for the service
 70+ $field_args = array();
 71+ if (strlen($mainName) > 0) $field_args['service_name'] = $mainName;
 72+ $sfgFormPrinter->setInputTypeHook($service, 'smfSelectFormInputHTML', $field_args);
 73+ }
 74+
 75+}
 76+
 77+/**
 78+ * Class for the form input type 'map'. The relevant form input class is called depending on the provided service.
 79+ *
 80+ * @param unknown_type $coordinates
 81+ * @param unknown_type $input_name
 82+ * @param unknown_type $is_mandatory
 83+ * @param unknown_type $is_disabled
 84+ * @param array $field_args
 85+ * @return unknown
 86+ */
 87+function smfSelectFormInputHTML($coordinates, $input_name, $is_mandatory, $is_disabled, array $field_args) {
 88+ global $egMapsServices;
 89+
 90+ // If service_name is set, use this value, and ignore any given
 91+ // service parameters
 92+ // This will prevent ..input type=googlemaps|service=yahoo.. from
 93+ // showing up as a Yahoo! Maps map
 94+ if (array_key_exists('service_name', $field_args)) {
 95+ $service_name = $field_args['service_name'];
 96+ }
 97+ elseif (array_key_exists('service', $field_args)) {
 98+ $service_name = $field_args['service'];
 99+ }
 100+ else{
 101+ $service_name = null;
 102+ }
 103+
 104+ $service_name = MapsMapper::getValidService($service_name, 'fi');
 105+
 106+ $formInput = new $egMapsServices[$service_name]['fi']['class']();
 107+
 108+ // Get and return the form input HTML from the hook corresponding with the provided service
 109+ return $formInput->formInputHTML($coordinates, $input_name, $is_mandatory, $is_disabled, $field_args);
 110+
 111+}
\ No newline at end of file
Index: tags/extensions/SemanticMaps/REL_0_4_1/INSTALL
@@ -0,0 +1,16 @@
 2+[[Semantic Maps 0.3.4]]
 3+
 4+Make sure you have Semantic MediaWiki and Maps successfully installed before
 5+proceeding with the installation. Once you have downloaded the code, place
 6+the 'SemanticMaps' directory within your MediaWiki 'extensions' directory.
 7+Then add the following code to your LocalSettings.php file after the lines
 8+that install Maps:
 9+
 10+# Semantic Maps
 11+require_once( "$IP/extensions/SemanticMaps/SemanticMaps.php" );
 12+
 13+The inclusion of extensions should happen in this order: Semantic MediaWiki,
 14+Semantic Forms (if you use it), Semantic Maps. Maps should proceed Semantic
 15+Maps. See the installation instructions of Maps for info about the API keys.
 16+
 17+More information can be found at http://www.mediawiki.org/wiki/Extension:Semantic_Maps#Download_and_installation
\ No newline at end of file
Index: tags/extensions/SemanticMaps/REL_0_4_1/OpenStreetMap/SM_OSM.php
@@ -0,0 +1,24 @@
 2+<?php
 3+
 4+/**
 5+ * This groupe contains all OpenStreetMap related files of the Semantic Maps extension.
 6+ *
 7+ * @defgroup SMOpenStreetMap OpenStreetMap
 8+ * @ingroup SemanticMaps
 9+ */
 10+
 11+/**
 12+ * This file holds the general information for the OpenStreetMap service.
 13+ *
 14+ * @file SM_OpenStreetMap.php
 15+ * @ingroup SMOpenStreetMap
 16+ *
 17+ * @author Jeroen De Dauw
 18+ */
 19+
 20+if( !defined( 'MEDIAWIKI' ) ) {
 21+ die( 'Not an entry point.' );
 22+}
 23+
 24+// $egMapsServices['osm']['qp'] = array('class' => 'SMOSMQP', 'file' => 'SemanticMaps/OpenStreetMap/SM_OSMQP.php', 'local' => false);
 25+// $egMapsServices['osm']['fi'] = array('class' => 'SMOSMFormInput', 'file' => 'SemanticMaps/OpenStreetMap/SM_OSMFormInput.php', 'local' => false);
\ No newline at end of file
Index: tags/extensions/SemanticMaps/REL_0_4_1/RELEASE-NOTES
@@ -0,0 +1,116 @@
 2+For a documentation of all features, see http://www.mediawiki.org/wiki/Extension:Semantic_Maps
 3+
 4+==Semantic Maps change log==
 5+This change log contains a list of completed to-do's (new features, bug fixes, refactoring) for every version of Semantic Maps.
 6+
 7+===Semantic Maps 0.4===
 8+(2009-11-03)
 9+
 10+====Bug fixes====
 11+
 12+* Fixed the repeated display of mapping services on the Special:Ask page, by [http://svn.wikimedia.org/viewvc/mediawiki?view=rev&revision=58187 adding an aliasing system to SMW].
 13+
 14+* Fixed problem that caused the SM result formats to not get displayed on Special:Ask.
 15+
 16+===Semantic Maps 0.3.4===
 17+(2009-09-12)
 18+
 19+Changes in 0.3.4 discussed on the authors blog:
 20+
 21+* [http://blog.bn2vs.com/2009/09/12/maps-and-semantic-maps-0-3-4-released/ Maps and Semantic Maps 0.3.4 released]
 22+
 23+====Bug fixes====
 24+
 25+* Fixed bug causing error for people who do not have Semantic Forms installed and enabled, presumably introduced in 0.3.
 26+
 27+* Fixed bug causing only the last coordinate property from a result to be shown on a map format, and so causing the predecessors to be ignored in case of multiple coordinate properties.
 28+
 29+====Refactoring====
 30+
 31+* Restructured the extension to work with the new feature hook system of Maps.
 32+
 33+===Semantic Maps 0.3.3===
 34+(2009-08-15)
 35+
 36+Changes in 0.3.3 discussed on the authors blog:
 37+
 38+* [http://blog.bn2vs.com/2009/08/25/maps-and-semantic-maps-0-3-3/ Maps and Semantic Maps 0.3.3]
 39+
 40+====Bug fixes====
 41+
 42+* Fixed error caused by the 'map' format on the Special:Ask page
 43+
 44+===Semantic Maps 0.3.2===
 45+(2009-08-18)
 46+
 47+====Bug fixes====
 48+
 49+* Fixed logic error that caused maps to have a wrong centre and zoom when a query only returned one result.
 50+
 51+* Fixed an issue with the centre parameter in queries. In some cases it would not be processed correctly and cause PHP notices.
 52+
 53+===Semantic Maps 0.3.1===
 54+(2009-08-18)
 55+
 56+====Bug fixes====
 57+
 58+* Fixed script design flaw that caused errors when using the 'map' format in a query.
 59+
 60+===Semantic Maps 0.3===
 61+(2009-08-14)
 62+
 63+Changes in 0.3 discussed on the authors blog:
 64+
 65+* [http://blog.bn2vs.com/2009/08/13/final-changes-for-maps-and-sm-0-3/ Final changes for Maps and SM 0.3]
 66+
 67+* [http://blog.bn2vs.com/2009/08/07/new-features-in-maps-and-sm-0-3/ New features in Maps and SM 0.3]
 68+
 69+* [http://blog.bn2vs.com/2009/08/05/structural-changes-for-maps-and-sm-0-3/ Structural changes for Maps and SM 0.3]
 70+
 71+====New functionality====
 72+
 73+* Yahoo! Maps and OpenLayers now handle the "icon=" parameter that can come from Semantic Compound Queries, as Google Maps already did.
 74+
 75+====Refactoring====
 76+
 77+* Restructured the Query Printer classes (JavaScript based logic).
 78+
 79+* Made form input classes weakly typed, so they fully work with the new aliasing system.
 80+
 81+* Integrated the new hook system of Maps.
 82+
 83+* Made the form input class inherit from MapsMapFeature.
 84+
 85+====Bug fixes====
 86+
 87+* Mapping formats get added only once, as opossed to multiple times in version 0.2.2.
 88+
 89+* Added "elementNamePrefix" to the map names and fields of form inputs to prevent JavaScript errors.
 90+
 91+* When a query returns no results, nothing will be displayed, instead of an empty map.
 92+
 93+* The Google Maps form input now zooms in correctly when a user looks up an address.
 94+
 95+===Semantic Maps 0.2===
 96+(2009-07-29)
 97+
 98+====New functionality====
 99+
 100+* Hook for [[Extension:Admin_Links|Admin Links]]
 101+
 102+* Multi geocoder integration with form inputs
 103+
 104+* Yahoo! Geocoder (for form inputs)
 105+
 106+====Refactoring====
 107+
 108+* Restructure the Form Input classes
 109+
 110+====Bug fixes====
 111+
 112+* Yahoo! Maps (result format) do not display their markers correctly when a custom centre is set.
 113+
 114+===Semantic Maps 0.1===
 115+(2009-07-21)
 116+
 117+* Initial release, featuring both result formats and form inputs for Google Maps (+ Google Earth), Yahoo! Maps and OpenLayers
Index: tags/extensions/SemanticMaps/REL_0_4_1/COPYING
@@ -0,0 +1,348 @@
 2+The license text below "----" applies to all files within this distribution, other
 3+than those that are in a directory which contains files named "LICENSE" or
 4+"COPYING", or a subdirectory thereof. For those files, the license text contained in
 5+said file overrides any license information contained in directories of smaller depth.
 6+Alternative licenses are typically used for software that is provided by external
 7+parties, and merely packaged with the Semantic MediaWiki release for convenience.
 8+----
 9+
 10+ GNU GENERAL PUBLIC LICENSE
 11+ Version 2, June 1991
 12+
 13+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
 14+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 15+ Everyone is permitted to copy and distribute verbatim copies
 16+ of this license document, but changing it is not allowed.
 17+
 18+ Preamble
 19+
 20+ The licenses for most software are designed to take away your
 21+freedom to share and change it. By contrast, the GNU General Public
 22+License is intended to guarantee your freedom to share and change free
 23+software--to make sure the software is free for all its users. This
 24+General Public License applies to most of the Free Software
 25+Foundation's software and to any other program whose authors commit to
 26+using it. (Some other Free Software Foundation software is covered by
 27+the GNU Library General Public License instead.) You can apply it to
 28+your programs, too.
 29+
 30+ When we speak of free software, we are referring to freedom, not
 31+price. Our General Public Licenses are designed to make sure that you
 32+have the freedom to distribute copies of free software (and charge for
 33+this service if you wish), that you receive source code or can get it
 34+if you want it, that you can change the software or use pieces of it
 35+in new free programs; and that you know you can do these things.
 36+
 37+ To protect your rights, we need to make restrictions that forbid
 38+anyone to deny you these rights or to ask you to surrender the rights.
 39+These restrictions translate to certain responsibilities for you if you
 40+distribute copies of the software, or if you modify it.
 41+
 42+ For example, if you distribute copies of such a program, whether
 43+gratis or for a fee, you must give the recipients all the rights that
 44+you have. You must make sure that they, too, receive or can get the
 45+source code. And you must show them these terms so they know their
 46+rights.
 47+
 48+ We protect your rights with two steps: (1) copyright the software, and
 49+(2) offer you this license which gives you legal permission to copy,
 50+distribute and/or modify the software.
 51+
 52+ Also, for each author's protection and ours, we want to make certain
 53+that everyone understands that there is no warranty for this free
 54+software. If the software is modified by someone else and passed on, we
 55+want its recipients to know that what they have is not the original, so
 56+that any problems introduced by others will not reflect on the original
 57+authors' reputations.
 58+
 59+ Finally, any free program is threatened constantly by software
 60+patents. We wish to avoid the danger that redistributors of a free
 61+program will individually obtain patent licenses, in effect making the
 62+program proprietary. To prevent this, we have made it clear that any
 63+patent must be licensed for everyone's free use or not licensed at all.
 64+
 65+ The precise terms and conditions for copying, distribution and
 66+modification follow.
 67+
 68+ GNU GENERAL PUBLIC LICENSE
 69+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
 70+
 71+ 0. This License applies to any program or other work which contains
 72+a notice placed by the copyright holder saying it may be distributed
 73+under the terms of this General Public License. The "Program", below,
 74+refers to any such program or work, and a "work based on the Program"
 75+means either the Program or any derivative work under copyright law:
 76+that is to say, a work containing the Program or a portion of it,
 77+either verbatim or with modifications and/or translated into another
 78+language. (Hereinafter, translation is included without limitation in
 79+the term "modification".) Each licensee is addressed as "you".
 80+
 81+Activities other than copying, distribution and modification are not
 82+covered by this License; they are outside its scope. The act of
 83+running the Program is not restricted, and the output from the Program
 84+is covered only if its contents constitute a work based on the
 85+Program (independent of having been made by running the Program).
 86+Whether that is true depends on what the Program does.
 87+
 88+ 1. You may copy and distribute verbatim copies of the Program's
 89+source code as you receive it, in any medium, provided that you
 90+conspicuously and appropriately publish on each copy an appropriate
 91+copyright notice and disclaimer of warranty; keep intact all the
 92+notices that refer to this License and to the absence of any warranty;
 93+and give any other recipients of the Program a copy of this License
 94+along with the Program.
 95+
 96+You may charge a fee for the physical act of transferring a copy, and
 97+you may at your option offer warranty protection in exchange for a fee.
 98+
 99+ 2. You may modify your copy or copies of the Program or any portion
 100+of it, thus forming a work based on the Program, and copy and
 101+distribute such modifications or work under the terms of Section 1
 102+above, provided that you also meet all of these conditions:
 103+
 104+ a) You must cause the modified files to carry prominent notices
 105+ stating that you changed the files and the date of any change.
 106+
 107+ b) You must cause any work that you distribute or publish, that in
 108+ whole or in part contains or is derived from the Program or any
 109+ part thereof, to be licensed as a whole at no charge to all third
 110+ parties under the terms of this License.
 111+
 112+ c) If the modified program normally reads commands interactively
 113+ when run, you must cause it, when started running for such
 114+ interactive use in the most ordinary way, to print or display an
 115+ announcement including an appropriate copyright notice and a
 116+ notice that there is no warranty (or else, saying that you provide
 117+ a warranty) and that users may redistribute the program under
 118+ these conditions, and telling the user how to view a copy of this
 119+ License. (Exception: if the Program itself is interactive but
 120+ does not normally print such an announcement, your work based on
 121+ the Program is not required to print an announcement.)
 122+
 123+These requirements apply to the modified work as a whole. If
 124+identifiable sections of that work are not derived from the Program,
 125+and can be reasonably considered independent and separate works in
 126+themselves, then this License, and its terms, do not apply to those
 127+sections when you distribute them as separate works. But when you
 128+distribute the same sections as part of a whole which is a work based
 129+on the Program, the distribution of the whole must be on the terms of
 130+this License, whose permissions for other licensees extend to the
 131+entire whole, and thus to each and every part regardless of who wrote it.
 132+
 133+Thus, it is not the intent of this section to claim rights or contest
 134+your rights to work written entirely by you; rather, the intent is to
 135+exercise the right to control the distribution of derivative or
 136+collective works based on the Program.
 137+
 138+In addition, mere aggregation of another work not based on the Program
 139+with the Program (or with a work based on the Program) on a volume of
 140+a storage or distribution medium does not bring the other work under
 141+the scope of this License.
 142+
 143+ 3. You may copy and distribute the Program (or a work based on it,
 144+under Section 2) in object code or executable form under the terms of
 145+Sections 1 and 2 above provided that you also do one of the following:
 146+
 147+ a) Accompany it with the complete corresponding machine-readable
 148+ source code, which must be distributed under the terms of Sections
 149+ 1 and 2 above on a medium customarily used for software interchange; or,
 150+
 151+ b) Accompany it with a written offer, valid for at least three
 152+ years, to give any third party, for a charge no more than your
 153+ cost of physically performing source distribution, a complete
 154+ machine-readable copy of the corresponding source code, to be
 155+ distributed under the terms of Sections 1 and 2 above on a medium
 156+ customarily used for software interchange; or,
 157+
 158+ c) Accompany it with the information you received as to the offer
 159+ to distribute corresponding source code. (This alternative is
 160+ allowed only for noncommercial distribution and only if you
 161+ received the program in object code or executable form with such
 162+ an offer, in accord with Subsection b above.)
 163+
 164+The source code for a work means the preferred form of the work for
 165+making modifications to it. For an executable work, complete source
 166+code means all the source code for all modules it contains, plus any
 167+associated interface definition files, plus the scripts used to
 168+control compilation and installation of the executable. However, as a
 169+special exception, the source code distributed need not include
 170+anything that is normally distributed (in either source or binary
 171+form) with the major components (compiler, kernel, and so on) of the
 172+operating system on which the executable runs, unless that component
 173+itself accompanies the executable.
 174+
 175+If distribution of executable or object code is made by offering
 176+access to copy from a designated place, then offering equivalent
 177+access to copy the source code from the same place counts as
 178+distribution of the source code, even though third parties are not
 179+compelled to copy the source along with the object code.
 180+
 181+ 4. You may not copy, modify, sublicense, or distribute the Program
 182+except as expressly provided under this License. Any attempt
 183+otherwise to copy, modify, sublicense or distribute the Program is
 184+void, and will automatically terminate your rights under this License.
 185+However, parties who have received copies, or rights, from you under
 186+this License will not have their licenses terminated so long as such
 187+parties remain in full compliance.
 188+
 189+ 5. You are not required to accept this License, since you have not
 190+signed it. However, nothing else grants you permission to modify or
 191+distribute the Program or its derivative works. These actions are
 192+prohibited by law if you do not accept this License. Therefore, by
 193+modifying or distributing the Program (or any work based on the
 194+Program), you indicate your acceptance of this License to do so, and
 195+all its terms and conditions for copying, distributing or modifying
 196+the Program or works based on it.
 197+
 198+ 6. Each time you redistribute the Program (or any work based on the
 199+Program), the recipient automatically receives a license from the
 200+original licensor to copy, distribute or modify the Program subject to
 201+these terms and conditions. You may not impose any further
 202+restrictions on the recipients' exercise of the rights granted herein.
 203+You are not responsible for enforcing compliance by third parties to
 204+this License.
 205+
 206+ 7. If, as a consequence of a court judgment or allegation of patent
 207+infringement or for any other reason (not limited to patent issues),
 208+conditions are imposed on you (whether by court order, agreement or
 209+otherwise) that contradict the conditions of this License, they do not
 210+excuse you from the conditions of this License. If you cannot
 211+distribute so as to satisfy simultaneously your obligations under this
 212+License and any other pertinent obligations, then as a consequence you
 213+may not distribute the Program at all. For example, if a patent
 214+license would not permit royalty-free redistribution of the Program by
 215+all those who receive copies directly or indirectly through you, then
 216+the only way you could satisfy both it and this License would be to
 217+refrain entirely from distribution of the Program.
 218+
 219+If any portion of this section is held invalid or unenforceable under
 220+any particular circumstance, the balance of the section is intended to
 221+apply and the section as a whole is intended to apply in other
 222+circumstances.
 223+
 224+It is not the purpose of this section to induce you to infringe any
 225+patents or other property right claims or to contest validity of any
 226+such claims; this section has the sole purpose of protecting the
 227+integrity of the free software distribution system, which is
 228+implemented by public license practices. Many people have made
 229+generous contributions to the wide range of software distributed
 230+through that system in reliance on consistent application of that
 231+system; it is up to the author/donor to decide if he or she is willing
 232+to distribute software through any other system and a licensee cannot
 233+impose that choice.
 234+
 235+This section is intended to make thoroughly clear what is believed to
 236+be a consequence of the rest of this License.
 237+
 238+ 8. If the distribution and/or use of the Program is restricted in
 239+certain countries either by patents or by copyrighted interfaces, the
 240+original copyright holder who places the Program under this License
 241+may add an explicit geographical distribution limitation excluding
 242+those countries, so that distribution is permitted only in or among
 243+countries not thus excluded. In such case, this License incorporates
 244+the limitation as if written in the body of this License.
 245+
 246+ 9. The Free Software Foundation may publish revised and/or new versions
 247+of the General Public License from time to time. Such new versions will
 248+be similar in spirit to the present version, but may differ in detail to
 249+address new problems or concerns.
 250+
 251+Each version is given a distinguishing version number. If the Program
 252+specifies a version number of this License which applies to it and "any
 253+later version", you have the option of following the terms and conditions
 254+either of that version or of any later version published by the Free
 255+Software Foundation. If the Program does not specify a version number of
 256+this License, you may choose any version ever published by the Free Software
 257+Foundation.
 258+
 259+ 10. If you wish to incorporate parts of the Program into other free
 260+programs whose distribution conditions are different, write to the author
 261+to ask for permission. For software which is copyrighted by the Free
 262+Software Foundation, write to the Free Software Foundation; we sometimes
 263+make exceptions for this. Our decision will be guided by the two goals
 264+of preserving the free status of all derivatives of our free software and
 265+of promoting the sharing and reuse of software generally.
 266+
 267+ NO WARRANTY
 268+
 269+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
 270+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
 271+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
 272+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
 273+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 274+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
 275+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
 276+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
 277+REPAIR OR CORRECTION.
 278+
 279+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
 280+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
 281+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
 282+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
 283+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
 284+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
 285+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
 286+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
 287+POSSIBILITY OF SUCH DAMAGES.
 288+
 289+ END OF TERMS AND CONDITIONS
 290+
 291+ How to Apply These Terms to Your New Programs
 292+
 293+ If you develop a new program, and you want it to be of the greatest
 294+possible use to the public, the best way to achieve this is to make it
 295+free software which everyone can redistribute and change under these terms.
 296+
 297+ To do so, attach the following notices to the program. It is safest
 298+to attach them to the start of each source file to most effectively
 299+convey the exclusion of warranty; and each file should have at least
 300+the "copyright" line and a pointer to where the full notice is found.
 301+
 302+ <one line to give the program's name and a brief idea of what it does.>
 303+ Copyright (C) <year> <name of author>
 304+
 305+ This program is free software; you can redistribute it and/or modify
 306+ it under the terms of the GNU General Public License as published by
 307+ the Free Software Foundation; either version 2 of the License, or
 308+ (at your option) any later version.
 309+
 310+ This program is distributed in the hope that it will be useful,
 311+ but WITHOUT ANY WARRANTY; without even the implied warranty of
 312+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 313+ GNU General Public License for more details.
 314+
 315+ You should have received a copy of the GNU General Public License
 316+ along with this program; if not, write to the Free Software
 317+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 318+
 319+
 320+Also add information on how to contact you by electronic and paper mail.
 321+
 322+If the program is interactive, make it output a short notice like this
 323+when it starts in an interactive mode:
 324+
 325+ Gnomovision version 69, Copyright (C) year name of author
 326+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
 327+ This is free software, and you are welcome to redistribute it
 328+ under certain conditions; type `show c' for details.
 329+
 330+The hypothetical commands `show w' and `show c' should show the appropriate
 331+parts of the General Public License. Of course, the commands you use may
 332+be called something other than `show w' and `show c'; they could even be
 333+mouse-clicks or menu items--whatever suits your program.
 334+
 335+You should also get your employer (if you work as a programmer) or your
 336+school, if any, to sign a "copyright disclaimer" for the program, if
 337+necessary. Here is a sample; alter the names:
 338+
 339+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
 340+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
 341+
 342+ <signature of Ty Coon>, 1 April 1989
 343+ Ty Coon, President of Vice
 344+
 345+This General Public License does not permit incorporating your program into
 346+proprietary programs. If your program is a subroutine library, you may
 347+consider it more useful to permit linking proprietary applications with the
 348+library. If this is what you want to do, use the GNU Library General
 349+Public License instead of this License.
Index: tags/extensions/SemanticMaps/REL_0_4_1/SemanticMaps.i18n.php
@@ -0,0 +1,516 @@
 2+<?php
 3+
 4+/**
 5+ * Internationalization file for the Semantic Maps extension
 6+ *
 7+ * @file SemanticMaps.i18n.php
 8+ * @ingroup Semantic Maps
 9+ *
 10+ * @author Jeroen De Dauw
 11+ */
 12+
 13+$messages = array();
 14+
 15+/** English
 16+ * @author Jeroen De Dauw
 17+ */
 18+
 19+$messages['en'] = array(
 20+ 'semanticmaps_name' => 'Semantic Maps',
 21+ 'semanticmaps_desc' => "Provides the ability to view and edit coordinate data stored through the Semantic MediaWiki extension ([http://wiki.bn2vs.com/wiki/Semantic_Maps demo]).
 22+Available map services: $1",
 23+ 'semanticmaps_lookupcoordinates' => 'Look up coordinates',
 24+ 'semanticmaps_enteraddresshere' => 'Enter address here',
 25+ 'semanticmaps_notfound' => 'not found',
 26+);
 27+
 28+/** Message documentation (Message documentation)
 29+ * @author Raymond
 30+ */
 31+$messages['qqq'] = array(
 32+ 'semanticmaps_desc' => '{{desc}}
 33+
 34+* $1: a list of available map services',
 35+);
 36+
 37+/** Afrikaans (Afrikaans)
 38+ * @author Naudefj
 39+ */
 40+$messages['af'] = array(
 41+ 'semanticmaps_lookupcoordinates' => 'Soek koördinate op',
 42+);
 43+
 44+/** Arabic (العربية)
 45+ * @author Meno25
 46+ * @author OsamaK
 47+ */
 48+$messages['ar'] = array(
 49+ 'semanticmaps_desc' => 'يقدم إمكانية عرض وتعديل بيانات التنسيق التي خزنها امتداد سيمانتيك ميدياويكي ([http://wiki.bn2vs.com/wiki/Semantic_Maps تجربة]).
 50+خدمات الخرائط المتوفرة: $1',
 51+ 'semanticmaps_lookupcoordinates' => 'ابحث عن الإحداثيات',
 52+ 'semanticmaps_enteraddresshere' => 'أدخل العنوان هنا',
 53+ 'semanticmaps_notfound' => 'لم يوجد',
 54+);
 55+
 56+/** Egyptian Spoken Arabic (مصرى)
 57+ * @author Ghaly
 58+ * @author Meno25
 59+ */
 60+$messages['arz'] = array(
 61+ 'semanticmaps_lookupcoordinates' => 'ابحث عن الإحداثيات',
 62+ 'semanticmaps_enteraddresshere' => 'أدخل العنوان هنا',
 63+);
 64+
 65+/** Belarusian (Taraškievica orthography) (Беларуская (тарашкевіца))
 66+ * @author EugeneZelenko
 67+ * @author Jim-by
 68+ */
 69+$messages['be-tarask'] = array(
 70+ 'semanticmaps_name' => 'Сэмантычныя мапы',
 71+ 'semanticmaps_desc' => 'Забясьпечвае магчымасьць прагляду і рэдагаваньня зьвестак пра каардынаты, якія захоўваюцца з дапамогай пашырэньня Semantic MediaWiki ([http://wiki.bn2vs.com/wiki/Semantic_Maps дэманстрацыя]). Даступныя сэрвісы мапаў: $1',
 72+ 'semanticmaps_lookupcoordinates' => 'Пошук каардынатаў',
 73+ 'semanticmaps_enteraddresshere' => 'Увядзіце тут адрас',
 74+ 'semanticmaps_notfound' => 'ня знойдзена',
 75+);
 76+
 77+/** Breton (Brezhoneg)
 78+ * @author Fulup
 79+ */
 80+$messages['br'] = array(
 81+ 'semanticmaps_desc' => 'Talvezout a ra da welet ha da gemmañ roadennoù stoket dre an astenn Semantic MediaWiki ([http://wiki.bn2vs.com/wiki/Semantic_Maps demo]). Servijoù kartennoù hegerz : $1',
 82+ 'semanticmaps_lookupcoordinates' => 'Istimañ an daveennoù',
 83+ 'semanticmaps_enteraddresshere' => "Merkit ar chomlec'h amañ",
 84+ 'semanticmaps_notfound' => "N'eo ket bet kavet",
 85+);
 86+
 87+/** Bosnian (Bosanski)
 88+ * @author CERminator
 89+ */
 90+$messages['bs'] = array(
 91+ 'semanticmaps_desc' => 'Daje mogućnost pregleda i uređivanja podataka koordinata koji su spremljeni putem Semantic MediaWiki proširenja ([http://wiki.bn2vs.com/wiki/Semantic_Maps demo]).
 92+Dostupne usluge mapa: $1',
 93+ 'semanticmaps_lookupcoordinates' => 'Nađi koordinate',
 94+ 'semanticmaps_enteraddresshere' => 'Unesite adresu ovdje',
 95+ 'semanticmaps_notfound' => 'nije pronađeno',
 96+);
 97+
 98+/** Catalan (Català)
 99+ * @author Paucabot
 100+ */
 101+$messages['ca'] = array(
 102+ 'semanticmaps_notfound' => "no s'ha trobat",
 103+);
 104+
 105+/** German (Deutsch)
 106+ * @author DaSch
 107+ * @author Pill
 108+ * @author Umherirrender
 109+ */
 110+$messages['de'] = array(
 111+ 'semanticmaps_desc' => 'Ergänzt eine Möglichkeit zum Ansehen und Bearbeiten von Koordinaten, die im Rahmen der Erweiterung „Semantisches MediaWiki“ gespeichert wurden ([http://wiki.bn2vs.com/wiki/Semantic_Maps Demo]).
 112+Unterstützte Kartendienste: $1',
 113+ 'semanticmaps_lookupcoordinates' => 'Koordinaten nachschlagen',
 114+ 'semanticmaps_enteraddresshere' => 'Adresse hier eingeben',
 115+ 'semanticmaps_notfound' => 'nicht gefunden',
 116+);
 117+
 118+/** Lower Sorbian (Dolnoserbski)
 119+ * @author Michawiki
 120+ */
 121+$messages['dsb'] = array(
 122+ 'semanticmaps_desc' => 'Bitujo zmóžnosć se koordinatowe daty pśez rozšyrjenje Semantic MediaWiki woglědaś a wobźěłaś ([http://wiki.bn2vs.com/wiki/Semantic_Maps demo]).
 123+K dispoziciji stojece kórtowe słužby: $1.',
 124+ 'semanticmaps_lookupcoordinates' => 'Za koordinatami póglědaś',
 125+ 'semanticmaps_enteraddresshere' => 'Zapódaj how adresu',
 126+ 'semanticmaps_notfound' => 'njenamakany',
 127+);
 128+
 129+/** Greek (Ελληνικά)
 130+ * @author ZaDiak
 131+ */
 132+$messages['el'] = array(
 133+ 'semanticmaps_lookupcoordinates' => 'Επιθεώρηση συντεταγμένων',
 134+ 'semanticmaps_enteraddresshere' => 'Εισαγωγή διεύθυνσης εδώ',
 135+ 'semanticmaps_notfound' => 'δεν βρέθηκε',
 136+);
 137+
 138+/** Esperanto (Esperanto)
 139+ * @author Yekrats
 140+ */
 141+$messages['eo'] = array(
 142+ 'semanticmaps_lookupcoordinates' => 'Rigardi koordinatojn',
 143+);
 144+
 145+/** Spanish (Español)
 146+ * @author Crazymadlover
 147+ * @author Imre
 148+ * @author Locos epraix
 149+ */
 150+$messages['es'] = array(
 151+ 'semanticmaps_desc' => 'Proporciona la capacidad de ver y editar los datos coordinados almacenados a través de la extensión Semantic MediaWiki ([http://wiki.bn2vs.com/wiki/Semantic_Maps demo]).
 152+Servicios de mapas disponibles: $1',
 153+ 'semanticmaps_lookupcoordinates' => 'Busque las coordenadas',
 154+ 'semanticmaps_enteraddresshere' => 'Ingresar dirección aquí',
 155+ 'semanticmaps_notfound' => 'no encontrado',
 156+);
 157+
 158+/** Basque (Euskara)
 159+ * @author An13sa
 160+ */
 161+$messages['eu'] = array(
 162+ 'semanticmaps_lookupcoordinates' => 'Koordenatuak bilatu',
 163+);
 164+
 165+/** Finnish (Suomi)
 166+ * @author Str4nd
 167+ */
 168+$messages['fi'] = array(
 169+ 'semanticmaps_notfound' => 'ei löytynyt',
 170+);
 171+
 172+/** French (Français)
 173+ * @author Crochet.david
 174+ * @author Grondin
 175+ * @author IAlex
 176+ */
 177+$messages['fr'] = array(
 178+ 'semanticmaps_desc' => "Permet de voir et modifier les données de coordonnées stockées à travers l'extension Semantic MediaWiki. Services de cartes disponibles : $1. [http://www.mediawiki.org/wiki/Extension:Semantic_Maps Documentation]. [http://wiki.bn2vs.com/wiki/Semantic_Maps Démo]",
 179+ 'semanticmaps_lookupcoordinates' => 'Estimer les coordonnées',
 180+ 'semanticmaps_enteraddresshere' => 'Entrez ici l’adresse',
 181+ 'semanticmaps_notfound' => 'pas trouvé',
 182+);
 183+
 184+/** Galician (Galego)
 185+ * @author Toliño
 186+ */
 187+$messages['gl'] = array(
 188+ 'semanticmaps_desc' => 'Proporciona a capacidade de visualizar e modificar os datos de coordenadas gardados a través da extensión Semantic MediaWiki ([http://wiki.bn2vs.com/wiki/Semantic_Maps demostración]).
 189+Servizos de mapa dispoñibles: $1',
 190+ 'semanticmaps_lookupcoordinates' => 'Ver as coordenadas',
 191+ 'semanticmaps_enteraddresshere' => 'Introduza o enderezo aquí',
 192+ 'semanticmaps_notfound' => 'non se atopou',
 193+);
 194+
 195+/** Swiss German (Alemannisch)
 196+ * @author Als-Holder
 197+ */
 198+$messages['gsw'] = array(
 199+ 'semanticmaps_desc' => 'Ergänzt e Megligkeit zum Aaluege un Bearbeite vu Koordinate, wu im Ramme vu dr Erwyterig „Semantisch MediaWiki“ gspycheret wore sin. Unterstitzti Chartedienscht: $1. [http://www.mediawiki.org/wiki/Extension:Semantic_Maps Dokumäntation]. [http://wiki.bn2vs.com/wiki/Semantic_Maps Demo]',
 200+ 'semanticmaps_lookupcoordinates' => 'Koordinate nooluege',
 201+ 'semanticmaps_enteraddresshere' => 'Doo Adräss yygee',
 202+ 'semanticmaps_notfound' => 'nit gfunde',
 203+);
 204+
 205+/** Hebrew (עברית)
 206+ * @author Rotemliss
 207+ * @author YaronSh
 208+ */
 209+$messages['he'] = array(
 210+ 'semanticmaps_desc' => 'הוספת האפשרות לצפייה ולעריכה בנתוני קואורדינטה המאוחסנים דרך הרחבת המדיה־ויקי הסמנטי ([http://wiki.bn2vs.com/wiki/Semantic_Maps הדגמה]).
 211+שירותי מפה זמינים: $1',
 212+ 'semanticmaps_lookupcoordinates' => 'חיפוש קואורדינטות',
 213+ 'semanticmaps_enteraddresshere' => 'כתבו כתובת כאן',
 214+ 'semanticmaps_notfound' => 'לא נמצאה',
 215+);
 216+
 217+/** Upper Sorbian (Hornjoserbsce)
 218+ * @author Michawiki
 219+ */
 220+$messages['hsb'] = array(
 221+ 'semanticmaps_desc' => 'Skići móžnosć koordinatowe daty, kotrež buchu přez rozšěrjenje Semantic MediaWiki składowane, sej wobhladać a změnić. ([http://wiki.bn2vs.com/wiki/Semantic_Maps demo]). K dispoziciji stejace kartowe słužby: $1',
 222+ 'semanticmaps_lookupcoordinates' => 'Za koordinatami hladać',
 223+ 'semanticmaps_enteraddresshere' => 'Zapodaj tu adresu',
 224+ 'semanticmaps_notfound' => 'njenamakany',
 225+);
 226+
 227+/** Hungarian (Magyar)
 228+ * @author Glanthor Reviol
 229+ */
 230+$messages['hu'] = array(
 231+ 'semanticmaps_desc' => 'Lehetővé teszi a szemantikus MediaWiki kiterjesztés segítségével tárolt koordinátaadatok megtekintését és szerkesztését ([http://wiki.bn2vs.com/wiki/Semantic_Maps demo]).
 232+Elérhető térképszolgáltatók: $1',
 233+ 'semanticmaps_lookupcoordinates' => 'Koordináták felkeresése',
 234+ 'semanticmaps_enteraddresshere' => 'Add meg a címet itt',
 235+ 'semanticmaps_notfound' => 'nincs találat',
 236+);
 237+
 238+/** Interlingua (Interlingua)
 239+ * @author McDutchie
 240+ */
 241+$messages['ia'] = array(
 242+ 'semanticmaps_desc' => 'Permitte vider e modificar datos de coordinatas immagazinate per le extension Semantic MediaWiki
 243+([http://wiki.bn2vs.com/wiki/Semantic_Maps demo]).
 244+Servicios de cartas disponibile: $1',
 245+ 'semanticmaps_lookupcoordinates' => 'Cercar coordinatas',
 246+ 'semanticmaps_enteraddresshere' => 'Entra adresse hic',
 247+ 'semanticmaps_notfound' => 'non trovate',
 248+);
 249+
 250+/** Indonesian (Bahasa Indonesia)
 251+ * @author Bennylin
 252+ */
 253+$messages['id'] = array(
 254+ 'semanticmaps_desc' => 'Memampukan penampilan dan penyuntingan data koordinat yang disimpan melalui pengaya MediaWiki Semantic ([http://wiki.bn2vs.com/wiki/Semantic_Maps demo]).
 255+Layanan peta yang tersedia: $1',
 256+ 'semanticmaps_lookupcoordinates' => 'Cari koordinat',
 257+ 'semanticmaps_enteraddresshere' => 'Masukkan alamat di sini',
 258+ 'semanticmaps_notfound' => 'tidak ditemukan',
 259+);
 260+
 261+/** Italian (Italiano)
 262+ * @author Darth Kule
 263+ */
 264+$messages['it'] = array(
 265+ 'semanticmaps_desc' => "Offre la possibilità di visualizzare e modificare le coordinate memorizzate attraverso l'estensione Semantic MediaWiki ([http://wiki.bn2vs.com/wiki/Semantic_Maps demo]). Servizi di mappe disponibili: $1",
 266+ 'semanticmaps_lookupcoordinates' => 'Cerca coordinate',
 267+ 'semanticmaps_enteraddresshere' => 'Inserisci indirizzo qui',
 268+ 'semanticmaps_notfound' => 'non trovato',
 269+);
 270+
 271+/** Japanese (日本語)
 272+ * @author Fryed-peach
 273+ * @author Mizusumashi
 274+ */
 275+$messages['ja'] = array(
 276+ 'semanticmaps_desc' => 'Semantic MediaWiki 拡張機能を通して格納された座標データを表示・編集する機能を提供する([http://wiki.bn2vs.com/wiki/Semantic_Maps 実演])。次の地図サービスに対応します:$1',
 277+ 'semanticmaps_lookupcoordinates' => '座標を調べる',
 278+ 'semanticmaps_enteraddresshere' => '住所をここに入力します',
 279+ 'semanticmaps_notfound' => '見つかりません',
 280+);
 281+
 282+/** Khmer (ភាសាខ្មែរ)
 283+ * @author Thearith
 284+ */
 285+$messages['km'] = array(
 286+ 'semanticmaps_lookupcoordinates' => 'ក្រឡេក​មើល​កូអរដោនេ',
 287+);
 288+
 289+/** Ripoarisch (Ripoarisch)
 290+ * @author Purodha
 291+ */
 292+$messages['ksh'] = array(
 293+ 'semanticmaps_desc' => 'Määt et müjjelesch, Koodinaate ze beloore un ze ändere, di per Semantesch Mediawiki faßjehallde woodte. (E [http://wiki.bn2vs.com/wiki/Semantic_Maps Beijshpöll]) Deenste för Kaate ham_mer di heh: $1',
 294+ 'semanticmaps_lookupcoordinates' => 'Koordinate nohkike',
 295+ 'semanticmaps_enteraddresshere' => 'Donn hee de Address enjäve',
 296+ 'semanticmaps_notfound' => 'nit jefonge',
 297+);
 298+
 299+/** Luxembourgish (Lëtzebuergesch)
 300+ * @author Robby
 301+ */
 302+$messages['lb'] = array(
 303+ 'semanticmaps_lookupcoordinates' => 'Koordinaten nokucken',
 304+ 'semanticmaps_enteraddresshere' => 'Adress hei aginn',
 305+ 'semanticmaps_notfound' => 'net fonnt',
 306+);
 307+
 308+/** Macedonian (Македонски)
 309+ * @author Bjankuloski06
 310+ */
 311+$messages['mk'] = array(
 312+ 'semanticmaps_desc' => 'Дава можност за гледање и уредување на податоци со координати складирани преку проширувањето Semantic MediaWiki ([http://wiki.bn2vs.com/wiki/Semantic_Maps демо]).
 313+Картографски служби на располагање: $1',
 314+ 'semanticmaps_lookupcoordinates' => 'Побарај координати',
 315+ 'semanticmaps_enteraddresshere' => 'Внесете адреса тука',
 316+ 'semanticmaps_notfound' => 'не е најдено ништо',
 317+);
 318+
 319+/** Dutch (Nederlands)
 320+ * @author Jeroen De Dauw
 321+ * @author Siebrand
 322+ */
 323+$messages['nl'] = array(
 324+ 'semanticmaps_desc' => 'Biedt de mogelijkheid om locatiegegevens die zijn opgeslagen met behulp van de uitbreiding Semantic MediaWiki te bekijken en aan te passen ([http://wiki.bn2vs.com/wiki/Semantic_Maps demo]).
 325+Beschikbare kaartdiensten: $1',
 326+ 'semanticmaps_lookupcoordinates' => 'Coördinaten opzoeken',
 327+ 'semanticmaps_enteraddresshere' => 'Voer hier het adres in',
 328+ 'semanticmaps_notfound' => 'niet gevonden',
 329+);
 330+
 331+/** Norwegian Nynorsk (‪Norsk (nynorsk)‬)
 332+ * @author Harald Khan
 333+ */
 334+$messages['nn'] = array(
 335+ 'semanticmaps_lookupcoordinates' => 'Sjekk koordinatar',
 336+ 'semanticmaps_enteraddresshere' => 'Skriv inn adressa her',
 337+);
 338+
 339+/** Norwegian (bokmål)‬ (‪Norsk (bokmål)‬)
 340+ * @author Jon Harald Søby
 341+ * @author Nghtwlkr
 342+ */
 343+$messages['no'] = array(
 344+ 'semanticmaps_lookupcoordinates' => 'Sjekk koordinater',
 345+ 'semanticmaps_enteraddresshere' => 'Skriv inn adressen her',
 346+);
 347+
 348+/** Occitan (Occitan)
 349+ * @author Cedric31
 350+ */
 351+$messages['oc'] = array(
 352+ 'semanticmaps_desc' => "Permet de veire e modificar las donadas de coordenadas estocadas a travèrs l'extension Semantic MediaWiki. Servicis de mapas disponibles : $1. [http://www.mediawiki.org/wiki/Extension:Semantic_Maps Documentacion]. [http://wiki.bn2vs.com/wiki/Semantic_Maps Demo]",
 353+ 'semanticmaps_lookupcoordinates' => 'Estimar las coordenadas',
 354+ 'semanticmaps_enteraddresshere' => 'Picatz aicí l’adreça',
 355+ 'semanticmaps_notfound' => 'pas trobat',
 356+);
 357+
 358+/** Polish (Polski)
 359+ * @author Derbeth
 360+ * @author Leinad
 361+ * @author Sp5uhe
 362+ */
 363+$messages['pl'] = array(
 364+ 'semanticmaps_desc' => 'Daje możliwość przeglądania oraz edytowania współrzędnych zapisanych przez rozszerzenie Semantic MediaWiki ([http://wiki.bn2vs.com/wiki/Semantic_Maps demo]).
 365+Dostępne serwisy mapowe: $1',
 366+ 'semanticmaps_lookupcoordinates' => 'Wyszukaj współrzędne',
 367+ 'semanticmaps_enteraddresshere' => 'Podaj adres',
 368+ 'semanticmaps_notfound' => 'nie odnaleziono',
 369+);
 370+
 371+/** Piedmontese (Piemontèis)
 372+ * @author Dragonòt
 373+ */
 374+$messages['pms'] = array(
 375+ 'semanticmaps_desc' => 'A dà la possibilità ëd visualisé e modìfiché le coordinà memorisà con le estension Semantic mediaWiki ([http://wiki.bn2vs.com/wiki/Semantic_Maps demo]).
 376+Sërvissi ëd mapa disponìbij: $1',
 377+ 'semanticmaps_lookupcoordinates' => 'Serca coordinà',
 378+ 'semanticmaps_enteraddresshere' => 'Ansëriss adrëssa sì',
 379+ 'semanticmaps_notfound' => 'pa trovà',
 380+);
 381+
 382+/** Portuguese (Português)
 383+ * @author Indech
 384+ * @author Malafaya
 385+ */
 386+$messages['pt'] = array(
 387+ 'semanticmaps_lookupcoordinates' => 'Pesquisar coordenadas',
 388+ 'semanticmaps_enteraddresshere' => 'Introduza um endereço aqui',
 389+ 'semanticmaps_notfound' => 'não encontrado',
 390+);
 391+
 392+/** Brazilian Portuguese (Português do Brasil)
 393+ * @author Eduardo.mps
 394+ */
 395+$messages['pt-br'] = array(
 396+ 'semanticmaps_desc' => 'Provê a possibilidade de ver e editar dados de coordenadas armazenados através da extensão Semantic MediaWiki. ([http://wiki.bn2vs.com/wiki/Semantic_Maps demonstração]).
 397+Serviços de mapeamento disponíveis: $1',
 398+ 'semanticmaps_lookupcoordinates' => 'Pesquisar coordenadas',
 399+ 'semanticmaps_enteraddresshere' => 'Introduza um endereço aqui',
 400+ 'semanticmaps_notfound' => 'Não encontrado',
 401+);
 402+
 403+/** Romanian (Română)
 404+ * @author Firilacroco
 405+ */
 406+$messages['ro'] = array(
 407+ 'semanticmaps_notfound' => 'nu a fost găsit',
 408+);
 409+
 410+/** Tarandíne (Tarandíne)
 411+ * @author Joetaras
 412+ */
 413+$messages['roa-tara'] = array(
 414+ 'semanticmaps_desc' => "Dè l'abbilità a fà vedè e cangià le coordinate reggistrate cu l'estenzione Semandiche de MediaUicchi ([http://wiki.bn2vs.com/wiki/Semantic_Maps demo]).
 415+Disponibbile le servizie de mappe: $1",
 416+ 'semanticmaps_lookupcoordinates' => 'Ingroce le coordinate',
 417+ 'semanticmaps_enteraddresshere' => "Scaffe l'indirizze aqquà",
 418+ 'semanticmaps_notfound' => 'no acchiate',
 419+);
 420+
 421+/** Russian (Русский)
 422+ * @author Eugene Mednikov
 423+ * @author Lockal
 424+ * @author Александр Сигачёв
 425+ */
 426+$messages['ru'] = array(
 427+ 'semanticmaps_desc' => 'Предоставляет возможность просмотра и редактирования данных о координатах, хранящихся посредством расширения Semantic MediaWiki ([http://wiki.bn2vs.com/wiki/Semantic_Maps демонстрация]).
 428+Доступные службы карт: $1',
 429+ 'semanticmaps_lookupcoordinates' => 'Найти координаты',
 430+ 'semanticmaps_enteraddresshere' => 'Введите адрес',
 431+ 'semanticmaps_notfound' => 'не найдено',
 432+);
 433+
 434+/** Slovak (Slovenčina)
 435+ * @author Helix84
 436+ */
 437+$messages['sk'] = array(
 438+ 'semanticmaps_desc' => 'Poskytuje schopnosť zobrazovať a upravovať údaje súradníc uložené prostredníctvom rozšírenia Semantic MediaWiki ([http://wiki.bn2vs.com/wiki/Semantic_Maps demo]).
 439+Dostupné mapové služby: $1',
 440+ 'semanticmaps_lookupcoordinates' => 'Vyhľadať súradnice',
 441+ 'semanticmaps_enteraddresshere' => 'Sem zadajte emailovú adresu',
 442+ 'semanticmaps_notfound' => 'nenájdené',
 443+);
 444+
 445+/** Serbian Cyrillic ekavian (Српски (ћирилица))
 446+ * @author Михајло Анђелковић
 447+ */
 448+$messages['sr-ec'] = array(
 449+ 'semanticmaps_enteraddresshere' => 'Унеси адресу овде',
 450+ 'semanticmaps_notfound' => 'није нађено',
 451+);
 452+
 453+/** Serbian Latin ekavian (Srpski (latinica))
 454+ * @author Michaello
 455+ */
 456+$messages['sr-el'] = array(
 457+ 'semanticmaps_enteraddresshere' => 'Unesi adresu ovde',
 458+ 'semanticmaps_notfound' => 'nije nađeno',
 459+);
 460+
 461+/** Swedish (Svenska)
 462+ * @author Boivie
 463+ * @author Najami
 464+ */
 465+$messages['sv'] = array(
 466+ 'semanticmaps_lookupcoordinates' => 'Kolla upp koordinater',
 467+ 'semanticmaps_enteraddresshere' => 'Skriv in adress här',
 468+);
 469+
 470+/** Tagalog (Tagalog)
 471+ * @author AnakngAraw
 472+ */
 473+$messages['tl'] = array(
 474+ 'semanticmaps_lookupcoordinates' => "Hanapin ang mga tugmaang-pampook (''coordinate'')",
 475+ 'semanticmaps_enteraddresshere' => 'Ipasok ang adres dito',
 476+);
 477+
 478+/** Veps (Vepsan kel')
 479+ * @author Игорь Бродский
 480+ */
 481+$messages['vep'] = array(
 482+ 'semanticmaps_notfound' => 'ei voi löuta',
 483+);
 484+
 485+/** Vietnamese (Tiếng Việt)
 486+ * @author Minh Nguyen
 487+ * @author Vinhtantran
 488+ */
 489+$messages['vi'] = array(
 490+ 'semanticmaps_desc' => 'Cung cấp khả năng xem và sửa đổi dữ liệu tọa độ được lưu bởi phần mở rộng Semantic MediaWiki ([http://wiki.bn2vs.com/wiki/Semantic_Maps thử xem]).
 491+Các dịch vụ bản đồ có sẵn: $1',
 492+ 'semanticmaps_lookupcoordinates' => 'Tra tọa độ',
 493+ 'semanticmaps_enteraddresshere' => 'Nhập địa chỉ vào đây',
 494+ 'semanticmaps_notfound' => 'không tìm thấy',
 495+);
 496+
 497+/** Volapük (Volapük)
 498+ * @author Smeira
 499+ */
 500+$messages['vo'] = array(
 501+ 'semanticmaps_lookupcoordinates' => 'Tuvön koordinatis',
 502+);
 503+
 504+/** Simplified Chinese (‪中文(简体)‬)
 505+ * @author Gzdavidwong
 506+ */
 507+$messages['zh-hans'] = array(
 508+ 'semanticmaps_lookupcoordinates' => '查找坐标',
 509+);
 510+
 511+/** Traditional Chinese (‪中文(繁體)‬)
 512+ * @author Wrightbus
 513+ */
 514+$messages['zh-hant'] = array(
 515+ 'semanticmaps_lookupcoordinates' => '尋找座標',
 516+);
 517+
Index: tags/extensions/SemanticMaps/REL_0_4_1/SemanticMaps.php
@@ -0,0 +1,84 @@
 2+<?php
 3+
 4+/**
 5+ * Initialization file for the Semantic Maps extension.
 6+ * Extension documentation: http://www.mediawiki.org/wiki/Extension:Semantic_Maps
 7+ *
 8+ * @file SemanticMaps.php
 9+ * @ingroup SemanticMaps
 10+ *
 11+ * @author Jeroen De Dauw
 12+ */
 13+
 14+/**
 15+ * This documenation group collects source code files belonging to Semantic Maps.
 16+ *
 17+ * Please do not use this group name for other code. If you have an extension to
 18+ * Semantic Maps, please use your own group defenition.
 19+ *
 20+ * @defgroup SemanticMaps Semantic Maps
 21+ */
 22+
 23+if( !defined( 'MEDIAWIKI' ) ) {
 24+ die( 'Not an entry point.' );
 25+}
 26+
 27+define('SM_VERSION', '0.4.1');
 28+
 29+$smgScriptPath = $wgScriptPath . '/extensions/SemanticMaps';
 30+$smgIP = $IP . '/extensions/SemanticMaps';
 31+
 32+// Include the settings file
 33+require_once($smgIP . '/SM_Settings.php');
 34+
 35+$wgExtensionFunctions[] = 'smfSetup';
 36+
 37+$wgHooks['AdminLinks'][] = 'smfAddToAdminLinks';
 38+
 39+$wgExtensionMessagesFiles['SemanticMaps'] = $smgIP . '/SemanticMaps.i18n.php';
 40+
 41+/**
 42+ * 'Initialization' function for the Semantic Maps extension.
 43+ * The only work done here is creating the extension credits for
 44+ * Semantic Maps. The actuall work in done via the Maps hooks.
 45+ */
 46+function smfSetup() {
 47+ global $wgExtensionCredits, $wgLang, $egMapsServices;
 48+
 49+ // Creation of a list of internationalized service names
 50+ $services = array();
 51+ foreach (array_keys($egMapsServices) as $name) $services[] = wfMsg('maps_'.$name);
 52+ $services_list = $wgLang->listToText($services);
 53+
 54+ wfLoadExtensionMessages( 'SemanticMaps' );
 55+
 56+ $wgExtensionCredits['other'][]= array(
 57+ 'path' => __FILE__,
 58+ 'name' => wfMsg('semanticmaps_name'),
 59+ 'version' => SM_VERSION,
 60+ 'author' => array('[http://bn2vs.com Jeroen De Dauw]', 'Yaron Koren', 'Robert Buzink'),
 61+ 'url' => 'http://www.mediawiki.org/wiki/Extension:Semantic_Maps',
 62+ 'description' => wfMsgExt( 'semanticmaps_desc', 'parsemag', $services_list ),
 63+ 'descriptionmsg' => wfMsgExt( 'semanticmaps_desc', 'parsemag', $services_list ),
 64+ );
 65+
 66+ return true;
 67+}
 68+
 69+/**
 70+ * Adds a link to Admin Links page
 71+ */
 72+function smfAddToAdminLinks(&$admin_links_tree) {
 73+ $displaying_data_section = $admin_links_tree->getSection(wfMsg('smw_adminlinks_displayingdata'));
 74+
 75+ // Escape if SMW hasn't added links
 76+ if (is_null($displaying_data_section)) return true;
 77+
 78+ $smw_docu_row = $displaying_data_section->getRow('smw');
 79+
 80+ $sm_docu_label = wfMsg('adminlinks_documentation', wfMsg('semanticmaps_name'));
 81+ $smw_docu_row->addItem(AlItem::newFromExternalLink("http://www.mediawiki.org/wiki/Extension:Semantic_Maps", $sm_docu_label));
 82+
 83+ return true;
 84+}
 85+
Index: tags/extensions/SemanticMaps/REL_0_4_1/QueryPrinters/SM_QueryPrinters.php
@@ -0,0 +1,95 @@
 2+<?php
 3+
 4+/**
 5+ * Initialization file for query printer functionality in the Semantic Maps extension
 6+ *
 7+ * @file SM_QueryPrinters.php
 8+ * @ingroup SemanticMaps
 9+ *
 10+ * @author Jeroen De Dauw
 11+ */
 12+
 13+if( !defined( 'MEDIAWIKI' ) ) {
 14+ die( 'Not an entry point.' );
 15+}
 16+
 17+final class SMQueryPrinters {
 18+
 19+ /**
 20+ * Initialization function for Maps query printer functionality.
 21+ */
 22+ public static function initialize() {
 23+ global $smgIP, $wgAutoloadClasses, $egMapsServices;
 24+
 25+ $wgAutoloadClasses['SMMapPrinter'] = $smgIP . '/QueryPrinters/SM_MapPrinter.php';
 26+
 27+ $hasQueryPrinters = false;
 28+
 29+ foreach($egMapsServices as $serviceName => $serviceData) {
 30+ // Check if the service has a query printer
 31+ $hasQP = array_key_exists('qp', $serviceData);
 32+
 33+ // If the service has no QP, skipt it and continue with the next one.
 34+ if (!$hasQP) continue;
 35+
 36+ // At least one query printer will be enabled when this point is reached.
 37+ $hasQueryPrinters = true;
 38+
 39+ // Initiate the format.
 40+ self::initFormat($serviceName, $serviceData['qp'], $serviceData['aliases']);
 41+ }
 42+
 43+ // Add the 'map' result format if there are mapping services that have QP's loaded.
 44+ if ($hasQueryPrinters) self::initFormat('map', array('class' => 'SMMapper', 'file' => 'QueryPrinters/SM_Mapper.php', 'local' => true), array());
 45+ }
 46+
 47+ /**
 48+ * Add the result format for a mapping service or alias.
 49+ *
 50+ * @param string $format
 51+ * @param array $qp
 52+ * @param array $aliases
 53+ */
 54+ private static function initFormat($format, array $qp, array $aliases) {
 55+ global $wgAutoloadClasses, $smgIP, $smwgResultAliases;
 56+
 57+ // Load the QP class when it's not loaded yet
 58+ if (! array_key_exists($qp['class'], $wgAutoloadClasses)) {
 59+ $file = $qp['local'] ? $smgIP . '/' . $qp['file'] : $qp['file'];
 60+ $wgAutoloadClasses[$qp['class']] = $file;
 61+ }
 62+
 63+ // Add the QP to SMW
 64+ self::addFormatQP($format, $qp['class']);
 65+
 66+ // If SMW supports aliasing, add the aliases to $smwgResultAliases
 67+ if (isset($smwgResultAliases)) {
 68+ $smwgResultAliases[$format] = $aliases;
 69+ }
 70+ else { // If SMW does not support aliasing, add every alias as a format
 71+ foreach($aliases as $alias) self::addFormatQP($alias, $qp['class']);
 72+ }
 73+
 74+ //if (count($smwgResultAliases) == 4) die(var_dump($smwgResultAliases));
 75+ }
 76+
 77+ /**
 78+ * Adds a QP to SMW's $smwgResultFormats array or SMWQueryProcessor
 79+ * depending on if SMW supports $smwgResultFormats.
 80+ *
 81+ * @param string $format
 82+ * @param string $class
 83+ */
 84+ private static function addFormatQP($format, $class) {
 85+ global $smwgResultFormats;
 86+
 87+ if (isset($smwgResultFormats)) {
 88+ $smwgResultFormats[$format] = $class;
 89+ }
 90+ else {
 91+ SMWQueryProcessor::$formats[$format] = $class;
 92+ }
 93+ }
 94+
 95+
 96+}
\ No newline at end of file
Index: tags/extensions/SemanticMaps/REL_0_4_1/QueryPrinters/SM_MapPrinter.php
@@ -0,0 +1,262 @@
 2+<?php
 3+
 4+/**
 5+ * Abstract class that provides the common functionallity for all map query printers
 6+ *
 7+ * @file SM_MapPrinter.php
 8+ * @ingroup SemanticMaps
 9+ *
 10+ * @author Jeroen De Dauw
 11+ * @author Robert Buzink
 12+ * @author Yaron Koren
 13+ */
 14+
 15+if( !defined( 'MEDIAWIKI' ) ) {
 16+ die( 'Not an entry point.' );
 17+}
 18+
 19+abstract class SMMapPrinter extends SMWResultPrinter {
 20+
 21+ /**
 22+ * Sets the map service specific element name
 23+ */
 24+ protected abstract function setQueryPrinterSettings();
 25+
 26+ /**
 27+ * Map service spesific map count and loading of dependencies
 28+ */
 29+ protected abstract function doMapServiceLoad();
 30+
 31+ /**
 32+ * Gets the query result
 33+ */
 34+ protected abstract function addSpecificMapHTML();
 35+
 36+ public $serviceName;
 37+
 38+ protected $defaultParams = array();
 39+
 40+ protected $m_locations = array();
 41+
 42+ protected $defaultZoom;
 43+ protected $elementNr;
 44+ protected $elementNamePrefix;
 45+
 46+ protected $mapName;
 47+
 48+ protected $centre_lat;
 49+ protected $centre_lon;
 50+
 51+ protected $output = '';
 52+
 53+ protected $mapFeature;
 54+
 55+ /**
 56+ * Builds up and returns the HTML for the map, with the queried coordinate data on it.
 57+ *
 58+ * @param unknown_type $res
 59+ * @param unknown_type $outputmode
 60+ * @return array
 61+ */
 62+ public final function getResultText($res, $outputmode) {
 63+ $this->formatResultData($res, $outputmode);
 64+
 65+ $this->setQueryPrinterSettings();
 66+
 67+ $this->manageMapProperties($this->m_params);
 68+
 69+ // Only create a map when there is at least one result.
 70+ if (count($this->m_locations) > 0) {
 71+ $this->doMapServiceLoad();
 72+
 73+ $this->setMapName();
 74+
 75+ $this->setZoom();
 76+
 77+ $this->setCentre();
 78+
 79+ $this->addSpecificMapHTML();
 80+ }
 81+
 82+ return array($this->output, 'noparse' => 'true', 'isHTML' => 'true');
 83+ }
 84+
 85+ public final function getResult($results, $params, $outputmode) {
 86+ // Skip checks, results with 0 entries are normal
 87+ $this->readParameters($params, $outputmode);
 88+ return $this->getResultText($results, SMW_OUTPUT_HTML);
 89+ }
 90+
 91+ private function formatResultData($res, $outputmode) {
 92+ while ( ($row = $res->getNext()) !== false ) {
 93+ $this->addResultRow($outputmode, $row);
 94+ }
 95+ }
 96+
 97+ /**
 98+ * This function will loop through all properties (fields) of one record (row),
 99+ * and add the location data, title, label and icon to the m_locations array.
 100+ *
 101+ * @param unknown_type $outputmode
 102+ * @param unknown_type $row The record you want to add data from
 103+ */
 104+ private function addResultRow($outputmode, $row) {
 105+ global $wgUser;
 106+ $skin = $wgUser->getSkin();
 107+
 108+ $title = '';
 109+ $text = '';
 110+ $lat = '';
 111+ $lon = '';
 112+
 113+ $coords = array();
 114+
 115+ // Loop throught all fields of the record
 116+ foreach ($row as $i => $field) {
 117+ $pr = $field->getPrintRequest();
 118+
 119+ // Loop throught all the parts of the field value
 120+ while ( ($object = $field->getNextObject()) !== false ) {
 121+ if ($object->getTypeID() == '_wpg' && $i == 0) {
 122+ $title = $object->getLongText($outputmode, $skin);
 123+ }
 124+
 125+ if ($object->getTypeID() != '_geo' && $i != 0) {
 126+ $text .= $pr->getHTMLText($skin) . ': ' . $object->getLongText($outputmode, $skin) . '<br />';
 127+ }
 128+
 129+ if ($pr->getMode() == SMWPrintRequest::PRINT_PROP && $pr->getTypeID() == '_geo') {
 130+ $coords[] = explode(',', $object->getXSDValue());
 131+ }
 132+ }
 133+ }
 134+
 135+ foreach ($coords as $coord) {
 136+ if (count($coord) == 2) {
 137+ list($lat, $lon) = $coord;
 138+
 139+ if (strlen($lat) > 0 && strlen($lon) > 0) {
 140+ $icon = $this->getLocationIcon($row);
 141+ $this->m_locations[] = array($lat, $lon, $title, $text, $icon);
 142+ }
 143+
 144+ }
 145+ }
 146+ }
 147+
 148+ /**
 149+ * Get the icon for a row
 150+ *
 151+ * @param unknown_type $row
 152+ * @return unknown
 153+ */
 154+ private function getLocationIcon($row) {
 155+ $icon = '';
 156+ $legend_labels = array();
 157+
 158+ // Look for display_options field, which can be set by Semantic Compound Queries
 159+ // the location of this field changed in SMW 1.5
 160+ if (method_exists($row[0], 'getResultSubject')) // SMW 1.5+
 161+ $display_location = $row[0]->getResultSubject();
 162+ else
 163+ $display_location = $row[0];
 164+ if (property_exists($display_location, 'display_options') && is_array($display_location->display_options)) {
 165+ $display_options = $display_location->display_options;
 166+ if (array_key_exists('icon', $display_options)) {
 167+ $icon = $display_options['icon'];
 168+
 169+ // This is somewhat of a hack - if a legend label has been set, we're getting it for every point, instead of just once per icon
 170+ if (array_key_exists('legend label', $display_options)) {
 171+
 172+ $legend_label = $display_options['legend label'];
 173+
 174+ if (! array_key_exists($icon, $legend_labels)) {
 175+ $legend_labels[$icon] = $legend_label;
 176+ }
 177+ }
 178+ }
 179+ // Icon can be set even for regular, non-compound queries If it is, though, we have to translate the name into a URL here
 180+ } elseif (array_key_exists('icon', $this->m_params)) {
 181+
 182+ $icon_title = Title::newFromText($this->m_params['icon']);
 183+ $icon_image_page = new ImagePage($icon_title);
 184+ $icon = $icon_image_page->getDisplayedFile()->getURL();
 185+ }
 186+
 187+ return $icon;
 188+ }
 189+
 190+ private function manageMapProperties($mapProperties) {
 191+ global $egMapsServices;
 192+
 193+ $mapProperties = MapsMapper::getValidParams($mapProperties, $egMapsServices[$this->serviceName]['parameters']);
 194+ $mapProperties = MapsMapper::setDefaultParValues($mapProperties, $this->defaultParams);
 195+
 196+ if (isset($this->serviceName)) $mapProperties['service'] = $this->serviceName;
 197+
 198+ // Go through the array with map parameters and create new variables
 199+ // with the name of the key and value of the item if they don't exist on class level yet.
 200+ foreach($mapProperties as $paramName => $paramValue) {
 201+ if (!property_exists(__CLASS__, $paramName)) {
 202+ $this->{$paramName} = $paramValue;
 203+ }
 204+ }
 205+
 206+ MapsMapper::enforceArrayValues($this->controls);
 207+ }
 208+
 209+ /**
 210+ * Sets the zoom level to the provided value, or when not set, to the default.
 211+ *
 212+ */
 213+ private function setZoom() {
 214+ if (strlen($this->zoom) < 1) {
 215+ if (count($this->m_locations) > 1) {
 216+ $this->zoom = 'null';
 217+ }
 218+ else {
 219+ $this->zoom = $this->defaultZoom;
 220+ }
 221+ }
 222+ }
 223+
 224+ /**
 225+ * Sets the $centre_lat and $centre_lon fields.
 226+ * Note: this needs to be done AFTRE the maker coordinates are set.
 227+ *
 228+ */
 229+ private function setCentre() {
 230+ // If a centre value is set, use it.
 231+ if (strlen($this->centre) > 0) {
 232+ // Geocode and convert if required.
 233+ $centre = MapsGeocodeUtils::attemptToGeocode($this->centre, $this->geoservice, $this->serviceName);
 234+ $centre = MapsUtils::getLatLon($centre);
 235+
 236+ $this->centre_lat = $centre['lat'];
 237+ $this->centre_lon = $centre['lon'];
 238+ }
 239+ elseif (count($this->m_locations) > 1) {
 240+ // If centre is not set, and there are multiple points, set the values to null, to be auto determined by the JS of the mapping API.
 241+ $this->centre_lat = 'null';
 242+ $this->centre_lon = 'null';
 243+ }
 244+ else {
 245+ // If centre is not set and there is exactelly one marker, use it's coordinates.
 246+ $this->centre_lat = $this->m_locations[0][0];
 247+ $this->centre_lon = $this->m_locations[0][1];
 248+ }
 249+ }
 250+
 251+ /**
 252+ * Sets the $mapName field, using the $elementNamePrefix and $elementNr.
 253+ *
 254+ */
 255+ protected function setMapName() {
 256+ $this->mapName = $this->elementNamePrefix.'_'.$this->elementNr;
 257+ }
 258+
 259+ public final function getName() {
 260+ return wfMsg('maps_' . $this->serviceName);
 261+ }
 262+
 263+}
Index: tags/extensions/SemanticMaps/REL_0_4_1/QueryPrinters/SM_Mapper.php
@@ -0,0 +1,55 @@
 2+<?php
 3+
 4+/**
 5+ * General map query printer class
 6+ *
 7+ * @file SM_Mapper.php
 8+ * @ingroup SemanticMaps
 9+ *
 10+ * @author Jeroen De Dauw
 11+ */
 12+
 13+if( !defined( 'MEDIAWIKI' ) ) {
 14+ die( 'Not an entry point.' );
 15+}
 16+
 17+final class SMMapper {
 18+
 19+ private $queryPrinter;
 20+
 21+ public function __construct($format, $inline) {
 22+ global $egMapsDefaultServices, $egMapsServices;
 23+
 24+ // TODO: allow service parameter to override the default
 25+ if ($format == 'map') $format = $egMapsDefaultServices['qp'];
 26+
 27+ $service = MapsMapper::getValidService($format, 'qp');
 28+
 29+ $this->queryPrinter = new $egMapsServices[$service]['qp']['class']($format, $inline);
 30+ }
 31+
 32+ public static function getAliases() {
 33+ return $this->queryPrinter->getAliases();
 34+ }
 35+
 36+ public static function setAliases() {
 37+ return $this->queryPrinter->setAliases();
 38+ }
 39+
 40+ public function getName() {
 41+ return wfMsg('maps_map');
 42+ }
 43+
 44+ public function getQueryMode($context) {
 45+ return $this->queryPrinter->getQueryMode($context);
 46+ }
 47+
 48+ public function getResult($results, $params, $outputmode) {
 49+ return $this->queryPrinter->getResult($results, $params, $outputmode);
 50+ }
 51+
 52+ protected function getResultText($res, $outputmode) {
 53+ return $this->queryPrinter->getResultText($res, $outputmode);
 54+ }
 55+
 56+}
Index: tags/extensions/SemanticMaps/REL_0_4_1/GoogleMaps/SM_GoogleMapsFunctions.js
@@ -0,0 +1,64 @@
 2+ /**
 3+ * Javascript functions for Google Maps functionallity in Semantic Maps
 4+ *
 5+ * @file SM_GoogleMapFunctions.js
 6+ * @ingroup SMGoogleMaps
 7+ *
 8+ * @author Jeroen De Dauw
 9+ */
 10+
 11+/**
 12+ * This function holds spesific functionallity for the Google Maps form input of Semantic Maps
 13+ * TODO: Refactor as much code as possible to non specific functions
 14+ */
 15+function makeFormInputGoogleMap(mapName, locationFieldName, width, height, lat, lon, zoom, type, types, controls, scrollWheelZoom, marker_lat, marker_lon) {
 16+ if (GBrowserIsCompatible()) { // TODO: This function should probably be used after the loading of the G Maps API
 17+ var map = createGoogleMap(document.getElementById(mapName), new GSize(width, height), new GLatLng(lat, lon), zoom, type, types, controls, scrollWheelZoom, [getGMarkerData(marker_lat, marker_lon, '', '', '')]);
 18+
 19+ // Show a starting marker only if marker coordinates are provided
 20+ if (marker_lat != null && marker_lon != null) {
 21+ map.addOverlay(new GMarker(new GLatLng(marker_lat, marker_lon)));
 22+ }
 23+
 24+ // Click event handler for updating the location of the marker
 25+ GEvent.addListener(map, "click",
 26+ function(overlay, point) {
 27+ if (overlay) {
 28+ map.removeOverlay(overlay);
 29+ } else {
 30+ map.clearOverlays();
 31+ document.getElementById(locationFieldName).value = convertLatToDMS(point.y)+', '+convertLngToDMS(point.x);
 32+ map.addOverlay(new GMarker(point));
 33+ map.panTo(point);
 34+ }
 35+ }
 36+ );
 37+
 38+ // Make the map variable available for other functions
 39+ if (!window.GMaps) window.GMaps = new Object;
 40+ eval("window.GMaps." + mapName + " = map;");
 41+ }
 42+}
 43+
 44+/**
 45+ * This function holds spesific functionallity for the Google Maps form input of Semantic Maps
 46+ */
 47+function showGAddress(address, mapName, outputElementName, notFoundFormat) {
 48+ var map = GMaps[mapName];
 49+ var geocoder = new GClientGeocoder();
 50+
 51+ geocoder.getLatLng(address,
 52+ function(point) {
 53+ if (!point) {
 54+ window.alert(address + ' ' + notFoundFormat);
 55+ } else {
 56+ map.clearOverlays();
 57+ map.setCenter(point, 14);
 58+ var marker = new GMarker(point);
 59+ map.addOverlay(marker);
 60+ document.getElementById(outputElementName).value = convertLatToDMS(point.y) + ', ' + convertLngToDMS(point.x);
 61+ }
 62+ }
 63+ );
 64+
 65+}
\ No newline at end of file
Index: tags/extensions/SemanticMaps/REL_0_4_1/GoogleMaps/SM_GoogleMaps.php
@@ -0,0 +1,24 @@
 2+<?php
 3+
 4+/**
 5+ * This groupe contains all Google Maps related files of the Semantic Maps extension.
 6+ *
 7+ * @defgroup SMGoogleMaps Google Maps
 8+ * @ingroup SemanticMaps
 9+ */
 10+
 11+/**
 12+ * This file holds the general information for the Google Maps service.
 13+ *
 14+ * @file SM_GoogleMaps.php
 15+ * @ingroup SMGoogleMaps
 16+ *
 17+ * @author Jeroen De Dauw
 18+ */
 19+
 20+if( !defined( 'MEDIAWIKI' ) ) {
 21+ die( 'Not an entry point.' );
 22+}
 23+
 24+$egMapsServices['googlemaps']['qp'] = array('class' => 'SMGoogleMapsQP', 'file' => 'SemanticMaps/GoogleMaps/SM_GoogleMapsQP.php', 'local' => false);
 25+$egMapsServices['googlemaps']['fi'] = array('class' => 'SMGoogleMapsFormInput', 'file' => 'SemanticMaps/GoogleMaps/SM_GoogleMapsFormInput.php', 'local' => false);
\ No newline at end of file
Index: tags/extensions/SemanticMaps/REL_0_4_1/GoogleMaps/SM_GoogleMapsQP.php
@@ -0,0 +1,100 @@
 2+<?php
 3+/**
 4+ * A query printer for maps using the Google Maps API
 5+ *
 6+ * @file SM_GoogleMaps.php
 7+ * @ingroup SMGoogleMaps
 8+ *
 9+ * @author Robert Buzink
 10+ * @author Yaron Koren
 11+ * @author Jeroen De Dauw
 12+ */
 13+
 14+if( !defined( 'MEDIAWIKI' ) ) {
 15+ die( 'Not an entry point.' );
 16+}
 17+
 18+final class SMGoogleMapsQP extends SMMapPrinter {
 19+
 20+ public $serviceName = MapsGoogleMapsUtils::SERVICE_NAME;
 21+
 22+ /**
 23+ * @see SMMapPrinter::setQueryPrinterSettings()
 24+ *
 25+ */
 26+ protected function setQueryPrinterSettings() {
 27+ global $egMapsGoogleMapsZoom, $egMapsGoogleMapsPrefix;
 28+
 29+ $this->elementNamePrefix = $egMapsGoogleMapsPrefix;
 30+
 31+ $this->defaultZoom = $egMapsGoogleMapsZoom;
 32+
 33+ $this->defaultParams = MapsGoogleMapsUtils::getDefaultParams();
 34+ }
 35+
 36+ /**
 37+ * @see SMMapPrinter::doMapServiceLoad()
 38+ *
 39+ */
 40+ protected function doMapServiceLoad() {
 41+ global $egGoogleMapsOnThisPage;
 42+
 43+ if (empty($egGoogleMapsOnThisPage)) {
 44+ $egGoogleMapsOnThisPage = 0;
 45+ MapsGoogleMapsUtils::addGMapDependencies($this->output);
 46+ }
 47+
 48+ $egGoogleMapsOnThisPage++;
 49+
 50+ $this->elementNr = $egGoogleMapsOnThisPage;
 51+ }
 52+
 53+ /**
 54+ * @see SMMapPrinter::getQueryResult()
 55+ *
 56+ */
 57+ protected function addSpecificMapHTML() {
 58+ global $wgJsMimeType;
 59+
 60+ $enableEarth = MapsGoogleMapsUtils::getEarthValue($this->earth);
 61+
 62+ // Get the Google Maps names for the control and map types
 63+ $this->type = MapsGoogleMapsUtils::getGMapType($this->type, true);
 64+
 65+ $this->controls = MapsGoogleMapsUtils::createControlsString($this->controls);
 66+
 67+ $this->autozoom = MapsGoogleMapsUtils::getAutozoomJSValue($this->autozoom);
 68+
 69+ $markerItems = array();
 70+
 71+ foreach ($this->m_locations as $location) {
 72+ list($lat, $lon, $title, $label, $icon) = $location;
 73+
 74+ $title = str_replace("'", "\'", $title);
 75+ $label = str_replace("'", "\'", $label);
 76+
 77+ $markerItems[] = "getGMarkerData($lat, $lon, '$title', '$label', '$icon')";
 78+ }
 79+
 80+ // Create a string containing the marker JS
 81+ $markersString = implode(',', $markerItems);
 82+
 83+ $this->types = explode(",", $this->types);
 84+
 85+ $typesString = MapsGoogleMapsUtils::createTypesString($this->types, $enableEarth);
 86+
 87+ $this->output .= <<<END
 88+<div id="$this->mapName" class="$this->class" style="$this->style" ></div>
 89+<script type="$wgJsMimeType"> /*<![CDATA[*/
 90+addOnloadHook(
 91+ initializeGoogleMap('$this->mapName', $this->width, $this->height, $this->centre_lat, $this->centre_lon, $this->zoom, $this->type, [$typesString], [$this->controls], $this->autozoom, [$markersString])
 92+);
 93+/*]]>*/ </script>
 94+
 95+END;
 96+
 97+ }
 98+
 99+
 100+}
 101+
Index: tags/extensions/SemanticMaps/REL_0_4_1/GoogleMaps/SM_GoogleMapsFormInput.php
@@ -0,0 +1,107 @@
 2+<?php
 3+
 4+/**
 5+ * A class that holds static helper functions and extension hooks for the Google Maps service
 6+ *
 7+ * @file SM_GoogleMapsFormInput.php
 8+ * @ingroup SMGoogleMaps
 9+ *
 10+ * @author Robert Buzink
 11+ * @author Yaron Koren
 12+ * @author Jeroen De Dauw
 13+ */
 14+
 15+if( !defined( 'MEDIAWIKI' ) ) {
 16+ die( 'Not an entry point.' );
 17+}
 18+
 19+final class SMGoogleMapsFormInput extends SMFormInput {
 20+
 21+ public $serviceName = MapsGoogleMapsUtils::SERVICE_NAME;
 22+
 23+ /**
 24+ * @see MapsMapFeature::setMapSettings()
 25+ *
 26+ */
 27+ protected function setMapSettings() {
 28+ global $egMapsGoogleMapsZoom, $egMapsGoogleMapsPrefix;
 29+
 30+ $this->elementNamePrefix = $egMapsGoogleMapsPrefix;
 31+ $this->showAddresFunction = 'showGAddress';
 32+
 33+ $this->earthZoom = 1;
 34+
 35+ $this->defaultParams = MapsGoogleMapsUtils::getDefaultParams();
 36+ $this->defaultZoom = $egMapsGoogleMapsZoom;
 37+ }
 38+
 39+ /**
 40+ * @see MapsMapFeature::addFormDependencies()
 41+ *
 42+ */
 43+ protected function addFormDependencies() {
 44+ global $wgJsMimeType;
 45+ global $smgScriptPath, $smgGoogleFormsOnThisPage;
 46+
 47+ MapsGoogleMapsUtils::addGMapDependencies($this->output);
 48+
 49+ if (empty($smgGoogleFormsOnThisPage)) {
 50+ $smgGoogleFormsOnThisPage = 0;
 51+ $this->output .= "<script type='$wgJsMimeType' src='$smgScriptPath/GoogleMaps/SM_GoogleMapsFunctions.js'></script>";
 52+ }
 53+ }
 54+
 55+ /**
 56+ * @see MapsMapFeature::doMapServiceLoad()
 57+ *
 58+ */
 59+ protected function doMapServiceLoad() {
 60+ global $egGoogleMapsOnThisPage, $smgGoogleFormsOnThisPage;
 61+
 62+ self::addFormDependencies();
 63+
 64+ $egGoogleMapsOnThisPage++;
 65+ $smgGoogleFormsOnThisPage++;
 66+
 67+ $this->elementNr = $egGoogleMapsOnThisPage;
 68+ }
 69+
 70+ /**
 71+ * @see MapsMapFeature::addSpecificFormInputHTML()
 72+ *
 73+ */
 74+ protected function addSpecificMapHTML() {
 75+ global $wgJsMimeType;
 76+
 77+ $enableEarth = MapsGoogleMapsUtils::getEarthValue($this->earth);
 78+
 79+ $this->autozoom = MapsGoogleMapsUtils::getAutozoomJSValue($this->autozoom);
 80+
 81+ $this->type = MapsGoogleMapsUtils::getGMapType($this->type, true);
 82+
 83+ $this->controls = MapsGoogleMapsUtils::createControlsString($this->controls);
 84+
 85+ $this->types = explode(",", $this->types);
 86+
 87+ $typesString = MapsGoogleMapsUtils::createTypesString($this->types, $enableEarth);
 88+
 89+ $this->output .= "
 90+ <div id='".$this->mapName."' class='".$this->class."'></div>
 91+
 92+ <script type='$wgJsMimeType'>/*<![CDATA[*/
 93+ addOnloadHook(makeFormInputGoogleMap('$this->mapName', '$this->coordsFieldName', $this->width, $this->height, $this->centre_lat, $this->centre_lon, $this->zoom, $this->type, [$typesString], [$this->controls], $this->autozoom, $this->marker_lat, $this->marker_lon));
 94+ window.unload = GUnload;
 95+ /*]]>*/</script>";
 96+ }
 97+
 98+ /**
 99+ * @see SMFormInput::manageGeocoding()
 100+ *
 101+ */
 102+ protected function manageGeocoding() {
 103+ global $egGoogleMapsKey;
 104+ $this->enableGeocoding = strlen(trim($egGoogleMapsKey)) > 0;
 105+ if ($this->enableGeocoding) MapsGoogleMapsUtils::addGMapDependencies($this->output);
 106+ }
 107+
 108+}
Index: tags/extensions/SemanticMaps/REL_0_4_1/README
@@ -0,0 +1,23 @@
 2+== About ==
 3+
 4+Semantic Maps is an extension that adds semantic capabilities to the Maps extension, and
 5+therefore provides the ability to add, view and edit coordinate data stored through the
 6+Semantic MediaWiki extension.
 7+
 8+Due to it's unique structure, it allows you to use multiple mapping services to display
 9+your coordinates. These include Google Maps, Yahoo! Maps, OpenLayers, and also allow you to
 10+display maps with Google Earth, OpenStreetMaps, Bing maps and others. Modifying the mapping
 11+service of a map is as easy as changing a single parameter! Examples of how to use Semantic
 12+Maps can be found here.
 13+
 14+Both Semantic Maps and Maps are based on Semantic Google Maps and Semantic Layers, and are
 15+meant to replace these extensions.
 16+
 17+Having Semantic MediaWiki and Maps installed is a prerequisite for the Semantic Maps extension;
 18+the code will not work without it.
 19+
 20+Notes on installing Semantic Maps are found in the file INSTALL.
 21+
 22+== Contributors ==
 23+
 24+http://www.mediawiki.org/wiki/Extension:Semantic_Maps#Contributing_to_the_project

Status & tagging log