Diff for /loncom/interface/loncommon.pm between versions 1.1380 and 1.1381

version 1.1380, 2022/05/29 03:19:00 version 1.1381, 2022/05/29 20:37:21
Line 1257  END Line 1257  END
   
 =pod  =pod
   
 =item * &help_open_topic($topic,$text,$stayOnPage,$width,$height,$imgid)  =item * &help_open_topic($topic,$text,$stayOnPage,$width,$height,$imgid,$links_target)
   
 Returns a string corresponding to an HTML link to the given help  Returns a string corresponding to an HTML link to the given help
 $topic, where $topic corresponds to the name of a .tex file in  $topic, where $topic corresponds to the name of a .tex file in
Line 1281  $imgid is the id of the img tag used for Line 1281  $imgid is the id of the img tag used for
 used in a javascript call to switch the image src.  See   used in a javascript call to switch the image src.  See 
 lonhtmlcommon::htmlareaselectactive() for an example.  lonhtmlcommon::htmlareaselectactive() for an example.
   
   $links_target will optionally be set to a target (_top, _parent or _self).
   
 =cut  =cut
   
 sub help_open_topic {  sub help_open_topic {
     my ($topic, $text, $stayOnPage, $width, $height, $imgid) = @_;      my ($topic, $text, $stayOnPage, $width, $height, $imgid, $links_target) = @_;
     $text = "" if (not defined $text);      $text = "" if (not defined $text);
     $stayOnPage = 0 if (not defined $stayOnPage);      $stayOnPage = 0 if (not defined $stayOnPage);
     $width = 500 if (not defined $width);      $width = 500 if (not defined $width);
Line 1307  sub help_open_topic { Line 1309  sub help_open_topic {
   
     # Add the text      # Add the text
     my $target = ' target="_top"';      my $target = ' target="_top"';
     if ((($env{'request.lti.login'}) && ($env{'request.lti.target'} eq 'iframe')) ||      if ($links_target) {
         (($env{'request.deeplink.login'}) && ($env{'request.deeplink.target'} eq '_self'))) {          $target = ' target="'.$links_target.'"';
         if (($env{'request.noversionuri'} eq '/adm/searchcat') &&      } elsif ((($env{'request.lti.login'}) && ($env{'request.lti.target'} eq 'iframe')) ||
             ($env{'form.phase'} =~ /^(sort|run_search)$/)) {               (($env{'request.deeplink.login'}) && ($env{'request.deeplink.target'} eq '_self'))) {
             $target = ' target="_parent"';          $target = '';
         } else {  
             $target = '';  
         }  
     }      }
     if ($text ne "") {      if ($text ne "") {
  $template.='<span class="LC_help_open_topic">'   $template.='<span class="LC_help_open_topic">'
Line 1401  ENDOUTPUT Line 1400  ENDOUTPUT
   
 # now just updates the help link and generates a blue icon  # now just updates the help link and generates a blue icon
 sub help_open_menu {  sub help_open_menu {
     my ($topic,$component_help,$faq,$bug,$stayOnPage,$width,$height,$text)       my ($topic,$component_help,$faq,$bug,$stayOnPage,$width,$height,$text,$links_target) 
  = @_;       = @_;    
     $stayOnPage = 1;      $stayOnPage = 1;
     my $output;      my $output;
     if ($component_help) {      if ($component_help) {
  if (!$text) {   if (!$text) {
     $output=&help_open_topic($component_help,undef,$stayOnPage,      $output=&help_open_topic($component_help,undef,$stayOnPage,
        $width,$height);         $width,$height,'',$links_target);
  } else {   } else {
     my $help_text;      my $help_text;
     $help_text=&unescape($topic);      $help_text=&unescape($topic);
     $output='<table><tr><td>'.      $output='<table><tr><td>'.
  &help_open_topic($component_help,$help_text,$stayOnPage,   &help_open_topic($component_help,$help_text,$stayOnPage,
  $width,$height).'</td></tr></table>';   $width,$height,'',$links_target).'</td></tr></table>';
  }   }
     }      }
     my $banner_link = &update_help_link($topic,$component_help,$faq,$bug,$stayOnPage);      my $banner_link = &update_help_link($topic,$component_help,$faq,$bug,$stayOnPage);

Removed from v.1.1380  
changed lines
  Added in v.1.1381


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