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

raeburn raeburn at source.lon-capa.org
Sun May 29 20:17:38 EDT 2022


raeburn		Mon May 30 00:17:38 2022 EDT

  Modified files:              
    /loncom/interface	loncommon.pm lonhelpmenu.pm 
  Log:
  - Bug 6907
    Link to LON-CAPA bug reporting system needs to open in a new tab/window 
    when context is LTI Provider, or deep-linked, and display is embedded in
    another web page.
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1381 loncom/interface/loncommon.pm:1.1382
--- loncom/interface/loncommon.pm:1.1381	Sun May 29 20:37:21 2022
+++ loncom/interface/loncommon.pm	Mon May 30 00:17:38 2022
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.1381 2022/05/29 20:37:21 raeburn Exp $
+# $Id: loncommon.pm,v 1.1382 2022/05/30 00:17:38 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1521,26 +1521,25 @@
 	$link = $url;
     }
 
-    my $target = ' target="_top"';
-    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'}.'"';
+    my $target = '_top';
+    if ((($env{'request.lti.login'}) && ($env{'request.lti.target'} eq 'iframe')) ||
+        (($env{'request.deeplink.login'}) && ($env{'request.deeplink.target'} eq '_self'))) {
+        $target = '_blank';
     }
+
     # Add the text
     if ($text ne "")
     {
 	$template .= 
   "<table bgcolor='#AA3333' cellspacing='1' cellpadding='1' border='0'><tr>".
-  "<td bgcolor='#FF5555'><a".$target." href=\"$link\"><span style=\"color:#FFFFFF;font-size:10pt;\">$text</span></a>";
+  "<td bgcolor='#FF5555'><a target=\"$target\" href=\"$link\"><span style=\"color:#FFFFFF;font-size:10pt;\">$text</span></a>";
     }
 
     # Add the graphic
     my $title = &mt('Report a Bug');
     my $bugicon=&lonhttpdurl("/adm/lonMisc/smallBug.gif");
     $template .= <<"ENDTEMPLATE";
- <a$target href="$link" title="$title"><img src="$bugicon" border="0" alt="(Bug: $topic)" /></a>
+ <a target="$target" href="$link" title="$title"><img src="$bugicon" border="0" alt="(Bug: $topic)" /></a>
 ENDTEMPLATE
     if ($text ne '') { $template.='</td></tr></table>' };
     return $template;
Index: loncom/interface/lonhelpmenu.pm
diff -u loncom/interface/lonhelpmenu.pm:1.47 loncom/interface/lonhelpmenu.pm:1.48
--- loncom/interface/lonhelpmenu.pm:1.47	Tue May 24 16:23:03 2022
+++ loncom/interface/lonhelpmenu.pm	Mon May 30 00:17:38 2022
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # generate frame-based help system
 #
-# $Id: lonhelpmenu.pm,v 1.47 2022/05/24 16:23:03 raeburn Exp $
+# $Id: lonhelpmenu.pm,v 1.48 2022/05/30 00:17:38 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -180,12 +180,14 @@
                                             lastloc       => 'Go back',
                                             close         => 'Close',
                                          );
-    my $target = '_top';
-    if (($env{'request.lti.login'}) && ($env{'request.lti.target'} eq 'iframe')) {
-        $target = '_parent';
-    }
-    if (($env{'request.deeplink.login'}) && ($env{'request.deeplink.target'} eq '_self')) {
+    my ($target,$bugs_target);
+    if ((($env{'request.lti.login'}) && ($env{'request.lti.target'} eq 'iframe')) ||
+        (($env{'request.deeplink.login'}) && ($env{'request.deeplink.target'} eq '_self'))) {
         $target = '_parent';
+        $bugs_target = '_blank';
+    } else {
+        $target = '_top';
+        $bugs_target = '_top';
     }
     my %items = (
                     general => {
@@ -218,6 +220,7 @@
                                    img  => $location.'/lonMisc/smallBug.gif', 
                                    alt  => $lt{'bugs'},
                                    text => $lt{'bugs'},
+                                   target => $bugs_target,
                                 },
                     manuals_web  => {
                                        href => '',




More information about the LON-CAPA-cvs mailing list