]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/GoogleAnalyticsPlugin.php
Merge branch 'master' of gitorious.org:statusnet/mainline into testing
[quix0rs-gnu-social.git] / plugins / GoogleAnalyticsPlugin.php
index 87a70e31ea9acf9f90f25e5f43b8091869add2b1..c646bf113b27223a015739fdfa061f8d25fc2ce1 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Laconica, the distributed open-source microblogging tool
+ * StatusNet, the distributed open-source microblogging tool
  *
  * Plugin to use Google Analytics
  *
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *
  * @category  Plugin
- * @package   Laconica
- * @author    Evan Prodromou <evan@controlyourself.ca>
- * @copyright 2008 Control Yourself, Inc.
+ * @package   StatusNet
+ * @author    Evan Prodromou <evan@status.net>
+ * @copyright 2008 StatusNet, Inc.
  * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link      http://laconi.ca/
+ * @link      http://status.net/
  */
 
-if (!defined('LACONICA')) {
+if (!defined('STATUSNET')) {
     exit(1);
 }
 
@@ -37,13 +37,13 @@ if (!defined('LACONICA')) {
  * This plugin will spoot out the correct JavaScript spell to invoke Google Analytics on a page.
  *
  * Note that Google Analytics is not compatible with the Franklin Street Statement; consider using
- * Pikiw (http://www.pikiw.org/) instead!
+ * Piwik (http://www.piwik.org/) instead!
  *
  * @category Plugin
- * @package  Laconica
- * @author   Evan Prodromou <evan@controlyourself.ca>
+ * @package  StatusNet
+ * @author   Evan Prodromou <evan@status.net>
  * @license  http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link     http://laconi.ca/
+ * @link     http://status.net/
  *
  * @see      Event
  */
@@ -67,11 +67,19 @@ class GoogleAnalyticsPlugin extends Plugin
                        'pageTracker._trackPageview();'.
                        '} catch(err) {}',
                        $this->code);
-        $action->elementStart('script', array('type' => 'text/javascript'));
-        $action->raw($js1);
-        $action->elementEnd('script');
-        $action->elementStart('script', array('type' => 'text/javascript'));
-        $action->raw($js2);
-        $action->elementEnd('script');
+        $action->inlineScript($js1);
+        $action->inlineScript($js2);
+    }
+
+    function onPluginVersion(&$versions)
+    {
+        $versions[] = array('name' => 'GoogleAnalytics',
+                            'version' => STATUSNET_VERSION,
+                            'author' => 'Evan Prodromou',
+                            'homepage' => 'http://status.net/wiki/Plugin:GoogleAnalytics',
+                            'rawdescription' =>
+                            _m('Use <a href="http://www.google.com/analytics/">Google Analytics</a>'.
+                               ' to track Web access.'));
+        return true;
     }
 }