Andrew's Web Libraries (AWL)
Loading...
Searching...
No Matches
BrowserColumn Class Reference

Public Member Functions

 __construct ( $field, $header="", $align="", $format="", $sql="", $class="", $datatype="", $hook=null)
 
 GetTarget ()
 
 RenderHeader ( $order_field, $order_direction, $browser_array_key=0, $forced_order=false)
 
 SetTranslatable ()
 
 RenderValue ( $value, $extraclass="")
 

Public Attributes

 $Field
 
 $Header
 
 $Format
 
 $Sql
 
 $Align
 
 $Class
 
 $Type
 
 $Translatable
 
 $Hook
 
 $current_row
 

Detailed Description

Definition at line 32 of file classBrowser.php.

Constructor & Destructor Documentation

◆ __construct()

BrowserColumn::__construct (   $field,
  $header = "",
  $align = "",
  $format = "",
  $sql = "",
  $class = "",
  $datatype = "",
  $hook = null 
)

BrowserColumn constructor. Only the first parameter is mandatory.

Parameters
stringfield The name of the column in the SQL result.
stringheader The text to appear in the column header on output (
See also
BrowserColumn::RenderHeader()). If this is not supplied then a default of the field name will be used.
Parameters
stringalign left|center|right - text alignment. Defaults to 'left'.
stringformat A format (a-la-printf) to render data values within. (
See also
BrowserColumn::RenderValue()). If this is not supplied then the default will ensure the column value is displayed as-is.
Parameters
stringsql 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.
stringclass Additional classes to apply to the column header and column value cells.
stringdatatype 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.
string$hookThe 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; }

Definition at line 69 of file classBrowser.php.

Member Function Documentation

◆ GetTarget()

BrowserColumn::GetTarget ( )

GetTarget

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

Definition at line 86 of file classBrowser.php.

◆ RenderHeader()

BrowserColumn::RenderHeader (   $order_field,
  $order_direction,
  $browser_array_key = 0,
  $forced_order = false 
)

RenderHeader Renders the column header cell for this column. This will be rendered as a

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

Parameters
stringorder_field The name of the field currently being sorted on.
stringorder_direction Whether the sort is Ascending or Descending.
intbrowser_array_key Used this to help handle separate ordering of multiple browsers on the same page.
stringforced_order If true, then we don't allow order to be changed.

Definition at line 104 of file classBrowser.php.

◆ RenderValue()

BrowserColumn::RenderValue (   $value,
  $extraclass = "" 
)

Definition at line 133 of file classBrowser.php.

◆ SetTranslatable()

BrowserColumn::SetTranslatable ( )

Definition at line 129 of file classBrowser.php.

Member Data Documentation

◆ $Align

BrowserColumn::$Align

Definition at line 38 of file classBrowser.php.

◆ $Class

BrowserColumn::$Class

Definition at line 39 of file classBrowser.php.

◆ $current_row

BrowserColumn::$current_row

Definition at line 43 of file classBrowser.php.

◆ $Field

BrowserColumn::$Field

Definition at line 34 of file classBrowser.php.

◆ $Format

BrowserColumn::$Format

Definition at line 36 of file classBrowser.php.

◆ $Header

BrowserColumn::$Header

Definition at line 35 of file classBrowser.php.

◆ $Hook

BrowserColumn::$Hook

Definition at line 42 of file classBrowser.php.

◆ $Sql

BrowserColumn::$Sql

Definition at line 37 of file classBrowser.php.

◆ $Translatable

BrowserColumn::$Translatable

Definition at line 41 of file classBrowser.php.

◆ $Type

BrowserColumn::$Type

Definition at line 40 of file classBrowser.php.


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