--- loncom/interface/lonhelpmenu.pm 2013/12/30 00:34:49 1.43 +++ loncom/interface/lonhelpmenu.pm 2018/05/08 01:19:06 1.46 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # generate frame-based help system # -# $Id: lonhelpmenu.pm,v 1.43 2013/12/30 00:34:49 raeburn Exp $ +# $Id: lonhelpmenu.pm,v 1.46 2018/05/08 01:19:06 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -36,6 +36,7 @@ use Apache::lonlocal; use Apache::lonnet; use lib '/home/httpd/lib/perl/'; use LONCAPA; +use HTML::Entities(); sub handler { my ($r) = @_; @@ -63,6 +64,7 @@ sub handler { } my $faqbaseurl = $Apache::lonnet::perlvar{'FAQHost'}; my $origmail = $Apache::lonnet::perlvar{'lonSupportEMail'}; + $origurl = &unescape($origurl); my $defdom; if ($env{'request.course.id'}) { $defdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; @@ -83,7 +85,6 @@ sub handler { sub display_help_banner { my ($r,$faq,$bug,$topic,$component_url,$origurl,$bugurl,$faqbaseurl,$requestmail,$stayOnPage) = @_; - my $location=&Apache::loncommon::lonhttpdurl("/adm"); my $dom = $env{'request.role.domain'}; my $scripttag = ''; if ($requestmail) { @@ -179,6 +180,10 @@ sub helpmenu_items { lastloc => 'Go back', close => 'Close', ); + my $target = '_top'; + if (($env{'request.lti.login'}) && ($env{'request.lti.target'} eq 'iframe')) { + $target = '_parent'; + } my %items = ( general => { href => '/adm/help/'.$general_help.'.hlp', @@ -224,28 +229,28 @@ sub helpmenu_items { text => $lt{'manuals_pdf'}, }, lastloc => { - href => $origurl, + href => &HTML::Entities::encode($origurl,'"&<>'), img => '/res/adm/pages/tolastloc.png', alt => $lt{'lastloc'}, text => $lt{'lastloc'}, - target => '_top', + target => $target, }, close => { href => 'javascript:window.close()', img => $location.'/lonIcons/close.gif', alt => $lt{'close'}, text => $lt{'close'}, - target => '_top', + target => $target, }, ); my %help_submenu = ( manuals_web => [ ['/adm/help/course.manual.access.hlp','Course Coordination','course'], - ['/adm/help/course.manual.access.hlp','Authoring','author'], + ['/adm/help/author.manual.access.hlp','Authoring','author'], ], manuals_pdf => [ ['/adm/help/course.manual.pdf','Course Coordination','course'], - ['/adm/help/course.manual.pdf','Authoring','author'], + ['/adm/help/author.manual.pdf','Authoring','author'], ], ); my @order = ('general'); @@ -391,6 +396,10 @@ sub display_help_mainpage { $r->print(&Apache::loncommon::start_page('Help Content',undef, {'only_body' => 1,})); } + my $target = '_top'; + if (($env{'request.lti.login'}) && ($env{'request.lti.target'} eq 'iframe')) { + $target = '_parent'; + } if ($stayOnPage) { $r->print('
'); } @@ -424,7 +433,7 @@ sub display_help_mainpage { &mt('[_1]Note[_2]: questions about course content should not be directed to the support team, but instead should be sent to the course instructor.'). ' '. &mt('This can be done by clicking the [_1]Communicate[_2] link or the "Send Feedback" link when viewing a content page.', - '','')); + '','')); } $r->print("

"); }