Diff for /loncom/interface/londocs.pm between versions 1.623 and 1.624

version 1.623, 2017/03/08 02:51:07 version 1.624, 2017/04/25 22:18:59
Line 659  sub group_import { Line 659  sub group_import {
                 my $marker = $2;                  my $marker = $2;
                 my $info = $3;                  my $info = $3;
                 my ($toolid,%toolhash,%toolsettings);                  my ($toolid,%toolhash,%toolsettings);
                   my @extras = ('linktext','explanation','crslabel','crstitle');
                 my @toolinfo = split(/:/,$info);                  my @toolinfo = split(/:/,$info);
                 if ($residx) {                  if ($residx) {
                     %toolsettings=&Apache::lonnet::dump('exttool_'.$marker,$coursedom,$coursenum);                      %toolsettings=&Apache::lonnet::dump('exttool_'.$marker,$coursedom,$coursenum);
Line 668  sub group_import { Line 669  sub group_import {
                 }                  }
                 $toolid =~ s/\D//g;                  $toolid =~ s/\D//g;
                 ($toolhash{'target'},$toolhash{'width'},$toolhash{'height'},                  ($toolhash{'target'},$toolhash{'width'},$toolhash{'height'},
                    $toolhash{'linktext'},$toolhash{'explanation'},
                  $toolhash{'crslabel'},$toolhash{'crstitle'}) = @toolinfo;                   $toolhash{'crslabel'},$toolhash{'crstitle'}) = @toolinfo;
                 $toolhash{'crslabel'} = &unescape($toolhash{'crslabel'});                  foreach my $item (@extras) {
                 $toolhash{'crstitle'} = &unescape($toolhash{'crstitle'});                      $toolhash{$item} = &unescape($toolhash{$item});
                   }
                 if (ref($ltitoolsref) eq 'HASH') {                  if (ref($ltitoolsref) eq 'HASH') {
                     my @deleted;                      my @deleted;
                     if (ref($ltitoolsref->{$toolid}) eq 'HASH') {                      if (ref($ltitoolsref->{$toolid}) eq 'HASH') {
Line 683  sub group_import { Line 686  sub group_import {
                                 foreach my $item ('width','height') {                                  foreach my $item ('width','height') {
                                     $toolhash{$item} =~ s/^\s+//;                                      $toolhash{$item} =~ s/^\s+//;
                                     $toolhash{$item} =~ s/\s+$//;                                      $toolhash{$item} =~ s/\s+$//;
                                       if ($toolhash{$item} =~ /\D/) {
                                           delete($toolhash{$item});
                                           if ($residx) {
                                               if ($toolsettings{$item}) {
                                                   push(@deleted,$item);
                                               }
                                           }
                                       }
                                 }                                  }
                             }                              }
                         } elsif ($residx) {                          } elsif ($residx) {
                             $toolhash{'target'} = $toolsettings{'target'};                              $toolhash{'target'} = $toolsettings{'target'};
                             if ($toolhash{'target'} eq 'window') {                              if ($toolhash{'target'} eq 'window') {
                                 $toolhash{'width'} = $toolsettings{'width'};                                  foreach my $item ('width','height') { 
                                 $toolhash{'height'} = $toolsettings{'height'};                                        $toolhash{$item} = $toolsettings{$item};
                                   }
                             }                              }
                         } elsif (ref($ltitoolsref->{$toolid}->{'display'}) eq 'HASH') {                          } elsif (ref($ltitoolsref->{$toolid}->{'display'}) eq 'HASH') {
                             $toolhash{'target'} = $ltitoolsref->{$toolid}->{'display'}->{'target'};                              $toolhash{'target'} = $ltitoolsref->{$toolid}->{'display'}->{'target'};
Line 699  sub group_import { Line 711  sub group_import {
                             }                              }
                         }                          }
                         if ($toolhash{'target'} eq 'iframe') {                          if ($toolhash{'target'} eq 'iframe') {
                             delete($toolhash{'width'});                              foreach my $item ('width','height','linktext','explanation') {
                             delete($toolhash{'height'});                                  delete($toolhash{$item});
                             if ($residx) {                                  if ($residx) {
                                 if ($toolsettings{'width'}) {                                      if ($toolsettings{$item}) {
                                     push(@deleted,'width');                                          push(@deleted,$item);
                                 }                                      }
                                 if ($toolsettings{'height'}) {  
                                     push(@deleted,'height');  
                                 }                                  }
                             }                              }
                         }                          }
                         if (ref($ltitoolsref->{$toolid}->{'crsconf'}) eq 'HASH') {                          if (ref($ltitoolsref->{$toolid}->{'crsconf'}) eq 'HASH') {
                             foreach my $item ('label','title') {                               foreach my $item ('label','title','linktext','explanation') {
                                   my $crsitem;
                                   if (($item eq 'label') || ($item eq 'title')) {
                                       $crsitem = 'crs'.$item;
                                   } else {
                                       $crsitem = $item;
                                   }
                                 if ($ltitoolsref->{$toolid}->{'crsconf'}->{$item}) {                                  if ($ltitoolsref->{$toolid}->{'crsconf'}->{$item}) {
                                     $toolhash{'crs'.$item} =~ s/^\s+//;                                      $toolhash{$crsitem} =~ s/^\s+//;
                                     $toolhash{'crs'.$item} =~ s/\s+$//;                                      $toolhash{$crsitem} =~ s/\s+$//;
                                     if ($toolhash{'crs'.$item} eq '') {                                      if ($toolhash{$crsitem} eq '') {
                                         delete($toolhash{'crs'.$item});                                          delete($toolhash{$crsitem});
                                     }                                      }
                                 } else {                                  } else {
                                     delete($toolhash{'crs'.$item});                                      delete($toolhash{$crsitem});
                                 }                                  }
                                 if (($residx) && (exists($toolsettings{'crs'.$item}))) {                                  if (($residx) && (exists($toolsettings{$crsitem}))) {
                                     unless (exists($toolhash{'crs'.$item})) {                                      unless (exists($toolhash{$crsitem})) {
                                         push(@deleted,'crs'.$item);                                          push(@deleted,$crsitem);
                                     }                                      }
                                 }                                  }
                             }                              }

Removed from v.1.623  
changed lines
  Added in v.1.624


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