Class BrowserColumn

Description

BrowserColumns are the basic building blocks. You can specify just the field name, and the column header or you can get fancy and specify an alignment, format string, SQL formula and cell CSS class.

Located in /classBrowser.php (line 31)


	
			
Variable Summary
 mixed $Align
 mixed $Class
 mixed $current_row
 mixed $Field
 mixed $Format
 mixed $Header
 mixed $Hook
 mixed $Sql
 mixed $Type
Method Summary
 BrowserColumn BrowserColumn (string $field, [string $header = ""], [string $align = ""], [string $format = ""], [string $sql = ""], [string $class = ""], [string $datatype = ""], [string $hook = null])
 void GetTarget ()
 void RenderHeader (string $order_field, string $order_direction, [int $browser_array_key = 0])
 void RenderValue ( $value, [ $extraclass = ""])
 void SetTranslatable ()
Variables
mixed $Align (line 37)
mixed $Class (line 38)
mixed $current_row (line 42)
mixed $Field (line 33)
mixed $Format (line 35)
mixed $Header (line 34)
mixed $Hook (line 41)
mixed $Sql (line 36)
mixed $Translatable (line 40)
mixed $Type (line 39)
Methods
Constructor BrowserColumn (line 68)

BrowserColumn constructor. Only the first parameter is mandatory.

BrowserColumn BrowserColumn (string $field, [string $header = ""], [string $align = ""], [string $format = ""], [string $sql = ""], [string $class = ""], [string $datatype = ""], [string $hook = null])
  • string $hook:

    The name of a global function which will preprocess the column value

    The hook function should be defined as follows: function hookfunction( $column_value, $column_name, $database_row ) { ... return $value; }

  • string $field: field The name of the column in the SQL result.
  • string $header: header The text to appear in the column header on output (@see BrowserColumn::RenderHeader()). If this is not supplied then a default of the field name will be used.
  • string $align: align left|center|right - text alignment. Defaults to 'left'.
  • string $format: format A format (a-la-printf) to render data values within. (@see BrowserColumn::RenderValue()). If this is not supplied then the default will ensure the column value is displayed as-is.
  • string $sql: sql Some SQL which will return the desired value to be presented as column 'field' of the result. If this is blank then the column is assumed to be a real data column.
  • string $class: class Additional classes to apply to the column header and column value cells.
  • string $datatype: datatype This will allow 'date' or 'timestamp' to preformat the field correctly before using it in replacements or display. Other types may be added in future.
GetTarget (line 85)

GetTarget

Retrieves a 'field' or '...SQL... AS field' definition for the target list of the SQL.

void GetTarget ()
RenderHeader (line 102)

RenderHeader

Renders the column header cell for this column. This will be rendered as a <th>...</th> with class and alignment applied to it. Browser column headers are clickable, and the ordering will also display an 'up' or 'down' triangle with the column header that the SQL is sorted on at the moment.

void RenderHeader (string $order_field, string $order_direction, [int $browser_array_key = 0])
  • string $order_field: order_field The name of the field currently being sorted on.
  • string $order_direction: order_direction Whether the sort is Ascending or Descending.
  • int $browser_array_key: browser_array_key Used this to help handle separate ordering of multiple browsers on the same page.
RenderValue (line 130)
void RenderValue ( $value, [ $extraclass = ""])
  • $value
  • $extraclass
SetTranslatable (line 126)
void SetTranslatable ()

Documentation generated on Fri, 10 Apr 2009 21:35:06 +1200 by phpDocumentor 1.3.2