2
0
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:
Laurent Destailleur
2014-07-27 14:13:25 +02:00
parent 3d56c8ff6a
commit b964f9e9e3
14 changed files with 173 additions and 76 deletions

View File

@@ -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