Docs For Class ActiveTab

## Class ActiveTab

Description

This class is used for creating a tab panel of content where the tabs can be switched on the fly w/ JS, thereby eliminating a page turn to see the other tab's content.

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

Located in /widgets/ActiveTab.inc (line 20)

    Container
       |
       --BaseWidget
          |
          --ActiveTab

Variable Summary
mixed $_funct_prefix
mixed $_hidden_background
mixed $_selected_background
mixed $_selected_tab
Method Summary
ActiveTab ActiveTab ([string $width = "100%"], [string $height = "300px"], [string $selected_tab = null])
void add_tab (string $title, mixed $content, [boolean $selected = FALSE], [int $width = NULL])
void build_content ()
void build_tabs ()
string get_javascript ()
void hidden_background (mixed $color)
strint name (string $title)
void render ([mixed $indent_level = 1], mixed $output_debug)
void selected_background (mixed $color)
void _build_tab_td (mixed $title, mixed $selected, mixed $width)
void _end_td ()
void _spacer_td ()
void _tab_name (mixed $title)
Variables
mixed $_funct_prefix = null (line 46)

Random string for function prefix

allows having multiple controls on same page

mixed $_hidden_background = "#e0e0e0" (line 40)

The hidden tab's background color

mixed $_selected_background = "#eeeeee" (line 35)

The active tab's background color

mixed $_selected_tab = null (line 54)

The default selected tab this is a tab name

ActiveTab::name("Title of Tab");

#### Inherited Variables

Inherited from BaseWidget

> BaseWidget::$title
> BaseWidget::$width
> BaseWidget::$_image_prefix

Methods
Constructor ActiveTab (line 68)

This is the constructor for the ActiveTab object.

ActiveTab ActiveTab ([string $width = "100%"], [string $height = "300px"], [string $selected_tab = null])

- string $width: - the width table
- string $height: - the height of the tab's contents
- string $selected_tab: - the selected tab name. NOTE: this is set with ActiveTab::name("Title of Tab"); add_tab() can override this.

add_tab (line 142)

Add a tab

void add_tab (string $title, mixed $content, [boolean $selected = FALSE], [int $width = NULL])

- string $title: - the title of the tab
- mixed $content: - the conetnts for the tab
- boolean $selected:

  - should this tab be the default selected tab?

  Note: This will override the selected tab parameter in the constructor.

- int $width: - the width of the tab in pixels defaults to 60

build_content (line 184)
void build_content ()
build_tabs (line 155)
void build_tabs ()
get_javascript (line 94)

This function MUST be called AFTER ALL content has been added, in order for the js to work properly

string get_javascript ()

Redefinition of:

BaseWidget::get_javascript()
  Function for returning the raw javascript that is required for this widget.

hidden_background (line 259)

Thie method is used to change the hidden tab's

background color

void hidden_background (mixed $color)
name (line 272)

Build the 'name' of the tab. This can be called in a static way to set the default selected tab.

    function name($title) {
            return str_replace(" ", "_", strtolower($title));
        }

strint name (string $title)

- string $title

render (line 76)
void render ([mixed $indent_level = 1], mixed $output_debug)

Redefinition of:

Container::render()
  This function is compatible with the rest of the phpHtmllib API spec.

selected_background (line 251)

Thie method is used to change the selected tab's

background color

void selected_background (mixed $color)
_build_tab_td (line 215)
void _build_tab_td (mixed $title, mixed $selected, mixed $width)
_end_td (line 210)
void _end_td ()
_spacer_td (line 206)
void _spacer_td ()
_tab_name (line 276)
void _tab_name (mixed $title)

#### Inherited Methods

Inherited From BaseWidget

> BaseWidget::get_align()
> BaseWidget::get_css()
> BaseWidget::get_javascript()
> BaseWidget::get_title()
> BaseWidget::get_width()
> BaseWidget::set_align()
> BaseWidget::set_image_path_prefix()
> BaseWidget::set_title()
> BaseWidget::set_width()

Inherited From Container

> Container::Container()
> Container::add()
> Container::add_reference()
> Container::count_content()
> Container::get_element()
> Container::get_indent_flag()
> Container::push()
> Container::push_reference()
> Container::render()
> Container::reset_content()
> Container::set_collapse()
> Container::set_indent_flag()

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