Class Table

Description

Located in /base/include/class.table.php (line 30)


	
			
Direct descendents
Class Description
Form
Variable Summary
mixed $fstyles
mixed $row_count
mixed $table
Method Summary
Table Table ()
int AddRow ()
string CompileTable ()
void getContent ()
int GetCurrentRow ()
int insertRow (mixed $content)
void PrintTable ()
void printTableArray ()
void Set2RowColors (string $odd_colors, string $even_colors, [int $start = 1], [int $end = false])
void SetCellAttribute (int $row, int $col, string $attribute, string $value)
void SetCellAttributes (int $row, int $col, array $array)
void SetCellBGColor (int $row, int $col, string $bgcolor)
void SetCellColSpan (int $row, int $col, int $colspan)
void SetCellContent (int $row, int $col, string $content)
void SetCellRowSpan (int $row, int $col, int $rowspan)
void SetCellStyle (int $row, int $col, string $style)
void setClass (mixed $row, mixed $col, mixed $class)
void SetColContent (mixed $col, mixed $content)
void SetDefaultBGColor (string $bgcolor)
void SetDefaultCellAttribute (string $attribute, string $value)
void SetDefaultCellAttributes (array $array)
void SetDefaultCellContent (string $content)
void SetDefaultStyle (string $style)
void SetDefaultTableAttribute (array $array)
void SetFancyColStyle (int $col, array $attributes)
void SetFancyRowStyle (int $row, array $attributes)
void SetRowContent (mixed $row, mixed $content)
void SetTableAttribute (mixed $key, mixed $value, array $array)
void SetTableAttributes (array $array)
Variables
mixed $default_settings (line 52)

Default settings array

These are the default settings array. All default settings are stored here and are not moved to the $table array until the CompileTable method is resolved, and even then, it is only moving it to a temporary array.

  • access: private
mixed $fstyles (line 74)

Fancy styles array

The fancy styles array. This stores information regarding row and column styles. Anything added to make display of certain effects easier ( this is to imply that any further display-like mehthods add will be stored in this array here ).

  • access: private
mixed $row_count (line 62)

Total rows array

This keeps track of the total number of rows.

  • access: private
mixed $table (line 41)

Table structure array

This is the table array. It keeps track of all cell content and attributes. $table[0]["table_values"] is reserved for table information. Cells start at $table[1][1].

  • access: private
Methods
Constructor Table (line 81)

Initializes the class variables.

  • access: public
Table Table ()
AddRow (line 98)

Adds 1 to the row_count count, keeping track of the total number of rows in the table. It returns the current row_count after the addition.

  • return: Returns the current number of rows
  • access: public
int AddRow ()
CompileTable (line 526)

Compile table to HTML.

Turns the table array into an HTML table. This must be called before a table can be printed out.

  • return: Returns a string of the table in HTML Format
  • access: public
string CompileTable ()
getContent (line 636)

fetches out the compiled table.

  • access: public
void getContent ()

Redefined in descendants as:
GetCurrentCols (line 142)

Returns the current total number of columns in your table

  • return: Returns the current number of rows.
  • access: public
int GetCurrentCols ()
GetCurrentRow (line 131)

Returns the current row you are working with.

  • return: Returns the current number of rows.
  • access: public
int GetCurrentRow ()
insertRow (line 109)

Adds a whole line to the table. Argument must be an array.

  • return: Returns the current number of rows
  • access: public
int insertRow (mixed $content)
PrintTable (line 626)

Prints out the compiled table.

  • access: public
void PrintTable ()
printTableArray (line 647)

Allows you to quickly see what is located and where it's located in your table array. Used for debugging purposes.

void printTableArray ()
Set2RowColors (line 500)

Set alternating colors.

You simply put in two HTML compatible colors, like #ffffff, or 'white' and it will creat alternating color rows.

  • access: public
void Set2RowColors (string $odd_colors, string $even_colors, [int $start = 1], [int $end = false])
  • string $odd_colors: The odd numbered rows bgcolor value
  • string $even_colors: The even numbered rows bgcolor value
  • int $start: What row to start outputting the alternating colors on. Defaults to 1 (the first row).
  • int $end: What row to stop outputting the alternating colors on. Defaults to the GetCurrentRow() value
SetCellAttribute (line 304)

Allows you to easily set any one attribute of the cell if need be. This works the same as the SetCellContent method.

  • access: public
void SetCellAttribute (int $row, int $col, string $attribute, string $value)
  • int $row
  • int $col
  • string $attribute
  • string $value
SetCellAttributes (line 335)

Allows you to set multiple attributes for a cell in one

method call. You would call it like this: $attributes = array ( "attribute_name" => "value", "attribute_name_2" => "value"); $table->SetCellAttributes( $row, $col, $attributes );

  • access: public
