Class STPHPComponent

STPHPObject
   |
   --STPHPComponent

Classes extended from STPHPComponent:

STPHPLabel, STPHPCheckBox, STPHPButton, STPHPImage, STPHPRichButton, STPHPForm, STPHPSpacer, STPHPEdit, STPHPListbox, STPHPHR, STPHPTable, STPHPRadioButton, STPHPTableCell, STPHPTableRow, STPHPTextArea, STPHPWindow

Located in File: Program_Root/stphpcomponent.php


The base class for all components


Class Variable Summary
$attributes
The list of attributes
Default Value: -><-
$components
The list of components
Default Value: -><-
$configuration
The pointer to configuration XML node
Default Value: -><-
$formParent
The form owner name
Default Value: -><-

Inherited Class Variable Summary
Inherited From Class STPHPObject
Variable Default Value Description
$name -><- The name of the object

Inherited Method Summary
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
STPHPComponent constructor STPHPComponent ( $name )
Creates the object
void addCodeFile ( $file )
Adds a code file (Javascript)
void addComponent ( &$component )
Adds a component at the end of the components list
void addCssFile ( $file )
Adds a CSS file
void addVSpace ( $units )
Adds vertical spaces
void appendAttributes ( $attributes )
Appends an array of attributes at the current values
void appendComponent ( &$component )
Appends a component at the end of the components list
bool attributeIsEmpty ( $key )
Returns if attribute is empty
void dtor ( )
Destructor
string getAttribute ( $key )
Gets the value of an attribute
string getFormParent ( )
Returns the form owner name
string getTranslatedAttribute ( $key )
Translate an attribute to the current language
void insertComponent ( &$component )
Inserts a component at the beginning of the components list
void setAttribute ( $key, $val )
Sets an attribute
void setConfiguration ( &$configuration )
Load the attributes from a STPHPXMLElement object
void setFormParent ( $form )
Sets the form owner name of the component (used by JS functions)
void translateAttribute ( $key )
Set an attribute to its translated value
string write ( )
Designs the object at runtime
Variable Detail

$attributes

Data type: array
The list of attributes


$components

Data type: array
The list of components


$configuration

Data type: STPHPXmlElement
The pointer to configuration XML node


$formParent

Data type: string
The form owner name



Method Detail

constructor STPHPComponent

STPHPComponent constructor STPHPComponent ( $name )

Creates the object

Function Parameters:
- string $name: the name of the form used in NAME tag
Function Info:
Access - public

addCodeFile

void addCodeFile ( $file )

Overridden in child class(es) as: STPHPWindow::addCodeFile()

Adds a code file (Javascript)

Function Parameters:
- string &$file: The file to add
Function Info:
Access - public

addComponent

void addComponent ( &$component )

Overridden in child class(es) as: STPHPTable::addComponent(), STPHPTableRow::addComponent()

Adds a component at the end of the components list

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

addCssFile

void addCssFile ( $file )

Overridden in child class(es) as: STPHPWindow::addCssFile()

Adds a CSS file

Function Parameters:
- string &$file: The file to add
Function Info:
Access - public

addVSpace

void addVSpace ( $units )

Adds vertical spaces

Function Parameters:
- integer &$units: The number of spaces
Function Info:
Access - public

appendAttributes

void appendAttributes ( $attributes )

Appends an array of attributes at the current values

Function Parameters:
- array $attributes: The attributes to append
Function Info:
Access - public

appendComponent

void appendComponent ( &$component )

Overridden in child class(es) as: STPHPTable::appendComponent(), STPHPTableRow::appendComponent()

Appends a component at the end of the components list

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

attributeIsEmpty

bool attributeIsEmpty ( $key )

Returns if attribute is empty

Function Parameters:
- string $key: The key of the attribute
Function Info:
Return - TRUE if attribute is empty, FALSE otherwise
Access - public

dtor

void dtor ( )

Overridden in child class(es) as: STPHPForm::dtor(), STPHPSpacer::dtor(), STPHPListbox::dtor(), STPHPTable::dtor(), STPHPWindow::dtor()

Overrides: STPHPObject::dtor()

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

getAttribute

string getAttribute ( $key )

Gets the value of an attribute

Function Parameters:
- string $key: The key of the attribute
Function Info:
Return - The value of the attribute
Access - public

getFormParent

string getFormParent ( )

Returns the form owner name

Function Parameters:
Function Info:
Return - The name of form
Access - public

getTranslatedAttribute

string getTranslatedAttribute ( $key )

Translate an attribute to the current language

Function Parameters:
- string $key: The key of the attribute
Function Info:
Return - $key The translated value of the attribute
Access - public

insertComponent

void insertComponent ( &$component )

Overridden in child class(es) as: STPHPTable::insertComponent(), STPHPTableRow::insertComponent()

Inserts a component at the beginning of the components list

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

setAttribute

void setAttribute ( $key, $val )

Sets an attribute

Function Parameters:
- string $key: The key of the attribute
- string $val: The value of the attribute
Function Info:
Access - public

setConfiguration

void setConfiguration ( &$configuration )

Overridden in child class(es) as: STPHPListbox::setConfiguration()

Load the attributes from a STPHPXMLElement object

Function Parameters:
- STPHPXmlElement $configuration:
Function Info:
Access - public

setFormParent

void setFormParent ( $form )

Sets the form owner name of the component (used by JS functions)

Function Parameters:
- string $attributes: The name of form
Function Info:
Access - public

translateAttribute

void translateAttribute ( $key )

Set an attribute to its translated value

Function Parameters:
- string $key: The key of the attribute
Function Info:
Access - public

write

string write ( )

Overridden in child class(es) as: STPHPLabel::write(), STPHPCheckBox::write(), STPHPButton::write(), STPHPImage::write(), STPHPRichButton::write(), STPHPForm::write(), STPHPSpacer::write(), STPHPEdit::write(), STPHPListbox::write(), STPHPHR::write(), STPHPTable::write(), STPHPRadioButton::write(), STPHPTableCell::write(), STPHPTableRow::write(), STPHPTextArea::write(), STPHPWindow::write()

Designs the object at runtime

Function Parameters:
Function Info:
Return - A null string
Access - private