Diff for /loncom/interface/lonsearchcourse.pm between versions 1.10 and 1.11

version 1.10, 2024/02/11 21:41:48 version 1.11, 2024/02/11 22:20:06
Line 123  sub course_search { Line 123  sub course_search {
     my $discuss=$env{'form.crsdiscuss'};      my $discuss=$env{'form.crsdiscuss'};
     my @allwords=($search_string,@New_Words);      my @allwords=($search_string,@New_Words);
     $totalfound=0;      $totalfound=0;
       my $target = 'cat';
       if ((($env{'request.lti.login'}) && ($env{'request.lti.target'} eq 'iframe')) ||
           (($env{'request.deeplink.login'}) && ($env{'request.deeplink.target'} eq '_self'))) {
           $target = '_self';
       }
   
     $r->print(      $r->print(
               '<hr /><center><font size="+2" face="arial">'.                '<hr /><center><font size="+2" face="arial">'.
Line 148  sub course_search { Line 153  sub course_search {
                 }                  }
                 my $symb=&make_symb($1);                  my $symb=&make_symb($1);
                 &checkonthis($r,$1,$hash{$_},0,&Apache::lonnet::gettitle($symb),                  &checkonthis($r,$1,$hash{$_},0,&Apache::lonnet::gettitle($symb),
                              $fulltext,$symb,@allwords);                               $fulltext,$symb,$target,@allwords);
             }              }
         }          }
         untie(%hash);          untie(%hash);
Line 220  sub course_search { Line 225  sub course_search {
                     }                      }
                     $url .= &escape($resource->symb());                      $url .= &escape($resource->symb());
                     my $title = $resource->compTitle();                      my $title = $resource->compTitle();
                     $r->print('<br /><a href="'.$url.'" target="cat">'.                      $r->print('<br /><a href="'.$url.'" target="'.$target.'">'.
                          ($title?$title:$url).'</a>&nbsp;&nbsp;-&nbsp;'.                           ($title?$title:$url).'</a>&nbsp;&nbsp;-&nbsp;'.
                          $disctype.'<br />');                           $disctype.'<br />');
                     $totaldiscussions++;                      $totaldiscussions++;
Line 240  sub course_search { Line 245  sub course_search {
 # =============================== This pulls up a resource and its dependencies  # =============================== This pulls up a resource and its dependencies
   
 sub checkonthis {  sub checkonthis {
     my ($r,$id,$url,$level,$title,$fulltext,$symb,@allwords)=@_;      my ($r,$id,$url,$level,$title,$fulltext,$symb,$target,@allwords)=@_;
     $alreadyseen{$id}=1;      $alreadyseen{$id}=1;
     if (&Apache::loncommon::connection_aborted($r)) { return; }      if (&Apache::loncommon::connection_aborted($r)) { return; }
     $r->rflush();      $r->rflush();
Line 281  sub checkonthis { Line 286  sub checkonthis {
                $href .= '?symb='.&escape($symb);                 $href .= '?symb='.&escape($symb);
            }             }
        }         }
        $r->print('<a href="'.$href.'" target="cat">'.($title?$title:$url).         $r->print('<a href="'.$href.'" target="'.$target.'">'.($title?$title:$url).
                  '</a><br />');                   '</a><br />');
        $totalfound++;         $totalfound++;
     } elsif ($fulltext) {      } elsif ($fulltext) {
Line 293  sub checkonthis { Line 298  sub checkonthis {
                 &Apache::lonnet::metadata($url,'dependencies');                  &Apache::lonnet::metadata($url,'dependencies');
     foreach (split(/\,/,$dependencies)) {      foreach (split(/\,/,$dependencies)) {
        if (($_=~/^\/res\//) && (!$alreadyseen{$id})) {         if (($_=~/^\/res\//) && (!$alreadyseen{$id})) {
           &checkonthis($r,$id,$_,$level+1,'',$fulltext,undef,@allwords);            &checkonthis($r,$id,$_,$level+1,'',$fulltext,undef,$target,@allwords);
        }         }
     }      }
 }  }

Removed from v.1.10  
changed lines
  Added in v.1.11


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>