Diff for /loncom/xml/lontable.pm between versions 1.3 and 1.4

version 1.3, 2008/12/01 12:25:06 version 1.4, 2008/12/02 11:57:25
Line 320  value of that configuration parameter is Line 320  value of that configuration parameter is
   
 =head3 Examples:  =head3 Examples:
   
  my $cell_borders = $table->cell_border(); # ask if cell borders are requested.   my $cell_border = $table->cell_border(); # ask if cell borders are requested.
  $table->cell_border(1); # Request cell borders.   $table->cell_border(1); # Request cell borders.
   
 =cut  =cut
   
 sub cell_borders {  sub cell_border {
     my ($self, $new_value) = @_;      my ($self, $new_value) = @_;
   
     if (defined($new_value)) {      if (defined($new_value)) {
  $self->{inner_border} = $new_value;   $self->{inner_border} = $new_value;
     }      }
     reurn $self->{inner_border};      return $self->{inner_border};
 }  }
   
 =pod  =pod
Line 353  sub caption { Line 353  sub caption {
     my ($self, $new_value) = @_;      my ($self, $new_value) = @_;
   
     if (defined($new_value)) {      if (defined($new_value)) {
  $self->catpion = $new_value;   $self->{caption} = $new_value;
     }      }
   
     return $self->caption;      return $self->{caption};
 }  }
   
 =pod  =pod
Line 378  sub theme { Line 378  sub theme {
     my ($self, $new_value) = @_;      my ($self, $new_value) = @_;
   
     if (defined($new_value)) {      if (defined($new_value)) {
  $self->theme = $new_value;   $self->{theme} = $new_value;
     }      }
     return $self->theme;      return $self->{theme};
 }  }
   
 =pod  =pod
Line 414  The default vertical alignment of the ro Line 414  The default vertical alignment of the ro
 sub start_row {  sub start_row {
     my ($self, %config) = @_;      my ($self, %config) = @_;
   
     if ($self->row_open) {       if ($self->{row_open}) { 
  $self->end_row;   $self->end_row();
     }      }
     my $row_hash = {      my $row_hash = {
  default_halign => "left",   default_halign => "left",
Line 434  sub start_row { Line 434  sub start_row {
     my $rows = $self->{rows};      my $rows = $self->{rows};
     push(@$rows, $row_hash);      push(@$rows, $row_hash);
   
     $self->row_open = 1; # Row is now open and ready for business.      $self->{row_open} = 1; # Row is now open and ready for business.
 }  }
   
 =pod  =pod
Line 445  Closes off a row.  Once closed, cells ca Line 445  Closes off a row.  Once closed, cells ca
   
 =head3 Examples:  =head3 Examples:
   
    $table->close_row();     $table->end_row();
   
   
 =cut  =cut
   
 sub close_row {  sub end_row {
     my ($self) = @_;      my ($self) = @_;
   
     if ($self->row_open) {      if ($self->{row_open}) {
   
  # Mostly we need to determine if this row has the maximum   # Mostly we need to determine if this row has the maximum
  # cell count of any row in existence in the table:   # cell count of any row in existence in the table:
Line 473  sub close_row { Line 473  sub close_row {
     $self->{column_count} = $cell_count;      $self->{column_count} = $cell_count;
  }   }
   
  $self->row_closed;   $self->{row_open} = 0;;
     }      }
 }  }
   
Line 509  The default vertical alignment for text Line 509  The default vertical alignment for text
 sub configure_row {  sub configure_row {
     my ($self, $config) = @_;      my ($self, $config) = @_;
   
     if (!$self->row_open) {      if (!$self->{row_open}) {
  $self->start_row();   $self->start_row();
     }      }
           
Line 568  sub add_cell { Line 568  sub add_cell {
   
     # If a row is not open, we must open it:      # If a row is not open, we must open it:
   
     if (!$self->row_open) {      if (!$self->{row_open}) {
  $self->start_row();   $self->start_row();
     }      }
   
Line 613  sub add_cell { Line 613  sub add_cell {
     push(@$current_cells, $cell);      push(@$current_cells, $cell);
 }  }
   
   # The following method allows for testability.
   
   
   sub get_object_attribute {
       my ($self, $attribute) = @_;
       return $self->{$attribute};
   }
   
   
 #   Mandatory initialization.  #   Mandatory initialization.
   BEGIN{
   }
   
 1;  1;
 __END__  __END__

Removed from v.1.3  
changed lines
  Added in v.1.4


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