html
[ class tree: html ] [ index: html ] [ all elements ]

Class: HTMLTable

Source Location: /html/HTMLTable.class.php

Class Overview

ABSTObject
   |
   --PlainTextFormatter
      |
      --HTMLTable

A very important class to generate HTML-tables. To keep a fast performance, this class is not purely object oriented. That means that the tabledatas are not objects - their information are stored in arrays.


Author(s):

Version:

  • 0.3.46

Copyright:

  • Copyright (c) 2003 Daniel Plücken <daniel@debakel.net>

    This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License.

    This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Variables

Methods


Inherited Variables

Inherited Methods

Class: PlainTextFormatter

PlainTextFormatter::breakBy()
Breaks a line after $maxChars characters if no word will be cut else earlier and indent the line for $indent chars
PlainTextFormatter::extractXMLEmbedded()
Replaces entities to special characters. This is very useful for handle HTML embedded in XML.
PlainTextFormatter::format()
Adds $indent spaces in front of each line from given string and breaks after characters count stored in the class variable $maxChars, but only if no word will be break (then the break will be earlier; before the word).
PlainTextFormatter::formatSQL()
Formats sql querys.
PlainTextFormatter::indentText()
Adds $indent spaces in front of each line.
PlainTextFormatter::makeXMLEmbedded()
Replaces special characters to entities. This is very useful for embed HTML in XML.
PlainTextFormatter::maxchars()
Cuts the given text that the length is not longer than $max_chars characters. The last three characters will be "...".
PlainTextFormatter::Plaintext2ASCII()
Replaces character in that kind, that only ascii-character remain.
PlainTextFormatter::reduceWhiteSpaceOfTextAreas()
Replaces each in series appearing whitespaces inside a textarea to only one whitespace.
PlainTextFormatter::setIndent()
Sets the indent of all lines of a string if the function "breakBy", "format" or "blockqoutePlainText" is used and no indent is given by parameter.
PlainTextFormatter::setMaxChars()
Sets the maximum of characters that should be in a line if the function "breakBy", "format" or "blockqoutePlainText" is used and no indent is given by parameter.
PlainTextFormatter::text2HTML()
Replaces character in that kind, that only html-character remain.

Class: ABSTObject

ABSTObject::printComplexData()
Prints out the more complex data by the given array.
ABSTObject::printPrimitiveData()
Prints out the primitive data by the given arrays.
ABSTObject::printStructure()
Prints out the Structure of this Object.
ABSTObject::same()
Checks whether the passed object reference points to this object.
ABSTObject::sameReferences()
Compares two references whether they points to the same object

Class Details

[line 57]
A very important class to generate HTML-tables. To keep a fast performance, this class is not purely object oriented. That means that the tabledatas are not objects - their information are stored in arrays.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  0.3.46
copyright:  

Copyright (c) 2003 Daniel Plücken <daniel@debakel.net>

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

license:  GNU Lesser General Public License


[ Top ]


Class Variables

$attributesArr = array()

[line 164]

Stores all customized attributes of each tabledata. This array carries two dimensions of string types. The first dimension stands for the rows of the table, the second one stands for the cols of the table.



Tags:

access:  private

Type:   array


[ Top ]

$border =  0

[line 214]

Stores the value of the border-attribute of this table.



Tags:

var:  access public

Type:   integer


[ Top ]

$cellHeightArr = array()

[line 118]

Stores the height of each tabledata. This array carries two dimensions of integer types. The first dimension stands for the rows of the table, the second one stands for the cols of the table.



Tags:

access:  private

Type:   array


[ Top ]

$cellpadding =  0

[line 200]

Stores the value of the cellpadding-attribute of this table.



Tags:

var:  access public

Type:   integer


[ Top ]

$cellspacing =  0

[line 207]

Stores the value of the cellspacing-attribute of this table.



Tags:

var:  access public

Type:   integer


[ Top ]

$cellStyleClassArr = array()

[line 155]

Stores the styleclass of each tabledata. This array carries two dimensions of string types. The first dimension stands for the rows of the table, the second one stands for the cols of the table.



