Docs For Class DefaultGUIDatalist

## Class DefaultGUIDatalist

Description

This class is the Default phpHtmlLib GUI interface child of the DataList class. This child simply does the job of rendering the html/layout for a DataList.

You can use this as an example of how to build your own look/feel for your DataList.

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

Located in /widgets/data_list/DefaultGUIDataList.inc (line 28)

    Container
       |
       --BaseWidget
          |
          --DataList
             |
             --DefaultGUIDatalist

Variable Summary
mixed $alternating_row_colors
mixed $_action_column
mixed $_action_count
mixed $_align
mixed $_allow_select_all
mixed $_collapsable_search
mixed $_cur_col_cntr
mixed $_default_checked_items
mixed $_display_title_flag
mixed $_hidden_checkbox_items
mixed $_save_checked_items_flag
mixed $_search_flag
mixed $_search_text
mixed $_search_tree_open
mixed $_show_actionbar
mixed $_simple_search_modifier
mixed $_visible_checkbox_items
mixed $__page_info
Method Summary
ContainerWidget actionbar_cell ()
INPUTtag action_button (string $name, [string $action = ""], [string $javascript = ""])
void add_action_column (string $type, string $col, string $db_field, [string $title = NULL])
void allow_select_all (bool $flag)
mixed build_column_header (string $col_name, array $col_data, int $col_num)
DIVtag build_gui ()
void child_add_row_cell (mixed $obj, mixed $col_name, mixed $last_in_row_flag, mixed $row_data, mixed $even_row)
void child_build_column_header (mixed $name, mixed $col, mixed $cnt)
TABLEtag child_build_search_table ()
void child_get_gui ()
array get_default_checked_items ()
string get_title ()
void gui_init ()
boolean is_action_checked (string $value, array $row_data)
boolean is_action_enabled (string $value, array $row_data)
void save_checked_items ([boolean $flag = TRUE])
void set_actionbar ([boolean $flag = TRUE])
void set_align (string $align)
void set_alternating_row_colors ([boolean $flag = TRUE])
void set_default_checked_items (array $items)
void set_global_prefix (string $prefix)
void set_search_collapse ([bool $flag = TRUE])
void set_search_strings ([string $title = null], [string $find = null], [string $button = null])
void set_title_enable (boolean $flag)
boolean show_actionbar ()
TDtag wrap_column_item (mixed $obj, string $col_name, int $even_flag, int 3)
TABLEtag _build_actionbar ()
TDtag _build_actionbar_arrow_cell (string $col)
TDtag; _build_actionbar_data_cell ()
HTMLTag _build_action_column (string $col, [boolean $header_flag = FALSE], [array $row_data = NULL])
Container _build_advanced_search_form ()
void _build_default_vars ()
TABLEtag _build_search_title ()
ContainerWidget _build_simple_search_form ()
SCRIPTtag _checkbox_javascript ()
boolean _has_action_column (string $col)
boolean. _is_col_checked (string $value, array $row_data)
mixed _javascript ()
boolean _save_checked_items_enabled ()
string _search_javascript ()
Variables
mixed $alternating_row_colors = TRUE (line 156)

Do we want to alternate the row colors? This helps to see each row easier.

mixed $_action_column = array() (line 42)

This holds the action column settings if any.

mixed $_action_count = 0 (line 48)

holds the cntr for the action

checkbox name

mixed $_align = "center" (line 36)

The overall alignment

DEFAULT: "center"

mixed $_allow_select_all = TRUE (line 92)

This variable tells us whether to display

select all checkbox

mixed $_collapsable_search = FALSE (line 114)

If true, allows search block to be collapsed/expanded.

NOTE: This doesn't stay collapsed between pages, when using GET as the form method.

mixed $_cur_col_cntr = 0 (line 129)
mixed $_default_checked_items = array() (line 80)

This variable holds the array of default

selected items. This is populated inside the user_setup() function to pre-populate the list of selected items for a the checkbox action column.

mixed $_display_title_flag = TRUE (line 142)

do we show the title string?

mixed $_hidden_checkbox_items = array() (line 55)

This array holds the list of hidden checkbox[] items.

mixed $_save_checked_items_flag = FALSE (line 70)

this flag tells us to save the checked items between pages By default this is off.

mixed $_search_flag = TRUE (line 150)

Flag to let us know that search

is enabled. Default this to TRUE but you can still disable it

Redefinition of:

DataList::$_search_flag
  Flag to let us know that search is enabled.

