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.

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

Container
   |
   --BaseWidget
      |
      --ActiveTab
Variable Summary
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 ( $color)
strint name (string $title)
void render ([ $indent_level = 1], [ $output_debug = 0])
void selected_background ( $color)
void _build_tab_td ( $title,  $selected,  $width)
void _end_td ()
void _spacer_td ()
void _tab_name ( $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 141)

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 182)
void build_content ()
build_tabs (line 153)
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 261)

Thie method is used to change the hidden tab's

background color

void hidden_background ( $color)
  • $color
name (line 274)

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

  1. function name($title{
  2.         return str_replace(" ""_"strtolower($title));
  3.     }

strint name (string $title)
  • string $title
render (line 76)
void render ([ $indent_level = 1], [ $output_debug = 0])
  • $indent_level
  • $output_debug

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

Thie method is used to change the selected tab's

background color

void selected_background ( $color)
  • $color
_build_tab_td (line 215)
void _build_tab_td ( $title,  $selected,  $width)
  • $title
  • $selected
  • $width
_end_td (line 210)
void _end_td ()
_spacer_td (line 206)
void _spacer_td ()
_tab_name (line 278)
void _tab_name ( $title)
  • $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 Fri, 28 Jan 2011 08:52:36 -0500 by phpDocumentor 1.4.3