Author: ralfbecker
New Revision: 35141
URL: http://www.egroupware.org/viewvc/egroupware?rev=35141&view=rev
Log:
reworked mobil browser detection to use html::$ua_mobile to be in line with other html class stuff
Modified:
trunk/phpgwapi/inc/class.html.inc.php
Modified: trunk/phpgwapi/inc/class.html.inc.php
URL: http://www.egroupware.org/viewvc/egroupware/trunk/phpgwapi/inc/class.html.inc.php?rev=35141&r1=35140&r2=35141&view=diff
— trunk/phpgwapi/inc/class.html.inc.php (original)
+++ trunk/phpgwapi/inc/class.html.inc.php Fri Jun 3 09:47:11 2011
@@ -25,6 +25,11 @@
/
static $user_agent;
/*
-
- User agent is a mobile browser
-
- @var boolean
- */
- static $ua_mobile;
- /**
- version of user-agent as specified by browser
-
@var string
*/
@@ -64,6 +69,7 @@
}
list(,self::$user_agent,self::$ua_version) = $parts;
if ((self::$user_agent = strtolower(self::$user_agent)) == ‘version’) self::$user_agent = ‘opera’;
-
self::$ua_mobile = preg_match('/(iPhone|iPad|Android|SymbianOS)/',$_SERVER['HTTP_USER_AGENT']); self::$netscape4 = self::$user_agent == 'mozilla' && self::$ua_version < 5; self::$prefered_img_title = self::$netscape4 ? 'alt' : 'title';
@@ -283,6 +289,7 @@
*/
static function htmlspecialchars($str)
{
-
//if (!is_scalar($str) && !is_null($str)) error_log(__METHOD__.'('.array2string($str).') '.function_backtrace()); // as EGroupware supports only utf-8 we should not need to worry about wrong charsets return htmlspecialchars($str,ENT_COMPAT,self::$charset,false); // we need '&#' unchanged, so we translate it back -> this is provided by 4th param = false -> do not doubleencode
@@ -1523,29 +1530,5 @@
}
return $html2ret;
}
- static private $mobileBrowser = null;
- /**
-
- Returns whether this is a mobile browser
- */
- static public function is_mobile()
- {
-
$agent = $_SERVER['HTTP_USER_AGENT']; -
if (self::$mobileBrowser == null) { -
self::$mobileBrowser = false; -
foreach(array('iPhone','iPad','Android','SymbianOS') as $pattern) -
{ -
self::$mobileBrowser |= (stripos($agent,$pattern) !== false); -
} -
} -
return true; -
//return self::$mobileBrowser; - }
}
html::_init_static();
Simplify data backup and recovery for your virtual environment with vRanger.
Installation’s a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Discover what all the cheering’s about.
Get your free trial download today.
http://p.sf.net/sfu/quest-dev2dev2
eGroupWare-cvs mailing list
eGroupWare-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-cvs