RT mobile UI, #11630
[freeside.git] / rt / lib / RT / Extension / MobileUI.pm
1 use warnings;
2 use strict;
3
4 package RT::Extension::MobileUI;
5
6 our $VERSION = "1.01";
7
8
9 =head1 NAME
10
11 RT::Extension::MobileUI - A phone friendly web interface for RT
12
13 =head1 DESCRIPTION
14
15 This RT extension adds a mobile interface for RT.
16
17 =head1 INSTALLATION
18
19     # perl Makefile.PL
20     # make
21     # make install
22
23     Add RT::Extension::MobileUI to your /opt/rt3/etc/RT_SiteConfig.pm file
24     Set(@Plugins, qw(RT::Extension::MobileUI));
25
26     If you have more than one Plugin enabled, you must enable them as one 
27     Set(@Plugins, qw(Foo Bar)); command
28
29     # restart apache
30 =cut
31
32
33
34
35 sub MobileClient {
36     my $self = shift;
37
38
39 if (($ENV{'HTTP_USER_AGENT'} || '') =~ /(?: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 && !$HTML::Mason::Commands::session{'NotMobile'})  {
40     return 1;
41 } else {
42     return undef;
43 }
44
45 }
46
47 =head1 AUTHOR
48
49 Jesse Vincent E<lt>jesse@bestpractical.comE<gt>
50
51 =head1 LICENSE
52
53 GPL version 2.
54
55 =cut
56
57 1;