X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FMapstraction%2Fmap.php;h=dbba4edd0cbd7a11c904c60e4ba307d1bf4f5e3b;hb=5bf0c9f610d2fe7852ffafbcd51436c9e057b0a7;hp=89723f43ce78a6a4eb0584f038b67bf3c015f535;hpb=2acdfff58b1ae7e6f9ed6eb9b65cdf97472289b5;p=quix0rs-gnu-social.git diff --git a/plugins/Mapstraction/map.php b/plugins/Mapstraction/map.php index 89723f43ce..dbba4edd0c 100644 --- a/plugins/Mapstraction/map.php +++ b/plugins/Mapstraction/map.php @@ -38,10 +38,10 @@ if (!defined('STATUSNET')) { * @package StatusNet * @author Evan Prodromou * @author Craig Andrews + * @copyright 2009 Free Software Foundation, Inc http://www.fsf.org * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ - class MapAction extends OwnerDesignAction { var $profile = null; @@ -53,7 +53,7 @@ class MapAction extends OwnerDesignAction parent::prepare($args); $nickname_arg = $this->arg('nickname'); - $nickname = common_canonical_nickname($nickname_arg); + $nickname = Nickname::normalize($nickname_arg); // Permanent redirect on non-canonical nickname @@ -69,14 +69,14 @@ class MapAction extends OwnerDesignAction $this->user = User::staticGet('nickname', $nickname); if (!$this->user) { - $this->clientError(_('No such user.'), 404); + $this->clientError(_m('No such user.'), 404); return false; } $this->profile = $this->user->getProfile(); if (!$this->profile) { - $this->serverError(_('User has no profile.')); + $this->serverError(_m('User has no profile.')); return false; } @@ -115,7 +115,6 @@ class MapAction extends OwnerDesignAction * * @return boolean event handler return */ - function showScripts() { parent::showScripts(); @@ -128,12 +127,9 @@ class MapAction extends OwnerDesignAction } } - $this->elementStart('script', array('type' => 'text/javascript')); - $this->raw('/*raw('var _notices = ' . json_encode($jsonArray).'; '); - $this->raw('showMapstraction($("#map_canvas"),_notices);'); - $this->raw('/*]]>*/'); // XHTML compat for Safari - $this->elementEnd('script'); + $this->inlineScript('$(document).ready(function() { '. + ' var _notices = ' . json_encode($jsonArray).'; ' . + 'showMapstraction($("#map_canvas"), _notices); });'); return true; } @@ -145,8 +141,6 @@ class MapAction extends OwnerDesignAction // of refactoring from within a plugin, so I'm just abusing // the ApiAction method. Don't do this unless you're me! - require_once(INSTALLDIR.'/lib/api.php'); - $act = new ApiAction('/dev/null'); $arr = $act->twitterStatusArray($notice, true);