[freeside-commits] freeside/FS/FS/UI Web.pm,1.47,1.48

Mark Wells mark at wavetail.420.am
Wed Apr 27 01:31:03 PDT 2011


Update of /home/cvs/cvsroot/freeside/FS/FS/UI
In directory wavetail.420.am:/tmp/cvs-serv23959/FS/FS/UI

Modified Files:
	Web.pm 
Log Message:
RT mobile UI, #11630

Index: Web.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/UI/Web.pm,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -w -d -r1.47 -r1.48
--- Web.pm	27 Jan 2011 00:37:51 -0000	1.47
+++ Web.pm	27 Apr 2011 08:31:01 -0000	1.48
@@ -484,6 +484,20 @@
   }
 }
 
+=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...
 ###



More information about the freeside-commits mailing list