Diff for /loncom/interface/londocs.pm between versions 1.660 and 1.665

version 1.660, 2019/04/11 14:22:35 version 1.665, 2019/08/16 14:22:49
Line 1790  sub do_paste_from_buffer { Line 1790  sub do_paste_from_buffer {
     %msgs = &Apache::lonlocal::texthash (      %msgs = &Apache::lonlocal::texthash (
                 notinsupp => 'Paste failed: content type is not supported within Supplemental Content',                  notinsupp => 'Paste failed: content type is not supported within Supplemental Content',
                 notincrs  => 'Paste failed: Item is from a different course which you do not have rights to edit.',                  notincrs  => 'Paste failed: Item is from a different course which you do not have rights to edit.',
                 notindom  => 'Paste failed: Item is an external tool from a course in a different donain.',                   notindom  => 'Paste failed: Item is an external tool from a course in a different domain.',
                 duplicate => 'Paste failed: only one instance of a particular published sequence or page is allowed within each course.',                  duplicate => 'Paste failed: only one instance of a particular published sequence or page is allowed within each course.',
             );              );
   
Line 2329  sub copy_templated_files { Line 2329  sub copy_templated_files {
         my @simpleprobqtypes = qw(radio option string essay numerical);          my @simpleprobqtypes = qw(radio option string essay numerical);
         my $qtype=$srcparms{$srcprefix.'questiontype'};          my $qtype=$srcparms{$srcprefix.'questiontype'};
         if (grep(/^\Q$qtype\E$/,@simpleprobqtypes)) {          if (grep(/^\Q$qtype\E$/,@simpleprobqtypes)) {
             my %newdata;              my %newdata = (
                   $newprefix.'questiontype' => $qtype,
               );
             foreach my $type (@simpleprobqtypes) {              foreach my $type (@simpleprobqtypes) {
                 if ($type eq $qtype) {                  if ($type eq $qtype) {
                     $newdata{"$weightprefix.$type.weight"}=1;                      $newdata{"$weightprefix.$type.weight"}=1;
Line 2803  sub apply_fixups { Line 2805  sub apply_fixups {
                 }                  }
             }              }
             if (ref($resdatacopy{$key}) eq 'HASH') {              if (ref($resdatacopy{$key}) eq 'HASH') {
                 if ($newsubdir{$key}) {                  my ($gotnewmapname,$newmapname,$srcfolder,$srccontainer);
   
                 }  
                 foreach my $idx (keys(%{$resdatacopy{$key}})) {                  foreach my $idx (keys(%{$resdatacopy{$key}})) {
                     if (ref($resdatacopy{$key}{$idx}) eq 'HASH') {                      if (ref($resdatacopy{$key}{$idx}) eq 'HASH') {
                         my $srcurl = $resdatacopy{$key}{$idx}{'src'};                          my $srcurl = $resdatacopy{$key}{$idx}{'src'};
Line 2815  sub apply_fixups { Line 2815  sub apply_fixups {
                                 ($resdatacopy{$key}{$idx}{'cnum'} =~ /^$match_courseid$/)) {                                  ($resdatacopy{$key}{$idx}{'cnum'} =~ /^$match_courseid$/)) {
                                 my $srcdom = $resdatacopy{$key}{$idx}{'cdom'};                                  my $srcdom = $resdatacopy{$key}{$idx}{'cdom'};
                                 my $srcnum = $resdatacopy{$key}{$idx}{'cnum'};                                  my $srcnum = $resdatacopy{$key}{$idx}{'cnum'};
                                 my ($newmapname) = ($key =~ m{/([^/]+)$});                                  unless ($gotnewmapname) {
                                 my ($srcfolder,$srccontainer) = split(/\./,$newmapname);                                      ($newmapname) = ($key =~ m{/([^/]+)$});
                                       ($srcfolder,$srccontainer) = split(/\./,$newmapname);
                                       if ($newsubdir{$key}) {
                                           $newmapname =~ s/^((?:default|supplemental)_)(\d+)/$1$newsubdir{$key}/;
                                       }
                                       $gotnewmapname = 1;
                                   }
                                 my $srcmapinfo = $srcfolder.':'.$idx;                                  my $srcmapinfo = $srcfolder.':'.$idx;
                                 if ($srccontainer eq 'page') {                                  if ($srccontainer eq 'page') {
                                     $srcmapinfo .= ':1';                                      $srcmapinfo .= ':1';
                                 }                                  }
                                 if ($newsubdir{$key}) {  
                                     $newmapname =~ s/^((?:default|supplemental)_)(\d+)/$1$newsubdir{$key}/;  
                                 }  
                                 &copy_templated_files($srcurl,$srcdom,$srcnum,$srcmapinfo,$cdom,                                  &copy_templated_files($srcurl,$srcdom,$srcnum,$srcmapinfo,$cdom,
                                                       $cnum,$template,$idx,$newmapname);                                                        $cnum,$template,$idx,$newmapname);
                             }                              }
Line 5967  sub handler { Line 5970  sub handler {
  my $fileupload=(<<FIUP);   my $fileupload=(<<FIUP);
         $quotainfo          $quotainfo
  $lt{'file'}:<br />   $lt{'file'}:<br />
  <input type="file" name="uploaddoc" class="flUpload" size="40" $disabled />   <input type="file" name="uploaddoc" class="LC_flUpload" size="40" $disabled />
         <input type="hidden" id="free_space" value="$free_space" />          <input type="hidden" id="LC_free_space" value="$free_space" />
 FIUP  FIUP
   
  my $checkbox=(<<CHBO);   my $checkbox=(<<CHBO);

Removed from v.1.660  
changed lines
  Added in v.1.665


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