Index: openacs-4/packages/xotcl-core/tcl/context-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/context-procs.tcl,v diff -u -r1.56 -r1.57 --- openacs-4/packages/xotcl-core/tcl/context-procs.tcl 23 Feb 2011 12:32:43 -0000 1.56 +++ openacs-4/packages/xotcl-core/tcl/context-procs.tcl 26 May 2011 17:29:50 -0000 1.57 @@ -176,6 +176,7 @@ requestor user url + mobile } ConnectionContext proc require_package_id_from_url {{-package_id 0} url} { @@ -263,6 +264,14 @@ ::xo::cc set_user_id $user_id ::xo::cc process_query_parameter } + + # simple mobile detection + ::xo::cc mobile 0 + if {[ns_conn isconnected]} { + set user_agent [string tolower [ns_set get [ns_conn headers] User-Agent]] + ::xo::cc mobile [regexp (android|webos|iphone|ipod) $user_agent] + } + if {![info exists ::ad_conn(charset)]} { set ::ad_conn(charset) [lang::util::charset_for_locale $locale] set ::ad_conn(language) [::xo::cc lang]