Diff for /loncom/interface/spreadsheet/Spreadsheet.pm between versions 1.82 and 1.83

version 1.82, 2013/08/09 17:58:15 version 1.83, 2014/02/12 16:54:21
Line 774  sub calc { Line 774  sub calc {
         $depth++;          $depth++;
         if ($depth>100) {          if ($depth>100) {
     undef %sheet_values;      undef %sheet_values;
             return $lastcalc.': Maximum calculation depth exceeded';              return $lastcalc.': '.&mt('Maximum calculation depth exceeded');
         }          }
     }      }
     return 'okay';      return 'okay';
Line 873  sub expandnamed { Line 873  sub expandnamed {
             $returnvalue = $values[0];              $returnvalue = $values[0];
         } elsif (scalar(@matches) > 0) {          } elsif (scalar(@matches) > 0) {
             # more than one match.  Look for a concise one              # more than one match.  Look for a concise one
             $returnvalue =  "'non-unique parameter name : $expression'";              $returnvalue =  "'".&mt('non-unique parameter name: [_1]',$expression).'"';
             for (my $i=0; $i<=$#matches;$i++) {              for (my $i=0; $i<=$#matches;$i++) {
                 if ($matches[$i] =~ /^$expression$/) {                  if ($matches[$i] =~ /^$expression$/) {
                     # why do we not do this lookup here?                      # why do we not do this lookup here?
Line 883  sub expandnamed { Line 883  sub expandnamed {
         } else {          } else {
             # There was a negative number of matches, which indicates               # There was a negative number of matches, which indicates 
             # something is wrong with reality.  Better warn the user.              # something is wrong with reality.  Better warn the user.
             $returnvalue = '"bizzare parameter: '.$expression.'"';              $returnvalue = "'".&mt('bizzare parameter: [_1]',$expression)."'";
         }          }
         return $returnvalue;          return $returnvalue;
     }      }
Line 1267  sub html_report_error { Line 1267  sub html_report_error {
     my $self = shift();      my $self = shift();
     my $Str = '';      my $Str = '';
     if ($self->badcalc()) {      if ($self->badcalc()) {
         $Str = '<h3 style="color:red">'.          $Str = '<p class="LC_error">'.
             &mt('An error occurred while calculating this spreadsheet').              &mt('An error occurred while calculating this spreadsheet').
             "</h3>\n".              "</p>\n".
             '<pre>'.$self->calcerror()."</pre>\n";              '<pre>'.$self->calcerror()."</pre>\n";
     }      }
     return $Str;      return $Str;
Line 1432  sub output_selector { Line 1432  sub output_selector {
     foreach  ($self->output_options()) {      foreach  ($self->output_options()) {
         $output_selector.='<option value="'.$_->{'value'}.'"';          $output_selector.='<option value="'.$_->{'value'}.'"';
         if ($_->{'value'} eq $default) {          if ($_->{'value'} eq $default) {
             $output_selector .= ' selected';              $output_selector .= ' selected="selected"';
         }          }
         $output_selector .= ">".&mt($_->{'description'})."</option>\n";          $output_selector .= ">".&mt($_->{'description'})."</option>\n";
     }      }
Line 1509  sub outsheet_excel { Line 1509  sub outsheet_excel {
     #      #
     # Write a link to allow them to download it      # Write a link to allow them to download it
     $r->print('<br />'.      $r->print('<br />'.
               '<a href="'.$filename.'">Your Excel spreadsheet.</a>'."\n");                '<a href="'.$filename.'">'.&mt('Your Excel spreadsheet').'</a>'."\n");
     return;      return;
 }  }
   
Line 1695  sub load { Line 1695  sub load {
             my $sheetxml=&Apache::lonnet::getfile              my $sheetxml=&Apache::lonnet::getfile
                 (&Apache::lonnet::filelocation('',$filename));                  (&Apache::lonnet::filelocation('',$filename));
             if ($sheetxml == -1) {              if ($sheetxml == -1) {
                 $sheetxml='<field row="0" col="A">"Error loading spreadsheet '                  $sheetxml='<field row="0" col="A">'.
                     .$self->filename().'"</field>';                            &mt('Error loading spreadsheet [_1]',
                                     '"'.$self->filename().'"').
                             '</field>';
             }              }
             ($formulas,undef) = &parse_sheet(\$sheetxml);              ($formulas,undef) = &parse_sheet(\$sheetxml);
             # Get just the filename and set the sheets filename              # Get just the filename and set the sheets filename

Removed from v.1.82  
changed lines
  Added in v.1.83


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