Diff for /loncom/interface/spreadsheet/Spreadsheet.pm between versions 1.16 and 1.17

version 1.16, 2003/06/20 16:14:30 version 1.17, 2003/06/23 19:58:18
Line 1143  sub display { Line 1143  sub display {
 ############################################  ############################################
 sub html_export_row {  sub html_export_row {
     my $self = shift();      my $self = shift();
       my ($color) = @_;
       $color = '#CCCCFF' if (! defined($color));
     my $allowed = &Apache::lonnet::allowed('mgr',$ENV{'request.course.id'});      my $allowed = &Apache::lonnet::allowed('mgr',$ENV{'request.course.id'});
     my $row_html;      my $row_html;
     my @rowdata = $self->get_row(0);      my @rowdata = $self->get_row(0);
     foreach my $cell (@rowdata) {      foreach my $cell (@rowdata) {
         if ($cell->{'name'} =~ /^[A-Z]/) {          if ($cell->{'name'} =~ /^[A-Z]/) {
     $row_html .= '<td bgcolor="#CCCCFF">'.      $row_html .= '<td bgcolor="'.$color.'">'.
                 &html_editable_cell($cell,'#CCCCFF',$allowed).'</td>';                  &html_editable_cell($cell,$color,$allowed).'</td>';
         } else {          } else {
     $row_html .= '<td bgcolor="#DDCCFF">'.      $row_html .= '<td bgcolor="#DDCCFF">'.
                 &html_editable_cell($cell,'#DDCCFF',$allowed).'</td>';                  &html_editable_cell($cell,'#DDCCFF',$allowed).'</td>';
Line 1161  sub html_export_row { Line 1163  sub html_export_row {
 sub html_template_row {  sub html_template_row {
     my $self = shift();      my $self = shift();
     my $allowed = &Apache::lonnet::allowed('mgr',$ENV{'request.course.id'});      my $allowed = &Apache::lonnet::allowed('mgr',$ENV{'request.course.id'});
     my ($num_uneditable) = @_;      my ($num_uneditable,$importcolor) = @_;
     my $row_html;      my $row_html;
     my @rowdata = $self->get_template_row();      my @rowdata = $self->get_template_row();
     my $count = 0;      my $count = 0;
     for (my $i = 0; $i<=$#rowdata; $i++) {      for (my $i = 0; $i<=$#rowdata; $i++) {
         my $cell = $rowdata[$i];          my $cell = $rowdata[$i];
         if ($i < $num_uneditable) {          if ($i < $num_uneditable) {
     $row_html .= '<td bgcolor="#FFDDDD">'.      $row_html .= '<td bgcolor="'.$importcolor.'">'.
                 &html_uneditable_cell($cell,'#FFDDDD',$allowed).'</td>';                  &html_uneditable_cell($cell,'#FFDDDD',$allowed).'</td>';
         } else {          } else {
     $row_html .= '<td bgcolor="#EOFFDD">'.      $row_html .= '<td bgcolor="#EOFFDD">'.
Line 1222  sub html_uneditable_cell { Line 1224  sub html_uneditable_cell {
   
 sub html_row {  sub html_row {
     my $self = shift();      my $self = shift();
     my ($num_uneditable,$row) = @_;      my ($num_uneditable,$row,$exportcolor,$importcolor) = @_;
     my $allowed = &Apache::lonnet::allowed('mgr',$ENV{'request.course.id'});      my $allowed = &Apache::lonnet::allowed('mgr',$ENV{'request.course.id'});
     my @rowdata = $self->get_row($row);      my @rowdata = $self->get_row($row);
     my $num_cols_output = 0;      my $num_cols_output = 0;
     my $row_html;      my $row_html;
       my $color = $importcolor;
       if ($row == 0) {
           $color = $exportcolor;
       }
       $color = '#FFDDDD' if (! defined($color));
     foreach my $cell (@rowdata) {      foreach my $cell (@rowdata) {
  if ($num_cols_output++ < $num_uneditable) {   if ($num_cols_output++ < $num_uneditable) {
     $row_html .= '<td bgcolor="#FFDDDD">';      $row_html .= '<td bgcolor="'.$color.'">';
     $row_html .= &html_uneditable_cell($cell,'#FFDDDD');      $row_html .= &html_uneditable_cell($cell,'#FFDDDD');
  } else {   } else {
     $row_html .= '<td bgcolor="#EOFFDD">';      $row_html .= '<td bgcolor="#EOFFDD">';

Removed from v.1.16  
changed lines
  Added in v.1.17


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