--- loncom/interface/lonmenu.pm 2018/05/08 20:30:12 1.491 +++ loncom/interface/lonmenu.pm 2018/12/30 19:47:02 1.495 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.491 2018/05/08 20:30:12 raeburn Exp $ +# $Id: lonmenu.pm,v 1.495 2018/12/30 19:47:02 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -605,11 +605,13 @@ sub secondary_menu { } if ($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ m{^http://}) { if (($ENV{'SERVER_PORT'} == 443) || ($env{'request.use_absolute'} =~ m{^https://})) { - unless ($$menuitem[0] =~ m{^https?://}) { - $$menuitem[0] = 'http://'.$ENV{'SERVER_NAME'}.$$menuitem[0]; - } - unless ($$menuitem[0] =~ /(\&|\?)usehttp=1/) { - $$menuitem[0] .= (($$menuitem[0]=~/\?/) ? '&' : '?').'usehttp=1'; + unless (&Apache::lonnet::uses_sts()) { + unless ($$menuitem[0] =~ m{^https?://}) { + $$menuitem[0] = 'http://'.$ENV{'SERVER_NAME'}.$$menuitem[0]; + } + unless ($$menuitem[0] =~ /(\&|\?)usehttp=1/) { + $$menuitem[0] .= (($$menuitem[0]=~/\?/) ? '&' : '?').'usehttp=1'; + } } } } @@ -1551,7 +1553,8 @@ sub switch { unless ($env{'request.state'} eq 'construct') { push(@tools,63); } - if (($env{'environment.icons'} eq 'iconsonly') && + if ((($env{'environment.icons'} eq 'iconsonly') || + ($env{'environment.icons'} eq '') && ($env{'request.lti.login'})) && (grep(/^$idx$/,@tools))) { $inlineremote[$idx] = ''.$pic.''; @@ -2086,13 +2089,17 @@ END sub utilityfunctions { my ($httphost) = @_; my $currenturl=&Apache::lonnet::clutter(&Apache::lonnet::fixversion((split(/\?/,$env{'request.noversionuri'}))[0])); - if ($currenturl =~ m{^/adm/wrapper/ext/} - && $env{'request.external.querystring'} ) { + my $currentsymb=&Apache::lonenc::check_encrypt($env{'request.symb'}); + if ($currenturl =~ m{^/adm/wrapper/ext/}) { + if ($env{'request.external.querystring'}) { $currenturl .= ($currenturl=~/\?/)?'&':'?'.$env{'request.external.querystring'}; + } + my ($anchor) = ($env{'request.symb'} =~ /(\#[^\#]+)$/); + if (($anchor) && ($currenturl !~ /\Q$anchor\E$/)) { + $currenturl .= $1; + } } $currenturl=&Apache::lonenc::check_encrypt(&unescape($currenturl)); - - my $currentsymb=&Apache::lonenc::check_encrypt($env{'request.symb'}); my $dc_popup_cid; if ($env{'user.adv'} && exists($env{'user.role.dc./'. @@ -2124,6 +2131,10 @@ sub utilityfunctions { $ltitarget = $env{'request.lti.target'}; } + my $annotateurl = '/adm/annotation'; + if ($httphost) { + $annotateurl = '/adm/annotations'; + } my $hostvar = ' function setLCHost() { var lcHostname=""; @@ -2257,7 +2268,7 @@ function annotate() { annotator.document.write( '$start_page_annotate' +"
" + +"action='$annotateurl'>" +"" +"<\\/form>" +'$end_page_annotate');