--- loncom/interface/loncommon.pm 2013/05/25 21:56:23 1.1130 +++ loncom/interface/loncommon.pm 2013/07/22 11:46:23 1.1141 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.1130 2013/05/25 21:56:23 raeburn Exp $ +# $Id: loncommon.pm,v 1.1141 2013/07/22 11:46:23 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2349,6 +2349,10 @@ Outputs: =item * $clientos +=item * $clientmobile + +=item * $clientinfo + =back =back @@ -2367,6 +2371,7 @@ sub decode_user_agent { my $clientversion='0'; my $clientmathml=''; my $clientunicode='0'; + my $clientmobile=0; for (my $i=0;$i<=$#browsertype;$i++) { my ($bname,$match,$notmatch,$vreg,$minv,$univ)=split(/\:/,$browsertype[$i]); if (($httpbrowser=~/$match/i) && ($httpbrowser!~/$notmatch/i)) { @@ -2378,6 +2383,7 @@ sub decode_user_agent { } } my $clientos='unknown'; + my $clientinfo; if (($httpbrowser=~/linux/i) || ($httpbrowser=~/unix/i) || ($httpbrowser=~/ux/i) || @@ -2389,8 +2395,16 @@ sub decode_user_agent { ($httpbrowser=~/powerpc/i)) { $clientos='mac'; } if ($httpbrowser=~/win/i) { $clientos='win'; } if ($httpbrowser=~/embed/i) { $clientos='pda'; } + if ($httpbrowser=~/(Android|iPod|iPad|iPhone|webOS|Blackberry|Windows Phone|Opera m(?:ob|in)|Fennec)/i) { + $clientmobile=lc($1); + } + if ($httpbrowser=~ m{Firefox/(\d+\.\d+)}) { + $clientinfo = 'firefox-'.$1; + } elsif ($httpbrowser=~ m{chromeframe/(\d+\.\d+)\.}) { + $clientinfo = 'chromeframe-'.$1; + } return ($httpbrowser,$clientbrowser,$clientversion,$clientmathml, - $clientunicode,$clientos,); + $clientunicode,$clientos,$clientmobile,$clientinfo); } ############################################################### @@ -4932,7 +4946,7 @@ sub designparm { Inputs: $url (usually will be undef). -Returns: Path to Construction Space containing the resource or +Returns: Path to Authoring Space containing the resource or directory being viewed (or for which action is being taken). If $url is provided, and begins /priv// the path will be that portion of the $context argument. @@ -4995,7 +5009,7 @@ Input: (optional) filename from which br is appropriate for use in building the breadcrumb trail. Returns: HTML div with CSTR path and recent box - To be included on Construction Space pages + To be included on Authoring Space pages =cut @@ -5026,7 +5040,7 @@ sub CSTR_pageheader { my $output = '
' .&Apache::loncommon::help_open_menu('','',3,'Authoring') #FIXME: Broken? Where is it? - .''.&mt('Construction Space:').' ' + .''.&mt('Authoring Space:').' ' .'
' #FIXME lonpubdir: target="_parent" .&Apache::lonhtmlcommon::crumbs($uname.'/'.$parentpath,'_top','/priv/'.$udom,undef,undef); @@ -5155,6 +5169,8 @@ sub bodytag { my $bodytag = "". &Apache::lontexconvert::init_math_support($args->{'inherit_jsmath'}); + &get_unprocessed_cgi($ENV{'QUERY_STRING'}, ['inhibitmenu']); + if (($bodyonly) || ($no_nav_bar) || ($env{'form.inhibitmenu'} eq 'yes')) { return $bodytag; } @@ -5176,7 +5192,6 @@ sub bodytag { } $role = '('.$role.')' if $role; - &get_unprocessed_cgi($ENV{'QUERY_STRING'}, ['inhibitmenu']); if ($env{'request.state'} eq 'construct') { $forcereg=1; } @@ -7311,6 +7326,11 @@ ADDMETA .'' .$inhibitprint .$head_extra; + if ($env{'browser.mobile'}) { + $result .= ' + +'; + } return $result.''; } @@ -7644,12 +7664,12 @@ var modalWindow = { $(".LCmodal-overlay").click(function(){modalWindow.close();}); } }; - var openMyModal = function(source,width,height,scrolling) + var openMyModal = function(source,width,height,scrolling,transparency,style) { modalWindow.windowId = "myModal"; modalWindow.width = width; modalWindow.height = height; - modalWindow.content = "