Diff for /loncom/lonmap.pm between versions 1.11 and 1.15

version 1.11, 2013/05/30 05:04:16 version 1.15, 2014/12/11 01:50:27
Line 157  sub merge_hash { Line 157  sub merge_hash {
  $key .= '.'; # If we are prefixing, prefix then .   $key .= '.'; # If we are prefixing, prefix then .
     }      }
   
     foreach my $childkey (keys (%$child)) {      foreach my $childkey (keys(%$child)) {
  $parent->{$key . $childkey} = $child->{$childkey};   $parent->{$key . $childkey} = $child->{$childkey};
     }      }
 }  }
Line 213  sub get_mapalias_errors { Line 213  sub get_mapalias_errors {
  $count++;   $count++;
      }       }
      my ($mapid) = split(/\./,$id);       my ($mapid) = split(/\./,$id);
      &mt('Resource "[_1]" <br /> in Map "[_2]"',       &mt('Resource [_1][_2]in Map [_3]',
  $hash->{'title_'.$id},   '"'.$hash->{'title_'.$id}.'"',
  $hash->{'title_'.$hash->{'ids_'.$hash->{'map_id_'.$mapid}}});                           '<br />',
    '"'.$hash->{'title_'.$hash->{'ids_'.$hash->{'map_id_'.$mapid}}}.'"');
  } (@{ $mapalias_cache{$mapalias} }));   } (@{ $mapalias_cache{$mapalias} }));
  next if ($count < 2);   next if ($count < 2);
  $error_text .= '<div class="LC_error">'.   $error_text .= '<div class="LC_error">'.
