Docs For Class CSSBuilder

## Class CSSBuilder

Description

This class is a widget for constructing and rendering css. It exports API's for adding classes, ids and their attributes.

It can render as either a stand alone foo.css type of file, with the appropriate httpd header, or as part of a <style> tag's content that lives as part of an html document.

This class lets you create classes in the format

name extends_list { property: value; }

ie. #foo div, span { font-family: arial, helvetica; font-size: 10pt; }

- author: Walter A. Boring IV <waboring@newsblob.com>

Located in /widgets/CSSBuilder.inc (line 41)

Direct descendents

Class | Description
--- | ---
ActiveTabCSS | The CSSBuilder object for the ActiveTab widget
ButtonPanelCSS | This class defines the css used by the FooterNav Object.
FooterNavCSS | This class defines the css used by the FooterNav Object.
ImageThumbnailWidgetCSS | This class defines the css used by the FooterNav Object.
InfoTableCSS | This class defines the css used by the FooterNav Object.
NavTableCSS | This class defines the css used by the FooterNav Object.
RoundTitleTableCSS | This class defines the css used by the RoundTitleTable Object.
TabControlCSS | CSS for the tab control
TabListCSS | This class defines the css used by the FooterNav Object.
TextCSSNavCSS | This class defines the css used by the FooterNav Object.
TextNavCSS | This class defines the css used by the TextNav Object.
VerticalCSSNavTableCSS | This class defines the css used by the VerticalCSSNavTable Object.
DefaultGUIDataListCSS | This class defines the css used by the FooterNav Object.
ProgressBoxWidgetCSS | This class defines the css used by the FooterNav Object.
ProgressWidgetCSS | This class defines the css used by the FooterNav Object.
ErrorBoxWidgetCSS | This class defines the css used by the TextNav Object.

Variable Summary
boolean $indent_flag
array $_entries
boolean $_header_flag
Method Summary
CSSBuilder CSSBuilder ([boolean $header_flag = FALSE])
void add_entry (string $name, string $extends, array $attributes)
string render ([int $indent_level = 1], int $output_debug)
void set_header_flag (boolean $flag)
void update_all_values (string $property, string $search, string $value)
void update_properties (string $name, string $extends, array $properties)
void update_property (string $name, string $extends, string $property, string $value)
void user_setup ()
the _build_name (string $class)
string _build_properties (array $properties, array $indent_str)
void _replace_value (mixed &$item, mixed $key, mixed $blah)
Variables
boolean $indent_flag = TRUE (line 75)

Flag for pretty (indented) output

- access: public

array $_entries = array() (line 49)

This holds the entries for the css

boolean $_header_flag = FALSE (line 59)

Flag to let us know if we should output a header content-type value header("Content-Type: text/css");

Methods
Constructor CSSBuilder (line 86)

The CSSBuilder constructor

CSSBuilder CSSBuilder ([boolean $header_flag = FALSE])

- boolean $header_flag: - output the http header content type mime type or not.

add_entry (line 189)

This function adds a new class entry

void add_entry (string $name, string $extends, array $attributes)

- string $name: - class/id name
- string $extends: - the list of extends ie #foo div, a { } where "div, a" are the extends
- array $attributes: - the attributes

render (line 103)

The render method for compatibility with the rest of the phphtmllib api

- return: the raw html output.

string render ([int $indent_level = 1], int $output_debug)

- int $indent_level: - the indentation level for the container.
- int $output_debug: - the output debug flag to maintain compatibility w/ the API.

set_header_flag (line 127)

This is used to set/update the header flag.

void set_header_flag (boolean $flag)

- boolean $flag

update_all_values (line 244)

This function is a macro for walking the entire

list of classes, looking for particular property in each class. It then tries to match the current value of that property and then replaces the value with the new value.

NOTE: this is a way of templating themes. you create the original css w/ a value of something like _DARK_COLOR_ and use this function to replace all occurrences with #dbdbdb

void update_all_values (string $property, string $search, string $value)

- string $property: - the property that the search lives in
- string $search: - the original value to find
- string $value: - the new value

update_properties (line 219)

This function updates a css property value for a specific class/id

void update_properties (string $name, string $extends, array $properties)

- string $name: - the class/id name
- string $extends: - the list of extends ie #foo div, a { } where "div, a" are the extends
- array $properties: - the array of array(property => value ) pairs.

update_property (line 205)

This function updates a css property value for a specific class/id

void update_property (string $name, string $extends, string $property, string $value)

- string $name: - the class/id name
- string $extends: - the list of extends ie #foo div, a { } where "div, a" are the extends
- string $property: - the property to adjust
- string $value: - the value for the property

user_setup (line 136)

Call the child class' setup function

to build the actual css classes and their attributes

void user_setup ()

Redefined in descendants as:

- ActiveTabCSS::user_setup()
- ButtonPanelCSS::user_setup()
- FooterNavCSS::user_setup()
- ImageThumbnailWidgetCSS::user_setup()
- InfoTableCSS::user_setup()
- NavTableCSS::user_setup()
- RoundTitleTableCSS::user_setup()
- TabControlCSS::user_setup()
- TabListCSS::user_setup()
- TextCSSNavCSS::user_setup()
- TextNavCSS::user_setup()
- VerticalCSSNavTableCSS::user_setup()
- DefaultGUIDataListCSS::user_setup()
- ProgressBoxWidgetCSS::user_setup()
- ProgressWidgetCSS::user_setup()
- ErrorBoxWidgetCSS::user_setup()

_build_name (line 154)

This function is used to construct the css name declaration string.

ie #foo div,span {

- return: css name declaration

the _build_name (string $class)

- string $class: the name-extends string

_build_properties (line 169)

This function is used to construct the property: value strings for the class

string _build_properties (array $properties, array $indent_str)

- array $properties: - the properties
- array $indent_str: - the indent string.

_replace_value (line 258)

This function does the main work for update_all_values

void _replace_value (mixed &$item, mixed $key, mixed $blah)

Documentation generated on Thu, 1 Sep 2005 17:05:34 -0700 by phpDocumentor 1.3.0RC3