--- loncom/interface/loncommon.pm 2022/05/24 16:23:03 1.1378 +++ loncom/interface/loncommon.pm 2022/05/27 04:35:36 1.1379 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.1378 2022/05/24 16:23:03 raeburn Exp $ +# $Id: loncommon.pm,v 1.1379 2022/05/27 04:35:36 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1310,8 +1310,8 @@ sub help_open_topic { if (($env{'request.lti.login'}) && ($env{'request.lti.target'} eq 'iframe')) { $target = ''; } - if (($env{'request.deeplink.login'}) && ($env{'request.deeplink.target'})) { - $target = ' target="'.$env{'request.deeplink.target'}.'"'; + if (($env{'request.deeplink.login'}) && ($env{'request.deeplink.target'} eq '_self')) { + $target = ''; } if ($text ne "") { $template.='' @@ -6230,6 +6230,10 @@ sub head_subbox { Input: (optional) filename from which breadcrumb trail is built. In most cases no input as needed, as $env{'request.filename'} is appropriate for use in building the breadcrumb trail. + frameset flag + If page header is being requested for use in a frameset, then + the second (option) argument -- frameset will be true, and + the target attribute set for links should be target="_parent". Returns: HTML div with CSTR path and recent box To be included on Authoring Space pages @@ -6237,7 +6241,7 @@ Returns: HTML div with CSTR path and rec =cut sub CSTR_pageheader { - my ($trailfile) = @_; + my ($trailfile,$frameset) = @_; if ($trailfile eq '') { $trailfile = $env{'request.filename'}; } @@ -6270,12 +6274,14 @@ sub CSTR_pageheader { $title = &mt('Authoring Space'); } - my ($target,$crumbtarget) = (' target="_top"','_top'); #FIXME lonpubdir: target="_parent" - if (($env{'request.lti.login'}) && ($env{'request.lti.target'} eq 'iframe')) { + my ($target,$crumbtarget) = (' target="_top"','_top'); + if ($frameset) { + $target = ' target="_parent"'; + $crumbtarget = '_parent'; + } elsif (($env{'request.lti.login'}) && ($env{'request.lti.target'} eq 'iframe')) { $target = ''; $crumbtarget = ''; - } - if (($env{'request.deeplink.login'}) && ($env{'request.deeplink.target'})) { + } elsif (($env{'request.deeplink.login'}) && ($env{'request.deeplink.target'})) { $target = ' target="'.$env{'request.deeplink.target'}.'"'; $crumbtarget = $env{'request.deeplink.target'}; } @@ -6295,14 +6301,14 @@ sub CSTR_pageheader { } if ($crsauthor) { - $output .= ''.&Apache::lonmenu::constspaceform(); + $output .= ''.&Apache::lonmenu::constspaceform($frameset); } else { $output .= '
' #FIXME lonpubdir: &Apache::lonhtmlcommon::crumbs($uname.$thisdisfn.'/',$crumbtarget,'/priv','','+1',1)."
" .&Apache::lonhtmlcommon::select_recent('construct','recent','this.form.action=this.form.recent.value;this.form.submit()') .'' - .&Apache::lonmenu::constspaceform(); + .&Apache::lonmenu::constspaceform($frameset); } $output .= '';