Revision f251540d
Von Bernd Bleßmann vor etwa 1 Jahr hinzugefügt
SL/Request.pm | ||
---|---|---|
10 | 10 |
use Exporter qw(import); |
11 | 11 |
|
12 | 12 |
use SL::Common; |
13 |
use SL::Helper::UserPreferences::DisplayPreferences; |
|
13 | 14 |
use SL::JSON; |
14 | 15 |
use SL::MoreCommon qw(uri_encode uri_decode); |
15 | 16 |
use SL::Layout::None; |
... | ... | |
40 | 41 |
} |
41 | 42 |
|
42 | 43 |
sub init_is_mobile { |
44 |
# user can force a layout version |
|
45 |
my $user_prefs = SL::Helper::UserPreferences::DisplayPreferences->new(); |
|
46 |
return 0 if ($user_prefs->get_layout_style || '') eq 'desktop'; |
|
47 |
return 1 if ($user_prefs->get_layout_style || '') eq 'mobile'; |
|
48 |
|
|
43 | 49 |
# mobile clients will change their user agent when the user requests |
44 | 50 |
# desktop version so user agent is the most reliable way to identify |
45 | 51 |
return ($ENV{HTTP_USER_AGENT} || '') =~ /Mobi/ ? 1 : 0; |
Auch abrufbar als: Unified diff
Erzwungener Layout-Stil: Request: is_mobile berücksichtigt Benutzereinstellung