mixed $_search_text = array("title" => "Search",
"find" => "Find",
"button" => "Search") (line 102)

this array holds some strings for the search functionality. This enables some level of localization for other languages.

mixed $_search_tree_open = TRUE (line 120)

Initial state of the search tree

mixed $_show_actionbar = TRUE (line 86)

Do we show action bar row?

mixed $_simple_search_modifier = SEARCH_ALL (line 137)

Flag to enable simple search modifyer.

IF enabled it will add a select that adds the "beings with", "contains" options for a simple search.

Redefinition of:

DataList::$_simple_search_modifier
  Flag to enable simple search modifyer.

mixed $_visible_checkbox_items = array() (line 63)

this array keeps track of the list of rendered visible checkbox[] items. So we can not render the hidden version of it.

mixed $__page_info = "" (line 126)

for a reference so the row_filter affects the paging information.

#### Inherited Variables

Inherited from DataList

> DataList::$_advanced_search_flag
> DataList::$_clean_string
> DataList::$_columns
> DataList::$_datasource
> DataList::$_debug
> DataList::$_default_orderby
> DataList::$_default_reverseorder
> DataList::$_default_rows_per_page
> DataList::$_form_attributes
> DataList::$_form_render_flag
> DataList::$_global_prefix
> DataList::$_image_path
> DataList::$_max_rows
> DataList::$_not_found_message
> DataList::$_num_columns
> DataList::$_num_pages
> DataList::$_save_vars
> DataList::$_search_table
> DataList::$_show_all_rows
> DataList::$_show_results_flag
> DataList::$_vars

Inherited from BaseWidget

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

Methods
actionbar_cell (line 1098)

this is the method that builds the contents for the middle actionbar td cell.

NOTE this function is meant to be overriden by the child class.

- return: object

ContainerWidget actionbar_cell ()
action_button (line 1112)

This function builds an action button that will modify the form action, to post to a different script to handle the data

- return: object

INPUTtag action_button (string $name, [string $action = ""], [string $javascript = ""])

- string $name: - the button name
- string $action: - the script that gets called.
- string $javascript: - extra js to put prior to the submit();

add_action_column (line 699)

This function adds an action column. This adds a column of either checkboxes or radio buttons.

void add_action_column (string $type, string $col, string $db_field, [string $title = NULL])

- string $type: - type of column 'checkbox' or 'radio'
- string $col: - which column it lives in 'FIRST' or 'LAST'
- string $db_field: - which db field is associated with this.
- string $title: - the title to use for the column. NOTE: if this is set, then there will NOT be a global checkbox that can be used to select/deslect all at once.

allow_select_all (line 805)

Sets the flag for rendering the select all checkbox

void allow_select_all (bool $flag)

- bool $flag: flag

build_column_header (line 410)

This function builds the object/text

to be used for a column header. It can either be an href because its sortable, or it can just be text, because its not sortable.

- return: - either an Atag object or raw text.

mixed build_column_header (string $col_name, array $col_data, int $col_num)

- string $col_name: - the column name to build from the headers.
- array $col_data: - the column's data.
- int $col_num: the column # we are working on.

build_gui (line 354)

Override the parent's method so we can wrap everything in a div to hold it all together when we change the alignment

- return: object

DIVtag build_gui ()

Redefinition of:

DataList::build_gui()
  This function is responsible for calling the child class's methods for building the GUI container.

child_add_row_cell (line 308)
void child_add_row_cell (mixed $obj, mixed $col_name, mixed $last_in_row_flag, mixed $row_data, mixed $even_row)

Redefinition of:

DataList::child_add_row_cell()
  This method is supposed to be written by the child class to add the cell data to the current row in the UI

child_build_column_header (line 275)
void child_build_column_header (mixed $name, mixed $col, mixed $cnt)

Redefinition of:

DataList::child_build_column_header()
  This method is supposed to be written by the child class to build and add the column title to the UI

child_build_search_table (line 511)

This builds the table that holds the search capability.

- return: object.

TABLEtag child_build_search_table ()

Redefinition of:

DataList::child_build_search_table()
  This function builds the search block that lives above the results

child_get_gui (line 360)
void child_get_gui ()

Redefinition of:

DataList::child_get_gui()
  This function is called after all of the data has been added to the UI object. It just returns the container that is the entire UI for the DataList

get_default_checked_items (line 728)

This function returns the array of default checked items to be marked as checked in the checkbox action column

