summaryrefslogtreecommitdiff
path: root/rt/lib/RT/Extension/MobileUI.pm
blob: 26873c7500d4aa7620054571ed6ec0c12d470712 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
use warnings;
use strict;

package RT::Extension::MobileUI;

our $VERSION = "1.01";


=head1 NAME

RT::Extension::MobileUI - A phone friendly web interface for RT

=head1 DESCRIPTION

This RT extension adds a mobile interface for RT.

=head1 INSTALLATION

    # perl Makefile.PL
    # make
    # make install

    Add RT::Extension::MobileUI to your /opt/rt3/etc/RT_SiteConfig.pm file
    Set(@Plugins, qw(RT::Extension::MobileUI));

    If you have more than one Plugin enabled, you must enable them as one 
    Set(@Plugins, qw(Foo Bar)); command

    # restart apache
=cut




sub MobileClient {
    my $self = shift;


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'})  {
    return 1;
} else {
    return undef;
}

}

=head1 AUTHOR

Jesse Vincent E<lt>jesse@bestpractical.comE<gt>

=head1 LICENSE

GPL version 2.

=cut

1;