[LON-CAPA-cvs] cvs: loncom /interface lonhelpmenu.pm

raeburn raeburn at source.lon-capa.org
Mon May 7 21:19:06 EDT 2018


raeburn		Tue May  8 01:19:06 2018 EDT

  Modified files:              
    /loncom/interface	lonhelpmenu.pm 
  Log:
  - Bug 6754 LON-CAPA as LTI Provider
    - If original LTI launch of LON-CAPA was for display in iframe linked
      LON-CAPA items are displayed within the same iframe.
  
  
Index: loncom/interface/lonhelpmenu.pm
diff -u loncom/interface/lonhelpmenu.pm:1.45 loncom/interface/lonhelpmenu.pm:1.46
--- loncom/interface/lonhelpmenu.pm:1.45	Mon Feb 20 00:36:40 2017
+++ loncom/interface/lonhelpmenu.pm	Tue May  8 01:19:06 2018
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # generate frame-based help system
 #
-# $Id: lonhelpmenu.pm,v 1.45 2017/02/20 00:36:40 raeburn Exp $
+# $Id: lonhelpmenu.pm,v 1.46 2018/05/08 01:19:06 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -180,6 +180,10 @@
                                             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',
@@ -229,14 +233,14 @@
                                    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 = (
@@ -392,6 +396,10 @@
         $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('<div>');
     } 
@@ -425,7 +433,7 @@
                        &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.',
-                          '<a href="/adm/communicate" target="_top">','</a>')); 
+                          '<a href="/adm/communicate" target="'.$target.'">','</a>')); 
          }
          $r->print("</p>");
     }




More information about the LON-CAPA-cvs mailing list