Fix: disable code making jmobile crazy.

This commit is contained in:
Laurent Destailleur
2013-12-31 10:48:15 +01:00
parent cfb791c584
commit e142bd252d
3 changed files with 62 additions and 45 deletions

View File

@@ -4381,20 +4381,23 @@ function printCommonFooter($zone='private')
if (! empty($conf->global->MAIN_HTML_FOOTER)) print $conf->global->MAIN_HTML_FOOTER."\n";
// Google Analytics (need Google module)
if (! empty($conf->global->MAIN_GOOGLE_AN_ID))
if (! empty($conf->google->enabled) && ! empty($conf->global->MAIN_GOOGLE_AN_ID))
{
print "\n";
print '<script type="text/javascript">'."\n";
print ' var _gaq = _gaq || [];'."\n";
print ' _gaq.push([\'_setAccount\', \''.$conf->global->MAIN_GOOGLE_AN_ID.'\']);'."\n";
print ' _gaq.push([\'_trackPageview\']);'."\n";
print ''."\n";
print ' (function() {'."\n";
print ' var ga = document.createElement(\'script\'); ga.type = \'text/javascript\'; ga.async = true;'."\n";
print ' ga.src = (\'https:\' == document.location.protocol ? \'https://ssl\' : \'http://www\') + \'.google-analytics.com/ga.js\';'."\n";
print ' var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(ga, s);'."\n";
print ' })();'."\n";
print '</script>'."\n";
if (empty($conf->dol_use_jmobile))
{
print "\n";
print '<script type="text/javascript">'."\n";
print ' var _gaq = _gaq || [];'."\n";
print ' _gaq.push([\'_setAccount\', \''.$conf->global->MAIN_GOOGLE_AN_ID.'\']);'."\n";
print ' _gaq.push([\'_trackPageview\']);'."\n";
print ''."\n";
print ' (function() {'."\n";
print ' var ga = document.createElement(\'script\'); ga.type = \'text/javascript\'; ga.async = true;'."\n";
print ' ga.src = (\'https:\' == document.location.protocol ? \'https://ssl\' : \'http://www\') + \'.google-analytics.com/ga.js\';'."\n";
print ' var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(ga, s);'."\n";
print ' })();'."\n";
print '</script>'."\n";
}
}
// End of tuning