diff options
author | Craig Andrews <candrews@integralblue.com> | 2009-12-04 19:41:51 -0500 |
---|---|---|
committer | Craig Andrews <candrews@integralblue.com> | 2009-12-04 19:41:51 -0500 |
commit | 4c8bed8ba0558c5834621331f253e05029fa4e43 (patch) | |
tree | 796607aa0a8b6a7ce4ef73090a8b255a6b2bacdd /plugins/PiwikAnalyticsPlugin.php | |
parent | aab7344002fd390e5b62a3eb82f3a418fd294617 (diff) |
Use inlineScript() everywhere inline scripts are written
Diffstat (limited to 'plugins/PiwikAnalyticsPlugin.php')
-rw-r--r-- | plugins/PiwikAnalyticsPlugin.php | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/plugins/PiwikAnalyticsPlugin.php b/plugins/PiwikAnalyticsPlugin.php index 54faa0bdb..fefd09867 100644 --- a/plugins/PiwikAnalyticsPlugin.php +++ b/plugins/PiwikAnalyticsPlugin.php @@ -81,25 +81,20 @@ class PiwikAnalyticsPlugin extends Plugin function onEndShowScripts($action) { - $piwikCode = <<<ENDOFPIWIK - -<!-- Piwik --> -<script type="text/javascript"> + $piwikCode1 = <<<ENDOFPIWIK var pkBaseURL = (("https:" == document.location.protocol) ? "https://{$this->piwikroot}" : "http://{$this->piwikroot}"); document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E")); -</script> -<script type="text/javascript"> +ENDOFPIWIK; + $piwikCode2 = <<<ENDOFPIWIK try { var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", {$this->piwikId}); piwikTracker.trackPageView(); piwikTracker.enableLinkTracking(); } catch( err ) {} -</script> -<!-- End Piwik Tag --> - ENDOFPIWIK; - $action->raw($piwikCode); + $action->inlineScript($piwikCode1); + $action->inlineScript($piwikCode2); return true; } } |