tpTable Class Reference

Inherits Plugin.

Collaboration diagram for tpTable:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 tpTable ()
 build_table ($params)
 build_grid ($params)
 _getrowdata ($row, $idx)
 _pagelink ($pagenum, $curpage, $perpage, $url)
 _opt_isset ($options, $optname)
 _getparam (&$params, $name, $default)

Public Attributes

 $guid = 0

Detailed Description

PRONTO WEB FRAMEWORK Copyright (C) 2006, Judd Vinet

Author:
Judd Vinet <jvinet@zeroflux.org>

Description: Template plugin for generating "smart" and "dumb" tables. Dumb tables are simply a set of headers and rows of data. Smart tables have filters, sortable columns, pagination, and totals.

Definition at line 13 of file table.php.


Member Function Documentation

tpTable::_getparam ( &$  params,
name,
default 
)

Definition at line 588 of file table.php.

References $params.

Referenced by build_grid(), and build_table().

tpTable::_getrowdata ( row,
idx 
)

Definition at line 542 of file table.php.

Referenced by build_grid().

tpTable::_opt_isset ( options,
optname 
)

Definition at line 575 of file table.php.

Referenced by build_grid().

tpTable::_pagelink ( pagenum,
curpage,
perpage,
url 
)

Definition at line 554 of file table.php.

Referenced by build_grid().

tpTable::build_grid ( params  ) 

Generate a table of data with search filters/pagination/sorting/totals

Parameters:
array $params Table parameters

Parameters:

  • class :: css class for the table tag
  • url :: url to pass to for filter changes (CURRENT_URL)
  • noresults_txt :: text to display if no results are found (No Matches)
  • data_id :: name of column in dataset that uniquely identifies each record (id)
  • rows :: total number of rows in result set
  • perpage :: number of rows per page
  • curpage :: the current page number
  • rowclick :: action URL to go to if a table row is clicked
  • perpage_opts :: array of rows-per-page options for pagination control
  • options array :: override default table behavior ('noheaders','nosorting','nofilters','nofilterbutton''nototals','nopagination')
  • totals array :: array of data row indices that we should tally/display eg, 'totals' => array('amount' => array('format'=>'%.2f'))
  • cb_vars array :: array of variables that get passed to callback functions (used for special display logic)
  • rowclassfn :: function to call with row data - use this to pass back an additional tr class
  • columns array
    • key = index into data array
    • val = array
      • label :: header text label
      • align :: td alignment
      • type :: filter input type (text/select/date/none)
      • flength :: length of filter field (for text fields only)
      • options :: options array for type==select
      • options_nokeys :: same as above, but use values in <option> fields instead of keys
      • attribs :: attributes array, passed to the form-field generator function
      • format :: a sprintf string to pass the data through before displaying it
      • date_format :: if field is a date, specify the format string to be passed to date()
      • display_map :: if the values of a column map directly to certain display values, assign the map array to 'display_map'
      • display_func :: a function to run on the entire row, handy for output that isn't necessarily bound to a specific column from the result set
      • expr :: if column key is not a real db column, specify real one here
  • data array

Definition at line 122 of file table.php.

References $guid, $opts, $p, $params, __(), _getparam(), _getrowdata(), _opt_isset(), _pagelink(), array_hash(), and url().

tpTable::build_table ( params  ) 

Generate a simple table.

Parameters:
array $params Table parameters

Parameters:

  • class :: css class for the table tag
  • attribs :: additional attributes for the table tag
  • headers array
  • rows 2-d array

Definition at line 36 of file table.php.

References $params, and _getparam().

tpTable::tpTable (  ) 

Constructor

Definition at line 20 of file table.php.

References Plugin_Base::depend(), and Plugin::Plugin().


Member Data Documentation

tpTable::$guid = 0

Definition at line 15 of file table.php.

Referenced by build_grid().


The documentation for this class was generated from the following file:

Generated on Wed Jan 13 09:21:05 2010 for Pronto Framework by  doxygen 1.6.1