xajaxControl. inc.php

Contains the base class for all controls.

Summary
Contains the base class for all controls.
Please see copyright.inc.php for a detailed description, copyright and license information.
Defines the doctype of the current document; this will effect how the HTML is formatted when the html control library is used to construct html documents and fragments.
The base class for all xajax enabled controls.
An associative array of attributes that will be used in the generation of the HMTL code for this control.
An associative array of events that will be assigned to this control.
Contains a declaration of the class of this control.
Returns the adjusted class of the element
Removes all attributes assigned to this control.
Call to set various control specific attributes to be included in the HTML script that is returned when xajaxControl->printHTML or xajaxControl->getHTML is called.
Call to obtain the value currently associated with the specified attribute if set.
Clear the events that have been associated with this object.
Call this function to assign a xajaxRequest object as the handler for the specific DOM event.
Generates and returns the HTML representation of this control and it’s children.
Generates and prints the HTML representation of this control and it’s children.
This class is used as the base class for controls that will contain other child controls.
An array of child controls.
Will contain ‘%inline’ if all children are class = ‘%inline’, ‘%block’ if all children are ‘%block’ or ‘%flow’ if both ‘%inline’ and ‘%block’ elements are detected.
Called to construct and configure this control.
Returns the adjusted class of the element
Returns the adjusted class of the content (children) of this element
Clears the list of child controls associated with this control.
Adds a control to the array of child controls.

xajaxControl class

Please see copyright.inc.php for a detailed description, copyright and license information.

Summary
Defines the doctype of the current document; this will effect how the HTML is formatted when the html control library is used to construct html documents and fragments.

Constants

XAJAX_HTML_CONTROL_DOCTYPE_FORMAT

Defines the doctype of the current document; this will effect how the HTML is formatted when the html control library is used to construct html documents and fragments.  This can be one of the following values:

’XHTML’(default) Typical effects are that certain elements are closed with ‘/>’
’HTML’Typical differences are that closing tags for certain elements cannot be ‘/>’

XAJAX_HTML_CONTROL_DOCTYPE_VERSION

XAJAX_HTML_CONTROL_DOCTYPE_VALIDATION

xajaxControl

The base class for all xajax enabled controls.  Derived classes will generate the HTML and javascript code that will be sent to the browser via xajaxControl->printHTML or sent to the browser in a xajaxResponse via xajaxControl->getHTML.

Summary
An associative array of attributes that will be used in the generation of the HMTL code for this control.
An associative array of events that will be assigned to this control.
Contains a declaration of the class of this control.
Returns the adjusted class of the element
Removes all attributes assigned to this control.
Call to set various control specific attributes to be included in the HTML script that is returned when xajaxControl->printHTML or xajaxControl->getHTML is called.
Call to obtain the value currently associated with the specified attribute if set.
Clear the events that have been associated with this object.
Call this function to assign a xajaxRequest object as the handler for the specific DOM event.
Generates and returns the HTML representation of this control and it’s children.
Generates and prints the HTML representation of this control and it’s children.

Variables

sTag

var $sTag

sEndTag

var $sEndTag
’required’(default) Indicates the control must have a full end tag
’optional’The control may have an abbr. begin tag or a full end tag
’forbidden’The control must have an abbr. begin tag and no end tag

aAttributes

var $aAttributes

An associative array of attributes that will be used in the generation of the HMTL code for this control.

aEvents

var $aEvents

An associative array of events that will be assigned to this control.  Each event declaration will include a reference to a xajaxRequest object; it’s script will be extracted using xajaxRequest->printScript or xajaxRequest->getScript.

sClass

var $sClass

Contains a declaration of the class of this control.  %inline controls do not need to be indented, %block controls should be indented.

Functions

xajaxControl

function xajaxControl($sTag,  
$aConfiguration = array())
$aConfiguration(array): An associative array that contains a variety of configuration options for this xajaxControl object.

This array may contain the following entries

’attributes’(array): An associative array containing attributes that will be passed to the xajaxControl->setAttribute function.
’children’(array): An array of xajaxControl derived objects that will be the children of this control.

getClass

function getClass()

Returns the adjusted class of the element

clearAttributes

function clearAttributes()

Removes all attributes assigned to this control.

setAttribute

function setAttribute($sName,
$sValue)

Call to set various control specific attributes to be included in the HTML script that is returned when xajaxControl->printHTML or xajaxControl->getHTML is called.

getAttribute

function getAttribute($sName)

Call to obtain the value currently associated with the specified attribute if set.

sName(string): The name of the attribute to be returned.

Returns

mixedThe value associated with the attribute, or null.

clearEvents

function clearEvents()

