"for iPhone and Android: replace evtl. configured telephony integration link with tel: protocoll"

This commit is contained in:
Ralf Becker 2010-03-28 13:33:40 +00:00
parent c60a1ad94d
commit a858db5eb8

View File

@ -223,7 +223,10 @@ class url_widget
*/ */
static function phone2link($number) static function phone2link($number)
{ {
// for iPhone and Android: replace evtl. configured telephony integration link with tel: protocoll static $call_link;
if (is_null($call_link))
{
// for iPhone and Android: replace evtl. configured telephony integration link with tel: protocol
if (strpos($_SERVER['HTTP_USER_AGENT'],'AppleWebKit') !== false && if (strpos($_SERVER['HTTP_USER_AGENT'],'AppleWebKit') !== false &&
(strpos($_SERVER['HTTP_USER_AGENT'],'iPhone') !== false || strpos($_SERVER['HTTP_USER_AGENT'],'Android') !== false)) (strpos($_SERVER['HTTP_USER_AGENT'],'iPhone') !== false || strpos($_SERVER['HTTP_USER_AGENT'],'Android') !== false))
{ {
@ -231,9 +234,10 @@ class url_widget
} }
else else
{ {
$call_link = $GLOBALS['egw_info']['server']['call_link']; $call_link = (string)$GLOBALS['egw_info']['server']['call_link'];
} }
if (!$number || empty($call_link)) return false; }
if (empty($number) || empty($call_link)) return false;
static $userphone; static $userphone;
if (is_null($userphone) && strpos($call_link,'%t') !== false) if (is_null($userphone) && strpos($call_link,'%t') !== false)