Line 278  sub process_versions { Line 279  sub process_versions {
  $cenv->{'domain'},   $cenv->{'domain'},
  $cenv->{'num'});   $cenv->{'num'});
   
     foreach my $ver (keys (%versions)) {      foreach my $ver (keys(%versions)) {
  if ($ver =~/^error\:/) { # lonc/lond transaction failed.   if ($ver =~/^error\:/) { # lonc/lond transaction failed.
     throw Error::Simple('lonc/lond returned error: ' . $ver);      throw Error::Simple('lonc/lond returned error: ' . $ver);
  }   }
Line 409  sub hiddenurls { Line 410  sub hiddenurls {
     my $courseid = $hash->{'context.courseid'};      my $courseid = $hash->{'context.courseid'};
   
     my $randomoutentry='';      my $randomoutentry='';
     foreach my $rid (keys %randompick) {      foreach my $rid (keys(%randompick)) {
         my $rndpick=$randompick{$rid};          my $rndpick=$randompick{$rid};
         my $mpc=$hash->{'map_pc_'.$hash->{'src_'.$rid}};          my $mpc=$hash->{'map_pc_'.$hash->{'src_'.$rid}};
 # ------------------------------------------- put existing resources into array  # ------------------------------------------- put existing resources into array
Line 449  sub hiddenurls { Line 450  sub hiddenurls {
         }          }
     }      }
 # ------------------------------ take care of explicitly hidden urls or folders  # ------------------------------ take care of explicitly hidden urls or folders
     foreach my $rid (keys %hiddenurl) {      foreach my $rid (keys(%hiddenurl)) {
  $hash->{'randomout_'.$rid}='1';   $hash->{'randomout_'.$rid}='1';
  my ($mapid,$resid)=split(/\./,$rid);   my ($mapid,$resid)=split(/\./,$rid);
  $randomoutentry.='&'.   $randomoutentry.='&'.
Line 615  sub traceroute { Line 616  sub traceroute {
  my $symb=&Apache::lonnet::encode_symb($hash->{'map_id_'.$mapid},$resid,   my $symb=&Apache::lonnet::encode_symb($hash->{'map_id_'.$mapid},$resid,
       $hash->{'src_'.$rid});        $hash->{'src_'.$rid});
  my $hidden=&Apache::lonnet::EXT('resource.0.hiddenresource',$symb);   my $hidden=&Apache::lonnet::EXT('resource.0.hiddenresource',$symb);
           my $ignorehidden;
   
  if ($hdnflag || lc($hidden) eq 'yes') {   if ($hdnflag || lc($hidden) eq 'yes') {
             my $ignorehidden;  
             if (defined($hash->{'is_map_'.$rid})) {              if (defined($hash->{'is_map_'.$rid})) {
                 if (($hash->{'context.nohideurl'}) && ($hash->{'context.nohideurl'} eq $hash->{'src_'.$rid})) {                  if (($hash->{'context.nohideurl'}) && ($hash->{'context.nohideurl'} eq $hash->{'src_'.$rid})) {
                     $ignorehidden = 1; # Hidden parameter explicitly deleted                       $ignorehidden = 1; # Hidden parameter explicitly deleted 
Line 656  sub traceroute { Line 657  sub traceroute {
   
  if (defined($hash->{'is_map_'.$rid})) {   if (defined($hash->{'is_map_'.$rid})) {
     if (defined($hash->{'map_start_'.$hash->{'src_'.$rid}})) {      if (defined($hash->{'map_start_'.$hash->{'src_'.$rid}})) {
                   my $maphidden;
                   unless ($ignorehidden) {
                       $maphidden = $hdnflag || $hiddenurl{$rid};
                   }
  $sofar=$newsofar=   $sofar=$newsofar=
     &traceroute($sofar,      &traceroute($sofar,
  $hash->{'map_start_'.$hash->{'src_'.$rid}},   $hash->{'map_start_'.$hash->{'src_'.$rid}},
  $beenhere,   $beenhere,
  $encflag || $encurl{$rid},   $encflag || $encurl{$rid},
  $hdnflag || $hiddenurl{$rid}, $hash);   $maphidden, $hash);
     }      }
  }   }
   
Line 681  sub traceroute { Line 686  sub traceroute {
  $further=simplify('('.'_'.$rid.')&('.   $further=simplify('('.'_'.$rid.')&('.
   $hash->{'condid_'.$hash->{'undercond_'.$id}}.')');    $hash->{'condid_'.$hash->{'undercond_'.$id}}.')');
     } else {      } else {
  my $errtext.=&mt('<br />Undefined condition ID: [_1]',$hash->{'undercond_'.$id});   my $errtext.='<br />'.&mt('Undefined condition ID: [_1]',$hash->{'undercond_'.$id});
  throw Error::Simple($errtext);   throw Error::Simple($errtext);
     }      }
                 }                  }
Line 1252  sub read_map { Line 1257  sub read_map {
     my $ispage = ($filename =~/\.page$/);      my $ispage = ($filename =~/\.page$/);
     unless ($ispage || ($filename =~ /\.sequence$/)) {      unless ($ispage || ($filename =~ /\.sequence$/)) {
  &Apache::lonnet::logthis("invalid: $filename : $uri");   &Apache::lonnet::logthis("invalid: $filename : $uri");
  throw Error::Simple(&mt("<br />Invalid map: <tt>[_1]</tt>", $filename));   throw Error::Simple('<br />'.&mt('Invalid map: [_1]','<span class="LC_filename">'.$filename.'</span>'));
     }      }
   
     $filename =~ /\.(\w+)$/;      $filename =~ /\.(\w+)$/;
Line 1263  sub read_map { Line 1268  sub read_map {
         
     my $contents = &Apache::lonnet::getfile($filename);      my $contents = &Apache::lonnet::getfile($filename);
     if($contents eq -1) {      if($contents eq -1) {
         throw Error::Simple(&mt('<br />Map not loaded: The file <tt>[_1]</tt> does not exist.',          throw Error::Simple('<br />'.&mt('Map not loaded: The file [_1] does not exist.',
  $filename));   '<span class="LC_filename">'.$filename.'</span>'));
     }      }
     # Now that we succesfully retrieved the file we can make our parsing passes over it:      # Now that we succesfully retrieved the file we can make our parsing passes over it:
     # parsing is done in passes:      # parsing is done in passes:

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


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