Revision 90d4d3fd
Von Sven Schöling vor etwa 4 Jahren hinzugefügt
SL/Request.pm | ||
---|---|---|
use Rose::Object::MakeMethods::Generic
|
||
(
|
||
scalar => [ qw(applying_database_upgrades post_data) ],
|
||
'scalar --get_set_init' => [ qw(cgi layout presenter is_ajax type) ],
|
||
'scalar --get_set_init' => [ qw(cgi layout presenter is_ajax is_mobile type) ],
|
||
);
|
||
|
||
sub init_cgi {
|
||
... | ... | |
return ($ENV{HTTP_X_REQUESTED_WITH} || '') eq 'XMLHttpRequest' ? 1 : 0;
|
||
}
|
||
|
||
sub init_is_mobile {
|
||
# mobile clients will change their user agent when the user requests
|
||
# desktop version so user agent is the most reliable way to identify
|
||
return ($ENV{HTTP_USER_AGENT} || '') =~ /Mobi/ ? 1 : 0;
|
||
}
|
||
|
||
sub init_type {
|
||
return 'html';
|
||
}
|
Auch abrufbar als: Unified diff
Request: is_mobile