r46431 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r46430‎ | r46431 | r46432 >
Date:06:43, 28 January 2009
Author:emiller
Status:deferred
Tags:
Comment:
Version 0.9.4 changes:
* Remove GoogleMapsKML from list of Specialpages
* Make KML imports work when URL has ampersand
* ALT tag for static maps
* Fix undefined index warning
* New INSTALL instructions
Modified paths:
  • /trunk/extensions/GoogleMaps/GoogleMaps.body.php (modified) (history)
  • /trunk/extensions/GoogleMaps/GoogleMaps.php (modified) (history)
  • /trunk/extensions/GoogleMaps/SpecialGoogleMapsKML.php (modified) (history)
  • /trunk/extensions/GoogleMaps/export/GoogleMapsImgExporter.php (modified) (history)
  • /trunk/extensions/GoogleMaps/export/GoogleMapsJsExporter.php (modified) (history)

Diff [purge]

Index: trunk/extensions/GoogleMaps/GoogleMaps.body.php
@@ -510,7 +510,7 @@
511511 }
512512
513513 // need to create this icon, since we haven't already
514 - if( $icon && !$icons[$icon] ) {
 514+ if( $icon && !isset($icons[$icon]) ) {
515515 $exporter->addIcon($icon, $o);
516516 $icons[$icon] = true;
517517 }
@@ -681,7 +681,7 @@
682682
683683 // our defaults, in case $wgGoogleMapsDefaults isn't specified.
684684 $o = array(
685 - 'api' => 2.108,
 685+ 'api' => '2.140',
686686 'color' => '#758bc5',
687687 'controls' => 'medium',
688688 'doubleclick' => 'recenter',
Index: trunk/extensions/GoogleMaps/export/GoogleMapsImgExporter.php
@@ -15,6 +15,7 @@
1616 $width = $o['width'] > 512 ? 512 : $o['width'];
1717 $height = $o['height'] > 512 ? 512 : $o['height'];
1818 $this->mOutput .= '<img ';
 19+ $this->mOutput .= "alt=\"Map\" ";
1920 $this->mOutput .= "height=\"{$height}\" width=\"{$width}\" ";
2021 $this->mOutput .= 'src="http://maps.google.com/staticmap';
2122 $this->mOutput .= "?center={$o['lat']}%2C{$o['lon']}";
Index: trunk/extensions/GoogleMaps/export/GoogleMapsJsExporter.php
@@ -15,8 +15,7 @@
1616 function addXmlSource($url) {
1717 $url = addslashes($url);
1818 $this->mOutput .= <<<JAVASCRIPT
19 - geoxml = new GGeoXml("{$url}");
20 - map.addOverlay(geoxml);
 19+ map.addOverlay(new GGeoXml("{$url}".replace(/&amp;/g, "&".charAt(0)))); /* HACK HACK HACK */
2120 JAVASCRIPT;
2221 }
2322
Index: trunk/extensions/GoogleMaps/GoogleMaps.php
@@ -5,9 +5,9 @@
66 # Copyright Evan Miller (emmiller@gmail.com)
77 # Modifications copyright Joshua Hodge
88
9 -# Version 0.9.4a, 2 Jun 2008
 9+# Version 0.9.4, 27 Jan 2009
1010
11 -define('GOOGLE_MAPS_EXTENSION_VERSION', '0.9.4a');
 11+define('GOOGLE_MAPS_EXTENSION_VERSION', '0.9.4');
1212
1313 // if we're not in the mediawiki framework just die
1414 if( !defined( 'MEDIAWIKI' ) ) {
@@ -185,7 +185,7 @@
186186 // extension credits
187187 $wgExtensionCredits['other'][] = array(
188188 'name' => 'Google Maps Extension',
189 - 'author' => 'Evan Miller',
 189+ 'author' => '[http://www.evanmiller.org/ Evan Miller]',
190190 'version' => GOOGLE_MAPS_EXTENSION_VERSION,
191191 'url' => 'http://www.mediawiki.org/wiki/Extension:Google_Maps',
192192 'description' => 'Easily create maps with wiki-fied markers',
Index: trunk/extensions/GoogleMaps/SpecialGoogleMapsKML.php
@@ -8,6 +8,9 @@
99 // Easy links to KML files
1010
1111 class GoogleMapsKML extends SpecialPage {
 12+ function GoogleMapsKML() {
 13+ parent::SpecialPage('Google Maps KML', '', false /* listed */);
 14+ }
1215 function execute( $params ) {
1316 global $wgRequest, $wgOut, $wgTitle, $wgUser;
1417 global $wgContLang, $wgProxyKey, $wgParser;

Status & tagging log