Clear the events that have been associated with this object.

setEvent

function setEvent($sEvent,  
&$objRequest,  
$aParameters = array(),
$sBeforeRequest = '',
$sAfterRequest = '; return false;')

Call this function to assign a xajaxRequest object as the handler for the specific DOM event.  The xajaxRequest->printScript function will be called to generate the javascript for this request.

sEvent(string): A string containing the name of the event to be assigned.
objRequest(xajaxRequest object): The xajaxRequest object to be associated with the specified event.
aParameters(array, optional): An array containing parameter declarations that will be passed to this xajaxRequest object just before the javascript is generated.
sBeforeRequest(string, optional): a string containing a snippet of javascript code to execute prior to calling the xajaxRequest function
sAfterRequest(string, optional): a string containing a snippet of javascript code to execute after calling the xajaxRequest function

getHTML

function getHTML($bFormat = false)

Generates and returns the HTML representation of this control and it’s children.

Returns

stringThe HTML representation of this control.

printHTML

function printHTML($sIndent = '')

Generates and prints the HTML representation of this control and it’s children.

Returns

stringThe HTML representation of this control.

Special case here: disabled=’false’ does not work in HTML; does work in javascript

xajaxControlContainer

This class is used as the base class for controls that will contain other child controls.

Summary
An array of child controls.
Will contain ‘%inline’ if all children are class = ‘%inline’, ‘%block’ if all children are ‘%block’ or ‘%flow’ if both ‘%inline’ and ‘%block’ elements are detected.
Called to construct and configure this control.
Returns the adjusted class of the element
Returns the adjusted class of the content (children) of this element
Clears the list of child controls associated with this control.
Adds a control to the array of child controls.

Variables

aChildren

var $aChildren

An array of child controls.

sChildClass

var $sChildClass

Will contain ‘%inline’ if all children are class = ‘%inline’, ‘%block’ if all children are ‘%block’ or ‘%flow’ if both ‘%inline’ and ‘%block’ elements are detected.

Functions

xajaxControlContainer

function xajaxControlContainer($sTag,  
$aConfiguration = array())

Called to construct and configure this control.

aConfiguration(array): See xajaxControl->xajaxControl for more information.

getClass

function getClass()

Returns the adjusted class of the element

getContentClass

function getContentClass()

Returns the adjusted class of the content (children) of this element

clearChildren

function clearChildren()

Clears the list of child controls associated with this control.

addChild

function addChild(&$objControl)

Adds a control to the array of child controls.  Child controls must be derived from xajaxControl.

This file contains detailed information regarding the xajax project, current version, copyrights, licnese and documentation.
var $sTag
var $sEndTag
var $aAttributes
An associative array of attributes that will be used in the generation of the HMTL code for this control.
var $aEvents
An associative array of events that will be assigned to this control.
var $sClass
Contains a declaration of the class of this control.
function xajaxControl($sTag,  
$aConfiguration = array())
function getClass()
Returns the adjusted class of the element
function clearAttributes()
Removes all attributes assigned to this control.
function setAttribute($sName,
$sValue)
Call to set various control specific attributes to be included in the HTML script that is returned when xajaxControl->printHTML or xajaxControl->getHTML is called.
function printHTML($sIndent = '')
Generates and prints the HTML representation of this control and it’s children.
function getHTML($bFormat = false)
Generates and returns the HTML representation of this control and it’s children.
function getAttribute($sName)
Call to obtain the value currently associated with the specified attribute if set.
function clearEvents()
Clear the events that have been associated with this object.
function setEvent($sEvent,  
&$objRequest,  
$aParameters = array(),
$sBeforeRequest = '',
$sAfterRequest = '; return false;')
Call this function to assign a xajaxRequest object as the handler for the specific DOM event.
Used to store and generate the client script necessary to invoke a xajax request from the browser to the server script.
var $aChildren
An array of child controls.
var $sChildClass
Will contain ‘%inline’ if all children are class = ‘%inline’, ‘%block’ if all children are ‘%block’ or ‘%flow’ if both ‘%inline’ and ‘%block’ elements are detected.
function xajaxControlContainer($sTag,  
$aConfiguration = array())
Called to construct and configure this control.
function getClass()
Returns the adjusted class of the element
function getContentClass()
Returns the adjusted class of the content (children) of this element
function clearChildren()
Clears the list of child controls associated with this control.
function addChild(&$objControl)
Adds a control to the array of child controls.
Collect commands to be sent back to the browser in response to a xajax request.
function printScript()
Generates a block of javascript code that can be used to invoke the specified xajax request.
function getScript()
Returns a string representation of the script output (javascript) from this request object.
The base class for all xajax enabled controls.