forked from Wavyzz/dolibarr
New: Add info page about browser.
Qual: Removed dedicated code to change top menu according to dol_optimize_smallscreen. We must use instead size of screen into css.
This commit is contained in:
@@ -120,7 +120,7 @@ function getEntity($element=false, $shared=false)
|
||||
/**
|
||||
* Return information about user browser
|
||||
*
|
||||
* @return array Array of information ('browsername'=>,'browseros'=>,'phone'=>,'browserfirefox'=>)
|
||||
* @return array Array of information ('browsername'=>,'browseros'=>,'phone'=>,'browserversion'=>)
|
||||
*/
|
||||
function getBrowserInfo()
|
||||
{
|
||||
@@ -138,6 +138,11 @@ function getBrowserInfo()
|
||||
// MS products at end
|
||||
elseif (preg_match('/iemobile/i',$_SERVER["HTTP_USER_AGENT"])) { $os='windows'; $phone='unkown'; }
|
||||
elseif (preg_match('/windows ce/i',$_SERVER["HTTP_USER_AGENT"])) { $os='windows'; $phone='unkown'; }
|
||||
|
||||
// OS
|
||||
if (preg_match('/android/i',$_SERVER["HTTP_USER_AGENT"])) { $os='android'; }
|
||||
elseif (preg_match('/linux/i',$_SERVER["HTTP_USER_AGENT"])) { $os='linux'; }
|
||||
|
||||
// Name
|
||||
if (preg_match('/firefox(\/|\s)([\d\.]*)/i', $_SERVER["HTTP_USER_AGENT"], $reg)) { $name='firefox'; $version=$reg[2]; }
|
||||
elseif (preg_match('/chrome(\/|\s)([\d\.]+)/i', $_SERVER["HTTP_USER_AGENT"], $reg)) { $name='chrome'; $version=$reg[2]; } // we can have 'chrome (Mozilla...) chrome x.y' in one string
|
||||
|
||||
Reference in New Issue
Block a user