array get_default_checked_items ()
get_title (line 824)

Check to see if we should show the title

string get_title ()

Redefinition of:

BaseWidget::get_title()
  Function for accessing the title of this widget

gui_init (line 190)

This function builds the base layout

of what the overall DataList will look like

void gui_init ()

Redefinition of:

DataList::gui_init()
  A subclass can override this function to setup the class variables after the constructor. The constructor automatically calls this function.

is_action_checked (line 975)

This function is provided to give the child class the ability to precheck/select a particular column.

boolean is_action_checked (string $value, array $row_data)

- string $value: - the item to look for.
- array $row_data: - the row's data.

is_action_enabled (line 988)

This function is provided to give the child class the ability to enable/disable a particular checkbox.

boolean is_action_enabled (string $value, array $row_data)

- string $value: - the item to look for.
- array $row_data: - the row's data.

save_checked_items (line 742)

set the flag to tell the object to save the checked items

NOTE: this only works if we are in POST mode. GET can easily fail because of too many items saved on the query string.

void save_checked_items ([boolean $flag = TRUE])

- boolean $flag: TRUE = enable

set_actionbar (line 786)

This allows the caller to turn on/off the rendering of the bottom action bar row

void set_actionbar ([boolean $flag = TRUE])

- boolean $flag: - TRUE = on FALSE = off

set_align (line 271)

this function is used to set the overall alignment of the widget

void set_align (string $align)

- string $align: - the align value

Redefinition of:

BaseWidget::set_align()
  This function sets the align attribute for the outer table.

set_alternating_row_colors (line 839)

This method is used to set the flag that allows us to do alternating row colors or not

void set_alternating_row_colors ([boolean $flag = TRUE])

- boolean $flag

set_default_checked_items (line 717)

This function is used to set the default list

of selected checkbox items. This is used so the user can pre-populate the list of checked items in the checkbox action column

void set_default_checked_items (array $items)

- array $items: - the array of checked items

set_global_prefix (line 167)

This function sets a prefix for all variables that are used in the item list table on a page. This allows you to have multiple itemlists on a single html page.

void set_global_prefix (string $prefix)

- string $prefix: - the prefix for all vars.

Redefinition of:

DataList::set_global_prefix()
  This function sets a prefix for all variables that are used in the item list table on a page. This allows you to have multiple itemlists on a single html page.

set_search_collapse (line 180)

This sets the flag to turn on/off the ability to collapse the search box.

void set_search_collapse ([bool $flag = TRUE])

- bool $flag

set_search_strings (line 567)

This function is used to allow the child class to override the values of text that is used for the search area

void set_search_strings ([string $title = null], [string $find = null], [string $button = null])

- string $title: the title of the search area
- string $find: The find string
- string $button: the button submit string

set_title_enable (line 814)

This function enables/disables the displaying of the title string

void set_title_enable (boolean $flag)

- boolean $flag: TRUE = allow title to be shown

show_actionbar (line 796)

This function gets the current value of the show actionbar flag setting.

boolean show_actionbar ()
wrap_column_item (line 472)

This function ensures that the data we place in a column is aligned according to what the user wants.

- return: object

TDtag wrap_column_item (mixed $obj, string $col_name, int $even_flag, int 3)

- int 3: - the column # we are working on.
- mixed $obj: - $obj - the data for the td.
- string $col_name: - $col_name - the name of the column header for this row to render.
- int $even_flag: - $odd_row - tells us if this cell lives in an odd # row (for alternating row colors)

_build_actionbar (line 998)

This function renders the action bar at the bottom of the data list.

- return: object

TABLEtag _build_actionbar ()
_build_actionbar_arrow_cell (line 1033)

This function builds a TD with the appropriate action arrow.

TDtag _build_actionbar_arrow_cell (string $col)

- string $col: - FIRST or LAST

_build_actionbar_data_cell (line 1065)

This function builds the user's data cell

TDtag; _build_actionbar_data_cell ()
_build_action_column (line 854)

This builds an action column cell

- return: object

HTMLTag _build_action_column (string $col, [boolean $header_flag = FALSE], [array $row_data = NULL])

- string $col: - the column to test for FIRST or LAST
- boolean $header_flag: - lets us know this is for the header or a cell.
- array $row_data: - the row's data.

_build_advanced_search_form (line 675)

This function builds the table that holds the Advanced search form fields

- return: object

Container _build_advanced_search_form ()
_build_default_vars (line 381)
void _build_default_vars ()

