--- loncom/interface/lonmenu.pm 2018/04/14 17:52:43 1.486 +++ loncom/interface/lonmenu.pm 2018/04/15 00:28:07 1.487 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.486 2018/04/14 17:52:43 raeburn Exp $ +# $Id: lonmenu.pm,v 1.487 2018/04/15 00:28:07 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2053,6 +2053,11 @@ sub utilityfunctions { my $countdown = &countdown_toggle_js(); + my $ltitarget; + if ($env{'request.lti.login'}) { + $ltitarget = $env{'request.lti.target'}; + } + my $hostvar = ' function setLCHost() { var lcHostname=""; @@ -2149,7 +2154,12 @@ function golist(url) { currentURL = null; currentSymb= null; var lcHostname = setLCHost(); - top.location.href=lcHostname+url; + var ltitarget = '$ltitarget'; + if (ltitarget == 'iframe') { + document.location.href=lcHostname+url; + } else { + top.location.href=lcHostname+url; + } } } @@ -2243,15 +2253,20 @@ ENDSERVERFORM } sub constspaceform { + my ($target,$printtarget); + unless (($env{'request.lti.login'}) && ($env{'request.lti.target'} eq 'iframe')) { + $target = ' target="_top"'; + $printtarget = ' target="_parent"'; + } return(< +
-
+
-
+