Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 90d4d3fd

Von Sven Schöling vor fast 3 Jahren hinzugefügt

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

Request: is_mobile

Unterschiede anzeigen:

SL/Request.pm
20 20
use Rose::Object::MakeMethods::Generic
21 21
(
22 22
  scalar                  => [ qw(applying_database_upgrades post_data) ],
23
  'scalar --get_set_init' => [ qw(cgi layout presenter is_ajax type) ],
23
  'scalar --get_set_init' => [ qw(cgi layout presenter is_ajax is_mobile type) ],
24 24
);
25 25

  
26 26
sub init_cgi {
......
39 39
  return ($ENV{HTTP_X_REQUESTED_WITH} || '') eq 'XMLHttpRequest' ? 1 : 0;
40 40
}
41 41

  
42
sub init_is_mobile {
43
  # mobile clients will change their user agent when the user requests
44
  # desktop version so user agent is the most reliable way to identify
45
  return ($ENV{HTTP_USER_AGENT} || '') =~ /Mobi/ ? 1 : 0;
46
}
47

  
42 48
sub init_type {
43 49
  return 'html';
44 50
}

Auch abrufbar als: Unified diff