Tags:

access:  private

Type:   array


[ Top ]

$cellWidthArr = array()

[line 109]

Stores the width of each tabledata. This array carries two dimensions of integer types. The first dimension stands for the rows of the table, the second one stands for the cols of the table.



Tags:

access:  private

Type:   array


[ Top ]

$cols =  0

[line 79]

Stores the cols count of this table.



Tags:

access:  private

Type:   string


[ Top ]

$colspanArr = array()

[line 137]

Stores the colspan of each tabledata. This array carries two dimensions of integer types. The first dimension stands for the rows of the table, the second one stands for the cols of the table.



Tags:

access:  private

Type:   array


[ Top ]

$contentArr = array()

[line 100]

Stores the content of each tabledata. This array carries two dimensions of string types. The first dimension stands for the rows of the table, the second one stands for the cols of the table.



Tags:

access:  private

Type:   array


[ Top ]

$freestyle =

[line 87]

Can filled with styledefinitions that were not handled by an implemented method.



Tags:

access:  public

Type:   string


[ Top ]

$height =  0

[line 193]

Stores the value of the height-attribute of this table.



Tags:

var:  access public

Type:   integer


[ Top ]

$id =  "table_"

[line 65]

The id or name of this table.



Tags:

access:  public

Type:   string


[ Top ]

$no_format =  false

[line 239]

Stores whether the table should be formatted by the PlainTextFormatter or not.



Tags:

access:  private

Type:   boolean


[ Top ]

$no_format_arr = array()

[line 128]

Stores whether a tabledata should be formatted by the PlainTextFormatter or not. This array carries two dimensions of boolean types. The first dimension stands for the rows of the table, the second one stands for the cols of the table.



Tags:

access:  private

Type:   array


[ Top ]

$rowAttributes = array()

[line 175]

Stores the customized attributes of each table's row.



Tags:

access:  private

Type:   array


[ Top ]

$rows =  0

[line 72]

Stores the rows count of this table.



Tags:

access:  private

Type:   string


[ Top ]

$rowspanArr = array()

[line 146]

Stores the rowspan of each tabledata. This array carries two dimensions of integer types. The first dimension stands for the rows of the table, the second one stands for the cols of the table.



Tags:

access:  private

Type:   array


[ Top ]

$style =  ""

[line 221]

Stores the value of the class-attribute of this table



Tags:

var:  access public

Type:   integer


[ Top ]

$tableAttributes =  ""

[line 228]

Stores the customized attributes of this table.



Tags:

access:  public

Type:   string


[ Top ]

$width =  0

[line 186]

Stores the value of the width-attribute of this table.



Tags:

var:  access public

Type:   integer


[ Top ]



Class Methods


constructor HTMLTable [line 262]

HTMLTable HTMLTable( integer $cols, [integer $rows = 0], [integer $width = ""], [integer $height = ""], [ $cellWidthArr = array()], [ $cellHeightArr = array()], [array $cellpadding = ""], [array $cellspacing = ""], [integer $border = ""], [string $style = ""], [boolean $no_format = false])

Constructor.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.2
since:  0.1.0
access:  public


Parameters:

integer   $cols  
integer   $rows  
integer   $width  
integer   $height  
array   $cellpadding  
array   $cellspacing  
integer   $border  
string   $style  
boolean   $no_format  
   $cellWidthArr  
   $cellHeightArr  

[ Top ]

method addAttributeToRow [line 544]

void addAttributeToRow( string $string, [integer $row = ""])

Adds a custom-attribute to the given row of this table. The counting of rows begins at zero.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.1
since:  0.1.2
access:  public


Parameters:

string   $string  
integer   $row  

[ Top ]

method addAttributeToTable [line 566]

void addAttributeToTable( string $string, integer $row)

Adds a custom-attribute to the table-tag.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.2
access:  public


Parameters:

string   $string  
integer   $row  

[ Top ]

method addCell [line 892]

array addCell( [string $content = ""], [string $style = ""], [string $colspan = "1"], [string $rowspan = "1"], [ $noFormat = false], string $no_format)

