Toolkit Class Reference

Utility class for Toolkit2. More...

Inheritance diagram for Toolkit:

Inheritance graph
[legend]

List of all members.

Static Public Member Functions

static addObject ($obj, $id)
static classToString ($class)
 Converts array of CSS classes into string.
static getComponent ($id)
 Retrieves a component based on its ID.
static getDefaultTheme ()
 Retrieves the current default theme for new objects.
static getNextId ()
static globalAddExtraCSS ($slot, $js)
 Adds CSS to the page header.
static globalAddExtraJS ($slot, $js)
 Adds JavaScript to the page header.
static globalAddHiddenForm ($name, $form)
 Adds a form full of hidden variables to an appropriate place on the page.
static indirectExists ($to, $what)
static issetJS ($slot)
 Determines whether a particular chunk of JS has been uploaded via globalAddExtraJS.
static prm_generateIndirectEventJS ()
static prm_getCSSSource ()
static prm_getExtraCSS ()
static prm_getExtraForms ()
static prm_getExtraJS ()
static prm_getJSSource ()
static setDefaultTheme ($theme, $updateAll=false)
 Sets the default theme for all new objects.
static setObjectId ($obj, $newId)
static styleToString ($style)
 Converts array of CSS styles into string.


Detailed Description

Utility class for Toolkit2.

This class cannot be instantiated, and generally contains methods that are used internally by the toolkit. Only a few are interesting to end developers, and a few more are needed when extending the toolkit. Please heed the comments about not using certain functions, and only use those which are documented.

Definition at line 12 of file Toolkit.php5.


Member Function Documentation

static Toolkit::addObject ( obj,
id 
) [static]

For internal use only.

Definition at line 179 of file Toolkit.php5.

Referenced by TKComponent::__construct().

static Toolkit::classToString ( class  )  [static]

Converts array of CSS classes into string.

For internal use only.

If there are no classes in the array, then this method returns an empty string. Otherwise, it returns ' class="foo bar baz"', which can readily be inserted into an HTML tag.

Parameters:
$class [array]: array of classes, usually from a component's class or *_class properties
Returns:
[string] empty string for no classes, or formatted string of classes

Definition at line 138 of file Toolkit.php5.

Referenced by TKPagedView::build(), TKComponent::mergeClasses(), TKVBox::renderContainer(), TKNullBox::renderContainer(), TKHBox::renderContainer(), TKTable::renderFooter(), TKTable::renderHeader(), and TKComponent::translateClass().

static Toolkit::getComponent ( id  )  [static]

Retrieves a component based on its ID.

All toolkit objects have a (hopefully) unique ID. You can retrieve any TK object by calling this static function, provided you know its ID.

Parameters:
$id [string]: object id to look for
Returns:
[TKComponent] the object specified by $id, if it exists

Definition at line 68 of file Toolkit.php5.

Referenced by TKTreeAction::createFromXML(), TKSWATAction::createFromXML(), TKShowAction::createFromXML(), TKSelectAction::createFromXML(), TKHideAction::createFromXML(), TKEmitAction::createFromXML(), and TKChangeStyleAction::createFromXML().

static Toolkit::getDefaultTheme (  )  [static]

Retrieves the current default theme for new objects.

Returns:
[TKTheme] current default them

Definition at line 36 of file Toolkit.php5.

Referenced by TKComponent::__construct().

static Toolkit::getNextId (  )  [static]

For internal use only.

Definition at line 172 of file Toolkit.php5.

Referenced by TKComponent::__construct().

static Toolkit::globalAddExtraCSS ( slot,
js 
) [static]

Adds CSS to the page header.

For internal use only.

Every block of CSS added should have a unique name appropriate to purpose. The idea is to prevent multiple blocks of the same CSS from being added, cluttering up the page.

Parameters:
$slot [string]: unique name identifying segment of CSS
$js [string]: CSS to add

Definition at line 113 of file Toolkit.php5.

