]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Mapstraction/map.php
Added README
[quix0rs-gnu-social.git] / plugins / Mapstraction / map.php
index 89723f43ce78a6a4eb0584f038b67bf3c015f535..7dab8e10a9bd0b154e69976275fdbb291f56847c 100644 (file)
@@ -38,6 +38,7 @@ if (!defined('STATUSNET')) {
  * @package  StatusNet
  * @author   Evan Prodromou <evan@status.net>
  * @author   Craig Andrews <candrews@integralblue.com>
+ * @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/
  */
@@ -69,14 +70,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;
         }
 
@@ -128,12 +129,9 @@ class MapAction extends OwnerDesignAction
             }
         }
 
-        $this->elementStart('script', array('type' => 'text/javascript'));
-        $this->raw('/*<![CDATA[*/'); // XHTML compat for Safari
-        $this->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 +143,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);