void SetCellAttributes (int $row, int $col, array $array)
  • int $row
  • int $col
  • array $array
SetCellBGColor (line 215)

Set the cells BBGCOLOR setting Allows you to easily set the bgcolor of the cell.

This works the same as the SetCellContent method.

  • access: public
void SetCellBGColor (int $row, int $col, string $bgcolor)
  • int $row
  • int $col
  • string $bgcolor
SetCellColSpan (line 272)

Allows you to easily set the colspan attribute of the cell if need be. This works the same as the SetCellContent method.

  • access: public
void SetCellColSpan (int $row, int $col, int $colspan)
  • int $row
  • int $col
  • int $colspan
SetCellContent (line 169)

Set the cell's content.

Allows you to easily set the content of a cell. The first parameter required is the row the cell is on, followed by the column the cell is in, and then finally, what the content of the cell is.

  • access: public
void SetCellContent (int $row, int $col, string $content)
  • int $row
  • int $col
  • string $content
SetCellRowSpan (line 287)

Allows you to easily set the rowspan attribute of the cell if need be. This works the same as the SetCellContent method.

  • access: public
void SetCellRowSpan (int $row, int $col, int $rowspan)
  • int $row
  • int $col
  • int $rowspan
SetCellStyle (line 240)

Allows you to easily set the style of the cell using CSS.

This works the same as the SetCellContent method.

  • access: public
void SetCellStyle (int $row, int $col, string $style)
  • int $row
  • int $col
  • string $style
setClass (line 245)
void setClass (mixed $row, mixed $col, mixed $class)
SetColContent (line 184)
void SetColContent (mixed $col, mixed $content)
SetDefaultBGColor (line 226)

Sets the default bgcolor for all cells.

  • access: public
void SetDefaultBGColor (string $bgcolor)
  • string $bgcolor
SetDefaultCellAttribute (line 317)

Sets the default attribute for all cells.

  • access: public
void SetDefaultCellAttribute (string $attribute, string $value)
  • string $attribute
  • string $value
SetDefaultCellAttributes (line 360)

Set td default attributes

Same setup as SetCellAttributes, however, without the row or col parameters (however, the array still works the same way) 'type' is what you are setting default attributes for. Default attributes can be overriden simply by using one of the aboe methods. If you specifically set an attribute using the 'row', 'col', 'attribute' methods above, they will override the Default Attribute for that one element.

  • access: public
void SetDefaultCellAttributes (array $array)
  • array $array
SetDefaultCellContent (line 200)

Sets the default content for all cells.

  • access: public
void SetDefaultCellContent (string $content)
  • string $content
SetDefaultStyle (line 257)

Sets the default style for all cells.

  • access: public
void SetDefaultStyle (string $style)
  • string $style
SetDefaultTableAttribute (line 382)

Set table default attributes

Same setup as SetCellAttributes, however, without the row or col parameters (however, the array still works the same way) 'type' is what you are setting default attributes for. Default attributes can be overriden simply by using one of the aboe methods. If you specifically set an attribute using the 'row', 'col', 'attribute' methods above, they will override the Default Attribute for that one element.

  • access: public
void SetDefaultTableAttribute (array $array)
  • array $array
SetFancyColStyle (line 468)

Set attributes to particular column.

This works the same way as the SetFancyRowStyle method, except that this method works on arrays. This method will override SetFancyRowStyle styles which are set.

  • access: public
void SetFancyColStyle (int $col, array $attributes)
  • array $attributes
  • int $col: || array $row
SetFancyRowStyle (line 438)

Set attributes to particular rows.

You can easily setup attributes for an entire row using this method. You simply send it a row number (or an array of row numbers if more than one) as well as the attributes in an array format (like we do every place else) and all the cells in the row number will be set with those attributes. Styles set in this manner can be overridden by

  • access: public
void SetFancyRowStyle (int $row, array $attributes)
  • array $attributes
  • int $row: or array $row
SetRowContent (line 174)
void SetRowContent (mixed $row, mixed $content)
SetTableAttribute (line 420)

Set table attribute

Sets the table attributes in the same manner as the SetCellAttributes array. The table information is stored in the table array as the first element ($this->table[0]).

  • access: public
void SetTableAttribute (mixed $key, mixed $value, array $array)
  • array $array
SetTableAttributes (line 401)

Set table attributes

Sets the table attributes in the same manner as the SetCellAttributes array. The table information is stored in the table array as the first element ($this->table[0]).

  • access: public
void SetTableAttributes (array $array)
  • array $array

Documentation generated on Thu, 27 Nov 2003 17:36:28 +0100 by phpDocumentor 1.2.3