FIX Responsive errors due to boxes

This commit is contained in:
Laurent Destailleur
2016-06-22 15:09:27 +02:00
parent e29d46f421
commit f72ff5ac93
5 changed files with 46 additions and 17 deletions

View File

@@ -182,6 +182,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty"
global $langs, $user, $conf;
// Trick to get result into a var from a function that makes print instead of return
// TODO Replace ob_start with param nooutput=1 into showBox
ob_start();
$result = $this->showBox($head, $contents);
$output = ob_get_contents();
@@ -191,14 +192,14 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty"
}
/**
*Standard method to show a box (usage by boxes not mandatory, a box can still use its own showBox function)
* Standard method to show a box (usage by boxes not mandatory, a box can still use its own showBox function)
*
* @param array $head Array with properties of box title
* @param array $contents Array with properties of box lines
*
* @param int $nooutput No print, only return string
* @return void
*/
function showBox($head = null, $contents = null)
function showBox($head = null, $contents = null, $nooutput=0)
{
global $langs, $user, $conf;
@@ -242,7 +243,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty"
$out.= '>';
if ($conf->use_javascript_ajax)
{
$out.= '<table summary="" class="nobordernopadding" width="100%"><tr><td>';
$out.= '<table summary="" class="nobordernopadding" width="100%"><tr><td class="tdoverflow maxwidth300onsmartphone">';
}
if (! empty($head['text']))
{
@@ -358,13 +359,16 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty"
}
} else {
dol_syslog(get_class($this).'::showBoxCached');
$out = dol_readcachefile($cachedir, $filename);
print "<!-- Box ".get_class($this)." from cache -->";
$out = "<!-- Box ".get_class($this)." from cache -->";
$out.= dol_readcachefile($cachedir, $filename);
}
print $out;
}
if ($nooutput) return $out;
else print $out;
return '';
}
}