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.

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

Container
   |
   --BaseWidget
      |
      --DataList
         |
         --DefaultGUIDatalist
Variable Summary
Method Summary
INPUTtag action_button (string $name, string $action)
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)
void child_add_row_cell (mixed $obj, mixed $col_name, mixed $last_in_row_flag, mixed $row_data)
void child_build_column_header (mixed $name, mixed $col, mixed $cnt)
void child_get_gui ()
void gui_init ()
boolean is_action_checked (string $value, array $row_data)
boolean is_action_enabled (string $value, array $row_data)
void set_actionbar ([boolean $flag = TRUE])
void set_align (string $align)
void set_default_checked_items (array $items)
void set_global_prefix (string $prefix)
boolean show_actionbar ()
TDtag wrap_column_item (mixed $obj, string $col_name, int 2, int 3)
HTMLTag _build_action_column (string $col, [boolean $header_flag = FALSE], [array $row_data = NULL])
boolean _has_action_column (string $col)
boolean. _is_col_checked (string $value, array $row_data)
mixed _javascript ()
Variables
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 86)

This variable tells us whether to display

select all checkbox

mixed $_cur_col_cntr = 0 (line 107)
mixed $_default_checked_items = array() (line 74)

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 $_hidden_checkbox_items = array() (line 55)

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

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

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

mixed $_show_actionbar = TRUE (line 80)

Do we show action bar row?

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 104)

for a reference so the row_filter affects the paging information.

Inherited Variables

Inherited from DataList

DataList::$alternating_row_colors
DataList::$_advanced_search_flag
DataList::$_columns
DataList::$_datasource
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::$_num_columns
DataList::$_num_pages
DataList::$_save_vars
DataList::$_search_flag
DataList::$_search_table
DataList::$_show_results_flag
DataList::$_simple_search_modifier
DataList::$_vars

Inherited from BaseWidget

BaseWidget::$title
BaseWidget::$width

Inherited from Container

Container::$_flags
Methods
actionbar_cell (line 863)

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 876)

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 $name:

    - the button name

  • string $action:

    - the script that gets called.

add_action_column (line 503)

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 597)

Sets the flag for rendering the select all checkbox

void allow_select_all (bool $flag)
  • bool $flag:

    flag

build_column_header (line 291)

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 264)

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 219)
void child_add_row_cell (mixed $obj, mixed $col_name, mixed $last_in_row_flag, mixed $row_data)

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 186)
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 391)

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 270)
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 529)

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

array get_default_checked_items ()
gui_init (line 125)
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 734)

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 747)

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 538)

set the flag to tell the object to

save the checked items

void save_checked_items ()
set_actionbar (line 578)

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 182)

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_default_checked_items (line 518)

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 118)

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.
show_actionbar (line 588)

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

boolean show_actionbar ()
wrap_column_item (line 354)

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 2, int 3)
  • int 2:

    - $odd_row - tells us if this cell lives in an odd # row (for alternating row colors)

  • 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.

_build_actionbar (line 757)

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

  • return:

    object

TABLEtag _build_actionbar ()
_build_actionbar_arrow_cell (line 793)

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 828)

This function builds the user's data cell

TDtag; _build_actionbar_data_cell ()
_build_action_column (line 612)

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_search_title (line 423)

This function builds the search title table

  • return:

    object

TABLEtag _build_search_title ()
_build_simple_search_form (line 441)

This function builds the simple search TD

ContainerWidget _build_simple_search_form ()
_checkbox_javascript (line 916)

This function builds the JS needed for the checkbox action column

SCRIPTtag _checkbox_javascript ()
_has_action_column (line 562)

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 703)

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 897)

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 550)

This tests the object flag to

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

boolean _save_checked_items_enabled ()

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::filter_column_string()
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_num_pages()
DataList::get_page_info()
DataList::get_simple_search_modifier()
DataList::gui_init()
DataList::is_advanced_search_enabled()
DataList::is_search_enabled()
DataList::numrows()
DataList::offset()
DataList::orderby()
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_data_source()
DataList::set_default_num_rows()
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_reverseorder()
DataList::set_save_vars()
DataList::set_search_type()
DataList::set_show_results()
DataList::set_simple_search_modifier()
DataList::showall()
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_title()
BaseWidget::set_width()

Inherited From Container

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

Documention generated on Thu, 31 Jul 2003 18:32:24 -0700 by phpDocumentor 1.2.0