Class STPHPTable

STPHPObject
   |
   --STPHPComponent
      |
      --STPHPTable

Classes extended from STPHPTable:

STPHPToolbar, STPHPPanel, STPHPTabTitle, STPHPControlWithCaption

Located in File: Program_Root/stphptable.php




Class Variable Summary
$cells
The cells of the table (an array of STPHPTableCell objects)
Default Value: -><-
$numOfCols
The number of cols of the table
Default Value: -><-
$numOfRows
The number of rows of the table
Default Value: -><-
$rows
The rows of the table (an array of STPHPTableRow objects)
Default Value: -><-

Inherited Class Variable Summary
Inherited From Class STPHPComponent
Variable Default Value Description
$attributes -><- The list of attributes
$components -><- The list of components
$configuration -><- The pointer to configuration XML node
$formParent -><- The form owner name
Inherited From Class STPHPObject
Variable Default Value Description
$name -><- The name of the object

Inherited Method Summary
Inherited From Class STPHPComponent
Function Description
constructor STPHPComponent ( [$name = ] ) Creates the object
addCodeFile ( $file ) Adds a code file (Javascript)
addComponent ( &$component ) Adds a component at the end of the components list
addCssFile ( $file ) Adds a CSS file
addVSpace ( $units ) Adds vertical spaces
appendAttributes ( $attributes ) Appends an array of attributes at the current values
appendComponent ( &$component ) Appends a component at the end of the components list
attributeIsEmpty ( $key ) Returns if attribute is empty
dtor ( ) Destructor
getAttribute ( $key ) Gets the value of an attribute
getFormParent ( ) Returns the form owner name
getTranslatedAttribute ( $key ) Translate an attribute to the current language
insertComponent ( &$component ) Inserts a component at the beginning of the components list
setAttribute ( $key, $val ) Sets an attribute
setConfiguration ( &$configuration ) Load the attributes from a STPHPXMLElement object
setFormParent ( $form ) Sets the form owner name of the component (used by JS functions)
translateAttribute ( $key ) Set an attribute to its translated value
write ( ) Designs the object at runtime
Inherited From Class STPHPObject
Function Description
constructor STPHPObject ( [$name = ] ) Creates the object
dtor ( ) Destructor
errorLog ( $message ) Print an error to the log system
getName ( ) Returns the name of the object

Method Summary
STPHPTable constructor STPHPTable ( $name )
Creates the object
void addComponent ( &$component )
Adds a STPHPTableCell at the end of the components list
void addComponentToCell ( $row, $col, &$component )
Adds a component directly to a cell
void addRow ( )
Adds a new row to the table
void addTextToCell ( $row, $col, $text )
Adds text to the specified cell
void addVSpaceToCell ( $row, $col, $units )
Adds vertical spaces to the specified cell
void appendComponent ( &$component )
Appends a STPHPTableRow at the end of the components list
void appendComponentToCell ( $row, $col, &$component )
Appends a component directly to a cell
void dtor ( )
Destructor
void insertComponent ( &$component )
Inserts a STPHPTableRow at the beginning of the components list
void insertComponentToCell ( $row, $col, &$component )
Inserts a component directly to a cell
void prepare ( )
Prepare the table creating rows anc cells
void setNumOfCols ( $cols )
Sets the number of cols
void setNumOfRows ( $rows )
Sets the number of rows
string write ( )
Designs the object at runtime
Variable Detail

$cells

Data type: array
The cells of the table (an array of STPHPTableCell objects)


$numOfCols

Data type: integer
The number of cols of the table


$numOfRows

Data type: integer
The number of rows of the table


$rows

Data type: array
The rows of the table (an array of STPHPTableRow objects)



Method Detail

constructor STPHPTable

STPHPTable constructor STPHPTable ( $name )

Creates the object

Function Parameters:
- string $name:
Function Info:
Access - public

addComponent

void addComponent ( &$component )

Overrides: STPHPComponent::addComponent()

Adds a STPHPTableCell at the end of the components list

Function Parameters:
- STPHPTableRow &$component: The component to add
Function Info:
Access - public

addComponentToCell

void addComponentToCell ( $row, $col, &$component )

Adds a component directly to a cell

Function Parameters:
- integer $row: the rows number
- integer $col: the cols number
- STPHPComponent &$component: the component to add
Function Info:
Access - public

addRow

void addRow ( )

Adds a new row to the table

Function Parameters:
Function Info:
Access - public

addTextToCell

void addTextToCell ( $row, $col, $text )

Adds text to the specified cell

Function Parameters:
- integer $row: the rows number
- integer $col: the cols number
- string $text: the text to add
Function Info:
Access - public

addVSpaceToCell

void addVSpaceToCell ( $row, $col, $units )

Adds vertical spaces to the specified cell

Function Parameters:
- integer $row: the rows number
- integer $col: the cols number
- integer $units: the spaces number
Function Info:
Access - public

appendComponent

void appendComponent ( &$component )

Overrides: STPHPComponent::appendComponent()

Appends a STPHPTableRow at the end of the components list

Function Parameters:
- STPHPTableRow &$component: The component to add
Function Info:
Access - public

appendComponentToCell

void appendComponentToCell ( $row, $col, &$component )

Appends a component directly to a cell

Function Parameters:
- integer $row: the rows number
- integer $col: the cols number
- STPHPComponent &$component: the component to append
Function Info:
Access - public

dtor

void dtor ( )

Overridden in child class(es) as: STPHPToolbar::dtor(), STPHPControlWithCaption::dtor()

Overrides: STPHPComponent::dtor()

Destructor
Destroys all the resources associated with the object
Function Parameters:
Function Info:
Access - public

insertComponent

void insertComponent ( &$component )

Overrides: STPHPComponent::insertComponent()

Inserts a STPHPTableRow at the beginning of the components list

Function Parameters:
- STPHPTableRow &$component: the component to add
Function Info:
Access - public

insertComponentToCell

void insertComponentToCell ( $row, $col, &$component )

Inserts a component directly to a cell

Function Parameters:
- integer $row: the rows number
- integer $col: the cols number
- STPHPComponent &$component: the component to insert
Function Info:
Access - public

prepare

void prepare ( )

Prepare the table creating rows anc cells

Function Parameters:
Function Info:
Access - public

setNumOfCols

void setNumOfCols ( $cols )

Sets the number of cols

Function Parameters:
- integer $cols: the cols number
Function Info:
Access - public

setNumOfRows

void setNumOfRows ( $rows )

Sets the number of rows

Function Parameters:
- integer $rows: the rows number
Function Info:
Access - public

write

string write ( )

Overridden in child class(es) as: STPHPToolbar::write(), STPHPPanel::write(), STPHPTabTitle::write(), STPHPControlWithCaption::write()

Overrides: STPHPComponent::write()

Designs the object at runtime
Available attributes :
- VISIBLE : defines if the component must be designed or not
- BORDER : defines the border size of the table (default 0)
- CELLSPACING : defines the spacing of the cells (default 0)
- CELLPADING : defines the padding of the cells (default 0)
- ALIGN : defines the alignment
- WIDTH : defines the width
- CLASS : defines the CSS class
Function Parameters:
Function Info:
Return - the code that represents the object at runtime
Access - private