Referenced by TKComponent::addExtraCSS(), and TKAction::addExtraCSS().

static Toolkit::globalAddExtraJS ( slot,
js 
) [static]

Adds JavaScript to the page header.

For internal use only.

Every block of JavaScript added should have a unique name appropriate to purpose. The idea is to prevent multiple blocks of the same JavaScript from being added, cluttering up the page.

Parameters:
$slot [string]: unique name identifying segment of JavaScript
$js [string]: JavaScript to add

Definition at line 90 of file Toolkit.php5.

Referenced by TKComponent::addExtraJS(), TKAction::addExtraJS(), TKCustomAction::getInvocation(), and TKPagedView::renderContainer().

static Toolkit::globalAddHiddenForm ( name,
form 
) [static]

Adds a form full of hidden variables to an appropriate place on the page.

For internal use only.

Parameters:
$name [string]: name of form
$form [string]: form contents

Definition at line 124 of file Toolkit.php5.

Referenced by TKAction::addHiddenForm().

static Toolkit::indirectExists ( to,
what 
) [static]

For internal use only.

Definition at line 254 of file Toolkit.php5.

Referenced by TKEmitAction::getInvocation().

static Toolkit::issetJS ( slot  )  [static]

Determines whether a particular chunk of JS has been uploaded via globalAddExtraJS.

For internal use only.

Definition at line 98 of file Toolkit.php5.

Referenced by TKPagedView::renderContainer().

static Toolkit::prm_generateIndirectEventJS (  )  [static]

For internal use only.

Definition at line 236 of file Toolkit.php5.

static Toolkit::prm_getCSSSource (  )  [static]

For internal use only.

Definition at line 225 of file Toolkit.php5.

References SPath::getRelPath().

Referenced by PageRender2::renderPrint().

static Toolkit::prm_getExtraCSS (  )  [static]

For internal use only.

Definition at line 202 of file Toolkit.php5.

Referenced by PageRender2::renderPrint().

static Toolkit::prm_getExtraForms (  )  [static]

For internal use only.

Definition at line 231 of file Toolkit.php5.

Referenced by PageRender2::renderPrint().

static Toolkit::prm_getExtraJS (  )  [static]

For internal use only.

Definition at line 207 of file Toolkit.php5.

Referenced by PageRender2::renderPrint().

static Toolkit::prm_getJSSource (  )  [static]

For internal use only.

Definition at line 219 of file Toolkit.php5.

References SPath::getRelPath().

Referenced by PageRender2::renderPrint().

static Toolkit::setDefaultTheme ( theme,
updateAll = false 
) [static]

Sets the default theme for all new objects.

It can also be made to update the theme of existing objects

Parameters:
$theme [TKTheme]: new theme
$updateAll [boolean]: whether to update existing objects to the new theme

Definition at line 48 of file Toolkit.php5.

Referenced by PageRender2::setToolkitTheme().

static Toolkit::setObjectId ( obj,
newId 
) [static]

For internal use only.

Definition at line 192 of file Toolkit.php5.

Referenced by TKComponent::setId().

static Toolkit::styleToString ( style  )  [static]

Converts array of CSS styles into string.

For internal use only.

If there are no styles in the array, this method returns an empty string. Otherwise, it returns ' style="foovalue;bar::value2"', which can readily be inserted into an HTML tag.

Parameters:
$style [array]: associative array of styles, usually from a component's style or *_style properties
Returns:
[string] empty string for no styles, or formatted string of styles

Definition at line 155 of file Toolkit.php5.

Referenced by TKComponent::mergeStyles(), TKVBox::renderContainer(), TKNullBox::renderContainer(), TKHBox::renderContainer(), TKTable::renderFooter(), TKTable::renderHeader(), and TKComponent::translateStyle().


The documentation for this class was generated from the following file:

Generated on Wed Nov 24 02:07:20 2010 for Common by  doxygen 1.5.6