Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 90d4d3fd

Von Sven Schöling vor etwa 4 Jahren hinzugefügt

  • ID 90d4d3fd206ac296bea8e228a058c7fcecb58af3
  • Vorgänger 9e05d029
  • Nachfolger d801b8bd

Request: is_mobile

Unterschiede anzeigen:

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