Adds a cell at the next possible position to this table. This method is an alias for the method addCol.



Tags:

return:  The position where the cell was fixed.
author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.2.8
access:  public


Parameters:

string   $content   The content the cell should have.
string   $style   The value of the class-attribute of the cell that should be add.
string   $colspan   The value of the colspan-attribute of the cell that should be add.
string   $rowspan   The value of the rowspan-attribute of the cell that should be add.
string   $no_format   Ascertains whether the content of the cell should format by newlines ("\r\n") or not.
   $noFormat  

[ Top ]

method addCol [line 788]

array addCol( [string $content = ""], [string $style = ""], [string $colspan = "1"], [string $rowspan = "1"], [ $noFormat = false], string $no_format)

Adds a cell at the next possible position to this table.



Tags:

return:  The position where the cell was fixed.
author:  Daniel Plücken <daniel@debakel.net>
version:  1.5
since:  0.1.0
access:  public


Parameters:

string   $content   The content the cell should have.
string   $style   The value of the class-attribute of the cell that should be add.
string   $colspan   The value of the colspan-attribute of the cell that should be add.
string   $rowspan   The value of the rowspan-attribute of the cell that should be add.
string   $no_format   Ascertains whether the content of the cell should format by newlines ("\r\n") or not.
   $noFormat  

[ Top ]

method addContentToCol [line 992]

void addContentToCol( integer $row, integer $col, string $content, [string $BEFORE_BEHIND = ""])

Changes a given cell.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.4
access:  public


Parameters:

integer   $row   The row in which the cell to be change is.
integer   $col   The col in which the cell to be change is.
string   $content   The content that should be add to the actual content of the cell.
string   $BEFORE_BEHIND   Controls whether the given content should be add before or behind the actual content of the cell. The possible values are: "BEFORE" -> The new content will be add before the actual content. "BEHIND" -> The new content will be add behind the actual content.

[ Top ]

method addRow [line 1047]

void addRow( [array $contentArr = array()], [array $styleClassArr = array()], [array $no_format_arr = array()], [ $otherAttributes = array()])

Adds a new row after the last row of this table. If there are lesser cols

in the last row of this table than a row is able to contain, the last row will NOT be filled up with cols. This function ONLY adds a COMPLETE new row AFTER the last row of this table!




Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.1
access:  public


Parameters:

array   $contentArr   An array of strings which should contain the content of each col in the row. Id est if a row of this table is able to contain ten cols then the array should be contain ten records.
array   $styleClassArr   An array of strings which declares the styleclass of the appropriate col.
array   $no_format_arr   An array of booleans. If the the value is false it means that after the &lt;td&gt;-tag and after the content of the appropriate col there will be add a linebreak ("\n"). If the value is true no linebreaks will be add. You need this functionality if there are side by side lying pictures in a table which should not has any spaces to each other. array $otherAttributes An array of strings which can be used to add col-attributes to the appropriate col.
   $otherAttributes  

[ Top ]

method changeCol [line 922]

void changeCol( integer $row, integer $col, [ $content = ""], [string $styleClass = ""], [integer $rowspan = 1], [integer $colspan = 1], [boolean $noFormat = false], [string $otherAttributes = ""])

Changes the given cell.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.2
since:  0.1.7
access:  public


Parameters:

integer   $row   The row in which the cell that should become change is.
integer   $col   The col in which the cell that should become change is.
string   $styleClass   The style class that should set to the cell.
integer   $rowspan   To manipulate the rowspan.
integer   $colspan   To manipulate the colspan.
boolean   $noFormat   Whether the content in the col should automatically get breaks or not.
string   $otherAttributes   The attributes that should set to the given col.
   $content  

[ Top ]

method get [line 1127]

string get( )

Returns a generated string based on the Attributes of this HTML-Object.



Tags:

version:  1.24
since:  0.1.0
access:  public


[ Top ]

method getClone [line 580]

HTMLTable getClone( )

Returns a clone of this object.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.1
since:  0.1.3
access:  public


[ Top ]

method getCloneWithCols [line 620]

HTMLTable getCloneWithCols( array $col_arr)