Redefinition of:

DataList::_build_default_vars()
  This function builds the list of

_build_search_title (line 584)

This function builds the search title table

- return: object

TABLEtag _build_search_title ()
_build_simple_search_form (line 622)

This function builds the simple search TD

ContainerWidget _build_simple_search_form ()
_checkbox_javascript (line 1174)

This function builds the JS needed for the checkbox action column

SCRIPTtag _checkbox_javascript ()
_has_action_column (line 771)

This function tests to see if the child wants to render an action column

boolean _has_action_column (string $col)

- string $col: - the column to test for FIRST or LAST

_is_col_checked (line 945)

This method checks to see if a particular row has been checked in the action column

boolean. _is_col_checked (string $value, array $row_data)

- string $value: - the item to look for
- array $row_data: - the row's data.

_javascript (line 1143)

This function returns any Javascript required for this widget

mixed _javascript ()

Redefinition of:

DataList::_javascript()
  This function provides a way to automatically add javascript to this object.

_save_checked_items_enabled (line 759)

This tests the object flag to

see if the child class wants to automatically save the checked items

boolean _save_checked_items_enabled ()
_search_javascript (line 1201)

This function builds the JS needed for collapsable search

- return: - js code

string _search_javascript ()

#### Inherited Methods

Inherited From DataList

> DataList::DataList()
> DataList::add_header_item()
> DataList::advanced_search_disable()
> DataList::advanced_search_enable()
> DataList::build_base_url()
> DataList::build_column_item()
> DataList::build_column_url()
> DataList::build_gui()
> DataList::build_orderby_querystring()
> DataList::build_reverseorder_querystring()
> DataList::build_searchfield_querystring()
> DataList::build_searchvalue_querystring()
> DataList::build_state_vars_query_string()
> DataList::build_tool_link()
> DataList::child_add_row_cell()
> DataList::child_build_column_header()
> DataList::child_build_search_table()
> DataList::child_get_gui()
> DataList::data_prefetch()
> DataList::do_action()
> DataList::expandrows()
> DataList::filter_column_string()
> DataList::get_cleanstring()
> DataList::get_current_page()
> DataList::get_data_source()
> DataList::get_default_num_rows()
> DataList::get_form_action()
> DataList::get_form_method()
> DataList::get_form_name()
> DataList::get_form_render()
> DataList::get_form_target()
> DataList::get_global_prefix()
> DataList::get_image_path()
> DataList::get_last_page()
> DataList::get_max_rows()
> DataList::get_not_found_message()
> DataList::get_num_pages()
> DataList::get_page_info()
> DataList::get_showall()
> DataList::get_simple_search_modifier()
> DataList::gui_init()
> DataList::is_advanced_search_enabled()
> DataList::is_search_enabled()
> DataList::numrows()
> DataList::offset()
> DataList::orderby()
> DataList::pre_query_sanity_check()
> DataList::render()
> DataList::reverseorder()
> DataList::search_disable()
> DataList::search_enable()
> DataList::search_field()
> DataList::search_type()
> DataList::search_value()
> DataList::search_value_filter()
> DataList::setup_columns()
> DataList::set_cleanstring()
> DataList::set_data_source()
> DataList::set_debug()
> DataList::set_default_num_rows()
> DataList::set_expandrows()
> DataList::set_form_action()
> DataList::set_form_method()
> DataList::set_form_name()
> DataList::set_form_render()
> DataList::set_form_target()
> DataList::set_global_prefix()
> DataList::set_image_path()
> DataList::set_max_rows()
> DataList::set_not_found_message()
> DataList::set_numrows()
> DataList::set_offset()
> DataList::set_orderby()
> DataList::set_reverseorder()
> DataList::set_save_vars()
> DataList::set_search_type()
> DataList::set_showall()
> DataList::set_show_results()
> DataList::set_simple_search_modifier()
> DataList::simple_search_modifier_value()
> DataList::user_setup()
> DataList::_build_default_vars()
> DataList::_build_save_vars()
> DataList::_build_simple_search_modifier()
> DataList::_build_tool_url()
> DataList::_check_datasource()
> DataList::_clean_string()
> DataList::_filter_column_string()
> DataList::_get()
> DataList::_get_searchable_fields()
> DataList::_javascript()
> DataList::_save_mozilla_nav_link()
> DataList::_set()
> DataList::_show_results()

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:37 -0700 by phpDocumentor 1.3.0RC3