]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Mapstraction/MapstractionPlugin.php
Merge branch 'master' of git.gnu.io:gnu/gnu-social into mmn_fixes
[quix0rs-gnu-social.git] / plugins / Mapstraction / MapstractionPlugin.php
index 0feeaba89e54aa1988746a5a2b98a4b465870231..ddc54bcc15339b5c8f48a21199dc594a5af37b70 100644 (file)
@@ -49,9 +49,9 @@ class MapstractionPlugin extends Plugin
     const VERSION = GNUSOCIAL_VERSION;
 
     /** provider name, one of:
-     'cloudmade', 'google', 'microsoft', 'openlayers', 'yahoo' */
+     'cloudmade', 'microsoft', 'openlayers', 'yahoo' */
     public $provider = 'openlayers';
-    /** provider API key (or 'appid'), if required ('google' and 'yahoo' only) */
+    /** provider API key (or 'appid'), if required ('yahoo' only) */
     public $apikey = null;
 
     /**
@@ -97,12 +97,8 @@ class MapstractionPlugin extends Plugin
         case 'cloudmade':
             $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',
-                                    urlencode($this->apikey)));
-            break;
         case 'microsoft':
-            $action->script((StatusNet::isHTTPS()?'https':'http') + '://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6');
+            $action->script((GNUsocial::isHTTPS()?'https':'http') + '://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6');
             break;
         case 'openlayers':
             // Use our included stripped & minified OpenLayers.
@@ -116,20 +112,10 @@ class MapstractionPlugin extends Plugin
         default:
             return true;
         }
-
-        if ($this->provider == 'openlayers') {
-            // We have an optimized path for our default case.
-            //
-            // Note that OpenLayers.js needs to be separate, or it won't
-            // be able to find its UI images and styles.
-            $action->script($this->path('usermap-mxn-openlayers.min.js'));
-        } else {
-            $action->script(sprintf('%s?(%s)',
-                                    $this->path('js/mxn.js'),
-                                    $this->provider));
-
-            $action->script($this->path('usermap.js'));
-        }
+        $action->script(sprintf('%s?(%s)',
+                                $this->path('js/mxn.js'),
+                                $this->provider));
+        $action->script($this->path('usermap.js'));
 
         $action->inlineScript(sprintf('var _provider = "%s";', $this->provider));
 
@@ -149,7 +135,7 @@ class MapstractionPlugin extends Plugin
         return true;
     }
 
-    function onEndShowSections($action)
+    function onEndShowSections(Action $action)
     {
         $actionName = $action->trimmed('action');
         // These are the ones that have maps on 'em
@@ -179,12 +165,12 @@ class MapstractionPlugin extends Plugin
         $action->elementEnd('div');
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'Mapstraction',
                             'version' => self::VERSION,
                             'author' => 'Evan Prodromou',
-                            'homepage' => 'http://status.net/wiki/Plugin:Mapstraction',
+                            'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/Mapstraction',
                             'rawdescription' =>
                             // TRANS: Plugin description.
                             _m('Show maps of users\' and friends\' notices '.