Revision 3289bcb2
Von Sven Schöling vor mehr als 14 Jahren hinzugefügt
bin/mozilla/menu.pl | ||
---|---|---|
35 | 35 |
# 2004-12-14 - New Optik - Marco Welter <mawe@linux-studio.de> |
36 | 36 |
####################################################################### |
37 | 37 |
|
38 |
my $menufile = "menu.ini"; |
|
38 |
use strict; |
|
39 |
|
|
39 | 40 |
use SL::Menu; |
40 | 41 |
use Data::Dumper; |
41 | 42 |
use URI; |
42 | 43 |
|
43 |
use strict; |
|
44 |
|
|
45 |
my $framesize; |
|
44 |
my $menufile = "menu.ini"; |
|
46 | 45 |
my $mainlevel; |
47 | 46 |
|
48 |
#my $framesize = ($ENV{HTTP_USER_AGENT} =~ /mobile/i) ? "130" : "190"; |
|
49 |
if ($ENV{HTTP_USER_AGENT} =~ /mobile/i) { |
|
50 |
$framesize = "130"; |
|
51 |
} elsif ($ENV{HTTP_USER_AGENT} =~ /links/i) { |
|
52 |
$framesize = "240"; |
|
53 |
} else { |
|
54 |
$framesize = "190"; |
|
55 |
} |
|
56 |
|
|
57 |
1; |
|
58 |
|
|
59 | 47 |
# end of main |
60 | 48 |
|
61 | 49 |
sub display { |
... | ... | |
66 | 54 |
my $callback = $form->unescape($form->{callback}); |
67 | 55 |
$callback = URI->new($callback)->rel($callback) if $callback; |
68 | 56 |
$callback = "login.pl?action=company_logo" if $callback =~ /^(\.\/)?$/; |
57 |
my $framesize = _calc_framesize(); |
|
69 | 58 |
|
70 | 59 |
$form->header; |
71 | 60 |
|
... | ... | |
89 | 78 |
sub acc_menu { |
90 | 79 |
$main::lxdebug->enter_sub(); |
91 | 80 |
|
92 |
my $form = $main::form; |
|
93 |
my $locale = $main::locale; |
|
81 |
my $form = $main::form; |
|
82 |
my $locale = $main::locale; |
|
83 |
my $framesize = _calc_framesize(); |
|
94 | 84 |
|
95 | 85 |
$mainlevel = $form->{level}; |
96 | 86 |
$mainlevel =~ s/\Q$mainlevel\E--//g; |
... | ... | |
237 | 227 |
} |
238 | 228 |
$main::lxdebug->leave_sub(); |
239 | 229 |
} |
230 |
|
|
231 |
sub _calc_framesize { |
|
232 |
my $is_lynx_browser = $ENV{HTTP_USER_AGENT} =~ /links/i; |
|
233 |
my $is_mobile_browser = $ENV{HTTP_USER_AGENT} =~ /mobile/i; |
|
234 |
my $is_mobile_style = $::form->{stylesheet} =~ /mobile/i; |
|
235 |
|
|
236 |
return $is_mobile_browser && $is_mobile_style ? 130 |
|
237 |
: $is_lynx_browser ? 240 |
|
238 |
: 190; |
|
239 |
} |
|
240 |
|
|
241 |
1; |
|
242 |
|
|
243 |
__END__ |
Auch abrufbar als: Unified diff
Mobilbrowsercheck eingeschränkt auf mobil stylesheet.