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,7 +4381,9 @@ function printCommonFooter($zone='private')
if (! empty($conf->global->MAIN_HTML_FOOTER)) print $conf->global->MAIN_HTML_FOOTER."\n"; if (! empty($conf->global->MAIN_HTML_FOOTER)) print $conf->global->MAIN_HTML_FOOTER."\n";
// Google Analytics (need Google module) // 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))
{
if (empty($conf->dol_use_jmobile))
{ {
print "\n"; print "\n";
print '<script type="text/javascript">'."\n"; print '<script type="text/javascript">'."\n";
@@ -4396,6 +4398,7 @@ function printCommonFooter($zone='private')
print ' })();'."\n"; print ' })();'."\n";
print '</script>'."\n"; print '</script>'."\n";
} }
}
// End of tuning // End of tuning
if (! empty($_SERVER['DOL_TUNING']) || ! empty($conf->global->MAIN_SHOW_TUNING_INFO)) if (! empty($_SERVER['DOL_TUNING']) || ! empty($conf->global->MAIN_SHOW_TUNING_INFO))

View File

@@ -206,8 +206,10 @@ if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file
?> ?>
<?php <?php
if (! empty($conf->global->MAIN_GOOGLE_AD_CLIENT) && ! empty($conf->global->MAIN_GOOGLE_AD_SLOT)) if (! empty($conf->google->enabled) && ! empty($conf->global->MAIN_GOOGLE_AD_CLIENT) && ! empty($conf->global->MAIN_GOOGLE_AD_SLOT))
{ {
if (empty($conf->dol_use_jmobile))
{
?> ?>
<div align="center"><br> <div align="center"><br>
<script type="text/javascript"><!-- <script type="text/javascript"><!--
@@ -222,6 +224,7 @@ if (! empty($conf->global->MAIN_GOOGLE_AD_CLIENT) && ! empty($conf->global->MAIN
</script> </script>
</div> </div>
<?php <?php
}
} }
?> ?>

View File

@@ -308,7 +308,7 @@ llxHeaderVierge($langs->trans("DolibarrDemo"), $head);
print "\n"; print "\n";
print '<table style="font-size:14px;" summary="List of Dolibarr demos">'; print '<table style="font-size:14px;" summary="Main table for Dolibarr demos">';
print '<tr><td>'; print '<tr><td>';
print '<center><img src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.png" alt="Dolibarr logo"></center><br>'; print '<center><img src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.png" alt="Dolibarr logo"></center><br>';
@@ -319,9 +319,9 @@ print '<br>';
print '<font color="#555577"><b>'.$langs->trans("ChooseYourDemoProfil").'</b></font>'; print '<font color="#555577"><b>'.$langs->trans("ChooseYourDemoProfil").'</b></font>';
print '</td></tr>'; print '</td></tr>';
print '<tr><td width="50%">'; print '<tr><td>';
print '<table style="font-size:14px;" width="100%" summary="List of Dolibarr demos">'."\n"; //print '<table width="100%" summary="List of Dolibarr demos" class="notopnoleft">'."\n";
$i=0; $i=0;
foreach ($demoprofiles as $profilearray) foreach ($demoprofiles as $profilearray)
{ {
@@ -339,8 +339,8 @@ foreach ($demoprofiles as $profilearray)
if (! empty($profilearray['url'])) $urlwithmod=$profilearray['url']; if (! empty($profilearray['url'])) $urlwithmod=$profilearray['url'];
//if ($i % $NBOFCOLS == 0) print '<tr>'; //if ($i % $NBOFCOLS == 0) print '<tr>';
print '<tr>'; //print '<tr>';
print '<td>'."\n"; //print '<td>'."\n";
print '<form method="POST" name="form'.$profilearray['key'].'" action="'.$_SERVER["PHP_SELF"].'">'."\n"; print '<form method="POST" name="form'.$profilearray['key'].'" action="'.$_SERVER["PHP_SELF"].'">'."\n";
print '<input type="hidden" name="action" value="gotodemo">'."\n"; print '<input type="hidden" name="action" value="gotodemo">'."\n";
@@ -352,6 +352,7 @@ foreach ($demoprofiles as $profilearray)
print '<input type="hidden" name="dol_optimize_smallscreen" value="'.$conf->dol_optimize_smallscreen.'">'."\n"; print '<input type="hidden" name="dol_optimize_smallscreen" value="'.$conf->dol_optimize_smallscreen.'">'."\n";
print '<input type="hidden" name="dol_no_mouse_hover" value="'.$conf->dol_no_mouse_hover.'">'."\n"; print '<input type="hidden" name="dol_no_mouse_hover" value="'.$conf->dol_no_mouse_hover.'">'."\n";
print '<input type="hidden" name="dol_use_jmobile" value="'.$conf->dol_use_jmobile.'">'."\n"; print '<input type="hidden" name="dol_use_jmobile" value="'.$conf->dol_use_jmobile.'">'."\n";
print '<table summary="Dolibarr online demonstration for profile '.$profilearray['label'].'" style="font-size:14px;" width="100%" class="CTable CTableRow'.($i%2==0?'1':'0').'">'."\n"; print '<table summary="Dolibarr online demonstration for profile '.$profilearray['label'].'" style="font-size:14px;" width="100%" class="CTable CTableRow'.($i%2==0?'1':'0').'">'."\n";
// Title // Title
print '<tr>'; print '<tr>';
@@ -366,7 +367,8 @@ foreach ($demoprofiles as $profilearray)
print $langs->trans("ThisIsListOfModules").'<br>'; print $langs->trans("ThisIsListOfModules").'<br>';
print '<table width="100%">'; print '<table width="100%">';
$listofdisabledmodules=explode(',',$profilearray['disablemodules']); $listofdisabledmodules=explode(',',$profilearray['disablemodules']);
$j=0;$nbcolsmod=4; $j=0;
$nbcolsmod=empty($conf->dol_optimize_smallscreen)?4:3;
foreach($modules as $val) // Loop on qualified (enabled) modules foreach($modules as $val) // Loop on qualified (enabled) modules
{ {
$modulekeyname=strtolower($val->name); $modulekeyname=strtolower($val->name);
@@ -402,15 +404,16 @@ foreach ($demoprofiles as $profilearray)
print '<tr id="tr2'.$profilearray['key'].'" class="moduleline"><td colspan="'.$nbcolsmod.'" align="center"><input type="submit" value=" &nbsp; &nbsp; '.$langs->trans("Start").' &nbsp; &nbsp; " class="button"></td></tr>'; print '<tr id="tr2'.$profilearray['key'].'" class="moduleline"><td colspan="'.$nbcolsmod.'" align="center"><input type="submit" value=" &nbsp; &nbsp; '.$langs->trans("Start").' &nbsp; &nbsp; " class="button"></td></tr>';
} }
print '</table></form>'."\n"; print '</table>';
print '</form>'."\n";
print '</td>'; //print '</td>';
//if ($i % $NBOFCOLS == ($NBOFCOLS-1)) print '</tr>'."\n"; //if ($i % $NBOFCOLS == ($NBOFCOLS-1)) print '</tr>'."\n";
print '</tr>'."\n"; //print '</tr>'."\n";
$i++; $i++;
} }
} }
print '</table>'; //print '</table>';
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
@@ -423,9 +426,12 @@ print '</td></tr>';
print '</table>'; print '</table>';
// TODO Replace this with a hook
// Google Adsense (need Google module) // Google Adsense (need Google module)
if (! empty($conf->global->MAIN_GOOGLE_AD_CLIENT) && ! empty($conf->global->MAIN_GOOGLE_AD_SLOT)) if (! empty($conf->google->enabled) && ! empty($conf->global->MAIN_GOOGLE_AD_CLIENT) && ! empty($conf->global->MAIN_GOOGLE_AD_SLOT))
{ {
if (empty($conf->dol_use_jmobile))
{
print '<div align="center">'."\n"; print '<div align="center">'."\n";
print '<script type="text/javascript"><!--'."\n"; print '<script type="text/javascript"><!--'."\n";
print 'google_ad_client = "'.$conf->global->MAIN_GOOGLE_AD_CLIENT.'";'."\n"; print 'google_ad_client = "'.$conf->global->MAIN_GOOGLE_AD_CLIENT.'";'."\n";
@@ -438,6 +444,11 @@ if (! empty($conf->global->MAIN_GOOGLE_AD_CLIENT) && ! empty($conf->global->MAIN
print 'src="http://pagead2.googlesyndication.com/pagead/show_ads.js">'."\n"; print 'src="http://pagead2.googlesyndication.com/pagead/show_ads.js">'."\n";
print '</script>'."\n"; print '</script>'."\n";
print '</div>'."\n"; print '</div>'."\n";
}
else
{
print '<!-- google js addvert tag disabled with jmobile -->'."\n";
}
} }
llxFooterVierge(); llxFooterVierge();