From 68fcc90d8e95f1efe0efe07b2f59e5fab2d8c535 Mon Sep 17 00:00:00 2001 From: mark Date: Wed, 27 Apr 2011 08:31:03 +0000 Subject: RT mobile UI, #11630 --- FS/FS/UI/Web.pm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'FS') diff --git a/FS/FS/UI/Web.pm b/FS/FS/UI/Web.pm index 029b02c6c..40abdc4a1 100644 --- a/FS/FS/UI/Web.pm +++ b/FS/FS/UI/Web.pm @@ -484,6 +484,20 @@ sub cust_aligns { } } +=item is_mobile + +Utility function to determine if the client is a mobile browser. + +=cut + +sub is_mobile { + my $ua = $ENV{'HTTP_USER_AGENT'} || ''; + if ( $ua =~ /(?:hiptop|Blazer|Novarra|Vagabond|SonyEricsson|Symbian|NetFront|UP.Browser|UP.Link|Windows CE|MIDP|J2ME|DoCoMo|J-PHONE|PalmOS|PalmSource|iPhone|iPod|AvantGo|Nokia|Android|WebOS|S60|Opera Mini|Opera Mobi)/io ) { + return 1; + } + return 0; +} + ### # begin JSRPC code... ### -- cgit v1.2.1