X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FMapstraction%2FMapstractionPlugin.php;h=9883650206810d0dc82ea80008a17233a42651d7;hb=de55d8f83bb2ecf9461510768fe7147aec592055;hp=020c0818ad20b055b778ad830c38ebf1616c3ca2;hpb=99f3964394e18af6c139c5a1c804ced727e5b1a4;p=quix0rs-gnu-social.git diff --git a/plugins/Mapstraction/MapstractionPlugin.php b/plugins/Mapstraction/MapstractionPlugin.php index 020c0818ad..9883650206 100644 --- a/plugins/Mapstraction/MapstractionPlugin.php +++ b/plugins/Mapstraction/MapstractionPlugin.php @@ -74,29 +74,6 @@ class MapstractionPlugin extends Plugin return true; } - /** - * Hook for autoloading classes - * - * This makes sure our classes get autoloaded from our directory - * - * @param string $cls name of class being used - * - * @return boolean event handler return - */ - function onAutoload($cls) - { - switch ($cls) - { - case 'AllmapAction': - case 'UsermapAction': - case 'MapAction': - include_once INSTALLDIR.'/plugins/Mapstraction/' . strtolower(mb_substr($cls, 0, -6)) . '.php'; - return false; - default: - return true; - } - } - /** * Hook for adding extra JavaScript * @@ -125,11 +102,11 @@ class MapstractionPlugin extends Plugin urlencode($this->apikey))); break; case 'microsoft': - $action->script('http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6'); + $action->script((StatusNet::isHTTPS()?'https':'http') + '://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6'); break; case 'openlayers': // Use our included stripped & minified OpenLayers. - $action->script(common_path('plugins/Mapstraction/OpenLayers/OpenLayers.js')); + $action->script($this->path('OpenLayers/OpenLayers.js')); break; case 'yahoo': $action->script(sprintf('http://api.maps.yahoo.com/ajaxymap?v=3.8&appid=%s', @@ -145,13 +122,13 @@ class MapstractionPlugin extends Plugin // // Note that OpenLayers.js needs to be separate, or it won't // be able to find its UI images and styles. - $action->script(common_path('plugins/Mapstraction/usermap-mxn-openlayers.min.js')); + $action->script($this->path('usermap-mxn-openlayers.min.js')); } else { $action->script(sprintf('%s?(%s)', - common_path('plugins/Mapstraction/js/mxn.js'), + $this->path('js/mxn.js'), $this->provider)); - $action->script(common_path('plugins/Mapstraction/usermap.js')); + $action->script($this->path('usermap.js')); } $action->inlineScript(sprintf('var _provider = "%s";', $this->provider)); @@ -164,7 +141,7 @@ class MapstractionPlugin extends Plugin ' var user = null; '. (($actionName == 'showstream') ? ' user = scrapeUser(); ' : '') . ' var notices = scrapeNotices(user); ' . - ' var canvas = $("#map_canvas")[0]; ' . + ' var canvas = $("#map_canvas")[0]; ' . ' if (typeof(canvas) != "undefined") { showMapstraction(canvas, notices); } '. '});'); } @@ -184,6 +161,7 @@ class MapstractionPlugin extends Plugin $action->elementStart('div', array('id' => 'entity_map', 'class' => 'section')); + // TRANS: Header for Map widget that displays a map with geodata for notices. $action->element('h2', null, _m('Map')); $action->element('div', array('id' => 'map_canvas', @@ -196,7 +174,7 @@ class MapstractionPlugin extends Plugin $action->element('a', array('href' => $mapUrl), // TRANS: Clickable item to allow opening the map in full size. - _m("Full size")); + _m('Full size')); $action->elementEnd('div'); } @@ -208,6 +186,7 @@ class MapstractionPlugin extends Plugin 'author' => 'Evan Prodromou', 'homepage' => 'http://status.net/wiki/Plugin:Mapstraction', 'rawdescription' => + // TRANS: Plugin description. _m('Show maps of users\' and friends\' notices '. 'with Mapstraction.')); return true;