]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Mapstraction/MapstractionPlugin.php
TinyMCE: counter support (may not be 100% exact match to server-side count, but there...
[quix0rs-gnu-social.git] / plugins / Mapstraction / MapstractionPlugin.php
index 93679e56c24496a7abae456048ddd066f62d3284..e7240a64497adbe749b48c35cb0c99f2dc6bd923 100644 (file)
@@ -47,6 +47,8 @@ if (!defined('STATUSNET')) {
 
 class MapstractionPlugin extends Plugin
 {
+    const VERSION = STATUSNET_VERSION;
+
     /** provider name, one of:
      'cloudmade', 'google', 'microsoft', 'openlayers', 'yahoo' */
     public $provider = 'openlayers';
@@ -123,8 +125,8 @@ class MapstractionPlugin extends Plugin
             $action->script('http://tile.cloudmade.com/wml/0.2/web-maps-lite.js');
             break;
         case 'google':
-            $action->script(sprintf('http://maps.google.com/maps?file=api&v=2&sensor=false&key=%s',
-                                    $this->apikey));
+            $action->script(sprintf('http://maps.google.com/maps?file=api&v=2&sensor=false&key=%s',
+                                    urlencode($this->apikey)));
             break;
         case 'microsoft':
             $action->script('http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6');
@@ -135,7 +137,7 @@ class MapstractionPlugin extends Plugin
             break;
         case 'yahoo':
             $action->script(sprintf('http://api.maps.yahoo.com/ajaxymap?v=3.8&appid=%s',
-                                    $this->apikey));
+                                    urlencode($this->apikey)));
             break;
         case 'geocommons': // don't support this yet
         default:
@@ -192,4 +194,17 @@ class MapstractionPlugin extends Plugin
 
         $action->elementEnd('div');
     }
+
+    function onPluginVersion(&$versions)
+    {
+        $versions[] = array('name' => 'Mapstraction',
+                            'version' => self::VERSION,
+                            'author' => 'Evan Prodromou',
+                            'homepage' => 'http://status.net/wiki/Plugin:Mapstraction',
+                            'rawdescription' =>
+                            _m('Show maps of users\' and friends\' notices '.
+                               'with <a href="http://www.mapstraction.com/">Mapstraction</a> '.
+                               'JavaScript library.'));
+        return true;
+    }
 }