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 /widgets/data_list/DefaultGUIDataList.inc (line 32)

Container
   |
   --BaseWidget
      |
      --DataList
         |
         --DefaultGUIDatalist
Variable Summary
Method Summary
INPUTtag action_button (string $name, [string $action = ""], [string $javascript = ""])
INPUTtag action_select (string $name, [mixed $options = array()], [mixed $selected = ""], [boolean $multiple_flag = false], [mixed $attribs = false], [ $action = ""], [ $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)
void child_add_row_cell ( $obj,  $col_name,  $last_in_row_flag,  $row_data,  $even_row)
void child_build_column_header ( $name,  $col,  $cnt)
void child_get_gui ()
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_show_empty_datalist_actionbar ([bool $flag = TRUE])
void set_title_enable (boolean $flag)
boolean show_actionbar ()
TDtag wrap_column_item (mixed $obj, string $col_name, int $even_flag, 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 ()
string _search_javascript ()
Variables
mixed $alternating_row_colors = TRUE (line 165)

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

mixed $_action_column = array() (line 46)

This holds the action column settings if any.

mixed $_action_count = 0 (line 52)

holds the cntr for the action

checkbox name

mixed $_align = "center" (line 40)

The overall alignment

DEFAULT: "center"

mixed $_allow_select_all = TRUE (line 101)

This variable tells us whether to display

select all checkbox

mixed $_collapsable_search = FALSE (line 123)

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 138)
mixed $_default_checked_items = array() (line 84)

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

do we show the title string?

mixed $_hidden_checkbox_items = array() (line 59)

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

mixed $_save_checked_items_flag = FALSE (line 74)

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

mixed $_search_flag = TRUE (line 159)

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

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

mixed $_search_tree_open = TRUE (line 129)

Initial state of the search tree

mixed $_show_actionbar = TRUE (line 90)

Do we show action bar row?

mixed $_show_empty_datalist_actionbar = FALSE (line 95)

Do we show action bar row when the data list is empty?

mixed $_simple_search_modifier = SEARCH_ALL (line 146)

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

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

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

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

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();
action_select (line 1186)

This function builds an action select box that will be passed when a form action button is executed.

  • return: object
INPUTtag action_select (string $name, [mixed $options = array()], [mixed $selected = ""], [boolean $multiple_flag = false], [mixed $attribs = false], [ $action = ""], [ $javascript = ""])
  • string $name: - the select name
  • mixed $options: - the select options
  • mixed $selected: - selected - string for one, array for multiple
  • boolean $multiple_flag: - multiple select
  • mixed $attribs: - additional attributes
  • $action
  • $javascript
add_action_column (line 719)

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

Sets the flag for rendering the select all checkbox

void allow_select_all (bool $flag)
  • bool $flag: flag
build_column_header (line 430)

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

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 328)
void child_add_row_cell ( $obj,  $col_name,  $last_in_row_flag,  $row_data,  $even_row)
  • $obj
  • $col_name
  • $last_in_row_flag
  • $row_data
  • $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 295)
void child_build_column_header ( $name,  $col,  $cnt)
  • $name
  • $col
  • $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 531)

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 380)
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
empty_datalist_actionbar_cell (line 1133)

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 empty_datalist_actionbar_cell ()
get_default_checked_items (line 748)

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

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

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

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

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

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

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

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

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

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

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

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

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_show_empty_datalist_actionbar (line 200)

This sets the flag to turn on/off the the action bar when the datalist is empty.

void set_show_empty_datalist_actionbar ([bool $flag = TRUE])
  • bool $flag
set_title_enable (line 834)

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

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

boolean show_actionbar ()
wrap_column_item (line 492)

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

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

  • return: object
TABLEtag _build_actionbar ()
_build_actionbar_arrow_cell (line 1053)

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

This function builds the user's data cell

TDtag; _build_actionbar_data_cell ()
_build_action_column (line 874)

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

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

  • return: object
Container _build_advanced_search_form ()
_build_default_vars (line 401)
void _build_default_vars ()

Redefinition of:
DataList::_build_default_vars()
This function builds the list of
_build_search_title (line 604)

This function builds the search title table

  • return: object
TABLEtag _build_search_title ()
_build_simple_search_form (line 642)

This function builds the simple search TD

ContainerWidget _build_simple_search_form ()
_checkbox_javascript (line 1251)

This function builds the JS needed for the checkbox action column

SCRIPTtag _checkbox_javascript ()
_has_action_column (line 791)

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

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

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

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

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 Fri, 28 Jan 2011 08:52:51 -0500 by phpDocumentor 1.4.3