summaryrefslogtreecommitdiff
path: root/rt/lib
diff options
context:
space:
mode:
authormark <mark>2011-04-27 08:31:03 +0000
committermark <mark>2011-04-27 08:31:03 +0000
commit68fcc90d8e95f1efe0efe07b2f59e5fab2d8c535 (patch)
tree77e67410169c23cfa4499d9bbf779b0005a045fd /rt/lib
parent9d5ada5763fdeca4f90a7357ab7c384b52c1c41c (diff)
RT mobile UI, #11630
Diffstat (limited to 'rt/lib')
-rw-r--r--rt/lib/RT/Extension/MobileUI.pm57
1 files changed, 57 insertions, 0 deletions
diff --git a/rt/lib/RT/Extension/MobileUI.pm b/rt/lib/RT/Extension/MobileUI.pm
new file mode 100644
index 000000000..26873c750
--- /dev/null
+++ b/rt/lib/RT/Extension/MobileUI.pm
@@ -0,0 +1,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;