Returns a clone of this object only with the specified cols.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.3.1
access:  public


Parameters:

array   $col_arr   An array containing the numbers of the cols which should adopt to the clone. The counting bigins at zero from left to right. This value can also be an integer to adopt only one col.

[ Top ]

method getCloneWithRows [line 679]

HTMLTable getCloneWithRows( $row_arr, array $col_arr)

Returns a clone of this object only with the specified rows.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.3.1
access:  public


Parameters:

array   $col_arr   An array containing the numbers of the rows which should adopt to the clone. The counting bigins at zero from top to bottom. This value can also be an integer to adopt only one row.
   $row_arr  

[ Top ]

method getPHPSource [line 1089]

string getPHPSource( )

Returns the rebuilded source code of this Object.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.2.3
access:  public


[ Top ]

method idExists [line 324]

boolean idExists( string $str_id, [boolean $bool_store = false])

Stores all used ids and makes sure that every id in the document is unique. It should called in every get method of classes in the packages forms and html.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.3.4
access:  public


Parameters:

string   $str_id  
boolean   $bool_store  

[ Top ]

method setBorder [line 497]

void setBorder( integer $int)

Sets the content of the border-attribute of the table-tag.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.0
access:  public


Parameters:

integer   $int  

[ Top ]

method setCellpadding [line 452]

void setCellpadding( integer $int)

Sets the content of the cellpadding-attribute of the table-tag.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.0
access:  public


Parameters:

integer   $int  

[ Top ]

method setCellspacing [line 482]

void setCellspacing( integer $int)

Sets the content of the cellspacing-attribute of the table-tag.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.0
access:  public


Parameters:

integer   $int  

[ Top ]

method setCellSpanRange [line 732]

void setCellSpanRange( integer $row, integer $col, [integer $rowspan = 1], [integer $colspan = 1])

Sets the span of the cell at the given position.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.1
since:  0.1.5
access:  public


Parameters:

integer   $row  
integer   $col  
integer   $rowspan  
integer   $colspan  

[ Top ]

method setColAttributes [line 966]

void setColAttributes( integer $row, integer $col, string $attributes)

Changes the attributes of a given cell.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.7
access:  public


Parameters:

integer   $row   The row in which the cell to be change is.
integer   $col   The col in which the cell to be change is.
string   $attributes   The attributes that should set to the given col.

[ Top ]

method setCols [line 421]

void setCols( integer $int)

Sets the number of cols this table should have. For example you want to set the table column by column, you simply have to increment the number of cols of this table by one after you set all rows of a col, and so on.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.0
access:  public


Parameters:

integer   $int  

[ Top ]

method setFreeStyle [line 467]

void setFreeStyle( string $string)

Set the value of style definitions that are not handled by implemented methods.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.3.1
access:  public


Parameters:

string   $string  

[ Top ]

method setHeight [line 404]

void setHeight( integer $int)

Sets the value of the height-attribute of the table-tag.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.0
access:  public


Parameters:

integer   $int  

[ Top ]

method setId [line 372]

void setId( string $string)

Sets the content of the id-attribute of the table-tag.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.1
access:  public


Parameters:

string   $string  

[ Top ]

method setNoFormat [line 512]

void setNoFormat( [ $boolean = true], integer $int)

Sets whether the table should format in the source by "\r\n" or not.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.1
access:  public


Parameters:

integer   $int  
   $boolean  

[ Top ]

method setRows [line 437]

void setRows( integer $int)

Sets the number of rows this table should have. This makes only sense if you want to put out a table without any content.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.0
access:  public


Parameters:

integer   $int  

[ Top ]

method setStyle [line 527]

void setStyle( $string, integer $int)

Sets the content of the class-attribute of the table-tag.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.1
access:  public


Parameters:

integer   $int  
   $string  

[ Top ]

method setWidth [line 389]

void setWidth( integer $int)

Sets the value of the width-attribute of the table-tag.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.0
access:  public


Parameters:

integer   $int  

[ Top ]


Documentation generated on Thu, 05 Jun 2008 19:13:19 +0200 by phpDocumentor 1.4.1