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

raeburn raeburn at source.lon-capa.org
Sun May 29 16:45:41 EDT 2022


raeburn		Sun May 29 20:45:41 2022 EDT

  Modified files:              
    /loncom/interface	lonsearchcat.pm 
  Log:
  - Bug 6907
    - When context is LTI Provider, or deep-linked, and display is embedded in
      another web page, set target to _parent for inline menu links, and help
      item when displaying search results within LON-CAPA's own frames.
  
  
Index: loncom/interface/lonsearchcat.pm
diff -u loncom/interface/lonsearchcat.pm:1.355 loncom/interface/lonsearchcat.pm:1.356
--- loncom/interface/lonsearchcat.pm:1.355	Sun May 29 03:19:00 2022
+++ loncom/interface/lonsearchcat.pm	Sun May 29 20:45:41 2022
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Search Catalog
 #
-# $Id: lonsearchcat.pm,v 1.355 2022/05/29 03:19:00 raeburn Exp $
+# $Id: lonsearchcat.pm,v 1.356 2022/05/29 20:45:41 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -184,7 +184,7 @@
         if ($env{'form.phase'} =~ /^(sort|run_search)$/) {
             $target = '_parent';
         } else {
-            $target = '';
+            $target = '_self';
         }
     }
     &Apache::lonhtmlcommon::add_breadcrumb
@@ -337,10 +337,10 @@
                  ['query','customquery','customshow',
                   'libraries','pretty_string','domains']);
         if ($env{'form.phase'} eq 'sort') {
-            &print_sort_form($r,$pretty_string);
+            &print_sort_form($r,$pretty_string,$target);
         } elsif ($env{'form.phase'} eq 'run_search') {
             &run_search($r,$query,$customquery,$customshow,
-                        $libraries,$pretty_string,$env{'form.area'},$domainsref);
+                        $libraries,$pretty_string,$env{'form.area'},$domainsref,$target);
         }
     } elsif(($env{'form.phase'} eq 'basic_search') ||
             ($env{'form.phase'} eq 'adv_search')) {
@@ -2063,7 +2063,7 @@
 ######################################################################
 ######################################################################
 sub print_sort_form {
-    my ($r,$pretty_query_string) = @_;
+    my ($r,$pretty_query_string,$target) = @_;
 
     ##
     my %SortableFields=&Apache::lonlocal::texthash( 
@@ -2096,17 +2096,15 @@
         &Apache::lonnet::logthis(&Apache::lonmysql::get_error());
         return;
     }
-    my $target = '_top';
     my $args;
-    if ((($env{'request.lti.login'}) && ($env{'request.lti.target'} eq 'iframe')) ||
-        (($env{'request.deeplink.login'}) && ($env{'request.deeplink.target'} eq '_self'))) {
-        $target = '_parent';
+    if ($target eq '_parent') {
         $args = {'links_target' => $target};
     }
     my $start_page = &Apache::loncommon::start_page('Results',undef,$args);
     my $breadcrumbs=
         &Apache::lonhtmlcommon::breadcrumbs('Searching','Searching',
-					    $env{'form.catalogmode'} ne 'import');
+					    $env{'form.catalogmode'} ne 'import',
+                                            '','','','','','',$target);
 
     my $result = <<END;
 $start_page
@@ -2362,7 +2360,7 @@
 ######################################################################
 sub run_search {
     my ($r,$query,$customquery,$customshow,$serverlist,
-        $pretty_string,$area,$domainsref) = @_;
+        $pretty_string,$area,$domainsref,$target) = @_;
     my $tabletype = 'metadata';
     if ($area eq 'portfolio') {
         $tabletype = 'portfolio_search';
@@ -2371,10 +2369,15 @@
     #
     # Print run_search header
     #
-    my $start_page = &Apache::loncommon::start_page('Search Status',undef);
+    my $args;
+    if ($target eq '_parent') {
+        $args = {'links_target' => $target};
+    }
+    my $start_page = &Apache::loncommon::start_page('Search Status',undef,$args);
     my $breadcrumbs =
 	&Apache::lonhtmlcommon::breadcrumbs('Searching','Searching',
-					    $env{'form.catalogmode'} ne 'import');
+					    $env{'form.catalogmode'} ne 'import',
+                                            '','','','','','',$target);
     $r->print(<<END);
 $start_page
 $breadcrumbs




More information about the LON-CAPA-cvs mailing list