FIX env of browser not loaded in website

This commit is contained in:
Laurent Destailleur 2020-05-15 18:41:46 +02:00
parent 4a9960797b
commit a73eccf70d

View File

@ -27,6 +27,18 @@
include_once DOL_DOCUMENT_ROOT.'/website/class/website.class.php';
include_once DOL_DOCUMENT_ROOT.'/website/class/websitepage.class.php';
// Detection browser (copy of code from main.inc.php)
if (isset($_SERVER["HTTP_USER_AGENT"]) && is_object($conf) && empty($conf->browser->name))
{
$tmp = getBrowserInfo($_SERVER["HTTP_USER_AGENT"]);
$conf->browser->name = $tmp['browsername'];
$conf->browser->os = $tmp['browseros'];
$conf->browser->version = $tmp['browserversion'];
$conf->browser->layout = $tmp['layout']; // 'classic', 'phone', 'tablet'
//var_dump($conf->browser);
if ($conf->browser->layout == 'phone') $conf->dol_no_mouse_hover = 1;
}
// Define $website
if (!is_object($website))
{