Index: trunk/extensions/OWALiteTracker/OWALiteTracker.php |
— | — | @@ -1,5 +1,5 @@ |
| 2 | +<?php |
2 | 3 | |
3 | | - |
4 | 4 | //Must come after "CentralNotice", which creates the "Geo" object |
5 | 5 | |
6 | 6 | $wgHooks['SkinAfterBottomScripts'][] = 'efOWALiteTracker'; |
— | — | @@ -9,9 +9,13 @@ |
10 | 10 | ); |
11 | 11 | |
12 | 12 | function efOWALiteTracker($skin, &$text){ |
13 | | - if( count( $wgOWAGeoTrackSites ) <= 0 ){ return; } |
| 13 | + global $wgOWAGeoTrackSites; |
| 14 | + |
| 15 | + if( !count( $wgOWAGeoTrackSites ) ) { |
| 16 | + return; |
| 17 | + } |
14 | 18 | $text .= "<script> var includeOWA = false; if(Geo){"; |
15 | | - foreach($condition in $wgOWAGeoTrackSites){ |
| 19 | + foreach( $condition as $wgOWAGeoTrackSites ){ |
16 | 20 | $text .= "if (Geo.{$condition[0]} && Geo.{$condition[0]} == \"{$condition[1]}\"){ if(!includeOWA){includeOWA=true; importScriptURI( document.location.protocol +'//owa.wikimedia.org/owa/modules/base/js/owa.tracker-combined-min.js');} importScriptURI( document.location.protocol + '//owa.wikimedia.org/resources/{$condition[2]}');}"; |
17 | 21 | } |
18 | 22 | $text .= "}</script>"; |