diff options
author | mark <mark> | 2011-04-27 08:31:03 +0000 |
---|---|---|
committer | mark <mark> | 2011-04-27 08:31:03 +0000 |
commit | 68fcc90d8e95f1efe0efe07b2f59e5fab2d8c535 (patch) | |
tree | 77e67410169c23cfa4499d9bbf779b0005a045fd /FS/FS/UI | |
parent | 9d5ada5763fdeca4f90a7357ab7c384b52c1c41c (diff) |
RT mobile UI, #11630
Diffstat (limited to 'FS/FS/UI')
-rw-r--r-- | FS/FS/UI/Web.pm | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/FS/FS/UI/Web.pm b/FS/FS/UI/Web.pm index 029b02c..40abdc4 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... ### |