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

Public Member Functions

 __construct ( $title="")
 AddColumn ( $field, $header="", $align="", $format="", $sql="", $class="", $datatype="", $hook=null)
 AddHidden ( $field, $sql="")
 SetTitle ( $new_title)
 Title ( $new_title=null)
 SetTranslatable ( $column_list)
 SetSubTitle ( $sub_title)
 SetDiv ( $open_div, $close_div)
 SetJoins ( $join_list)
 SetUnion ( $union_select)
 SetWhere ( $where_clause)
 SetDistinct ( $distinct)
 SetLimit ( $limit_n)
 SetOffset ( $offset_n)
 MoreWhere ( $operator, $more_where)
 AndWhere ( $more_where)
 OrWhere ( $more_where)
 AddGrouping ( $field, $browser_array_key=0)
 AddOrder ( $field, $direction, $browser_array_key=0, $secondary=0)

Public Attributes

 $Title
 $SubTitle
 $FieldNames
 $Columns
 $HiddenColumns
 $Joins
 $Where
 $Distinct
 $Union
 $Order
 $OrderField
 $OrderDirection
 $OrderBrowserKey
 $ForcedOrder
 $Grouping
 $Limit
 $Offset
 $Query
 $BeginRow
 $CloseRow
 $BeginRowArgs
 $BeginExtraRow
 $CloseExtraRow
 $BeginExtraRowArgs
 $Totals
 $TotalFuncs
 $ExtraRows
 $match_column
 $match_value
 $match_function
 $DivOpen
 $DivClose

Detailed Description

Definition at line 178 of file classBrowser.php.

Constructor & Destructor Documentation

◆ __construct()

Browser::__construct ( $title = "")

The Browser class constructor

Parameters
string$titleA title for the browser (optional).

Definition at line 218 of file classBrowser.php.

Member Function Documentation

◆ AddColumn()

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

Add a column to the Browser.

This constructs a new BrowserColumn, appending it to the array of columns in this Browser.

Note that if the $format parameter starts with '

' the format will replace the column format, otherwise it will be used within '

...

' tags.

See also
BrowserColumn
Parameters
string$fieldThe name of the field.
string$headerA column header for the field.
string$alignAn alignment for column values.
string$formatA sprintf format for displaying column values.
string$sqlAn SQL fragment for calculating the value.
string$classA CSS class to apply to the cells of this column.
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 264 of file classBrowser.php.

◆ AddGrouping()

Browser::AddGrouping ( $field,
$browser_array_key = 0 )

Definition at line 453 of file classBrowser.php.

◆ AddHidden()

Browser::AddHidden ( $field,
$sql = "" )

Add a hidden column - one that is present in the SQL result, but for which there is no column displayed.

This can be useful for including a value in (e.g.) clickable links or title attributes which is not actually displayed as a visible column.

Parameters
string$fieldThe name of the field.
string$sqlAn SQL fragment to calculate the field, if it is calculated.

Definition at line 279 of file classBrowser.php.

◆ AddOrder()

Browser::AddOrder ( $field,
$direction,
$browser_array_key = 0,
$secondary = 0 )

Add an ordering to the browser widget.

The ordering can be overridden by GET parameters which will be rendered into the column headers so that a user can click on the column headers to control the actual order.

Parameters
string$fieldThe name of the field to be ordered by.
string$directionA for Ascending, otherwise it will be descending order.
string$browser_array_keyUse this to distinguish between multiple browser widgets on the same page. Leave it empty if you only have a single browser instance.
string$secondaryUse this to indicate a default secondary order which shouldn't interfere with the default primary order.

Definition at line 478 of file classBrowser.php.

◆ AndWhere()

Browser::AndWhere ( $more_where)

Add an OR ... to the SQL Where clause

Parameters
string$more_whereThe extra part of the where clause

Definition at line 440 of file classBrowser.php.

◆ MoreWhere()

Browser::MoreWhere ( $operator,
$more_where )

Add an [operator] ... to the SQL Where clause

You will generally want to call OrWhere or AndWhere rather than this function, but hey: who am I to tell you how to code!

Parameters
string$operatorThe operator to combine with previous where clause parts.
string$more_whereThe extra part of the where clause

Definition at line 427 of file classBrowser.php.

◆ OrWhere()

Browser::OrWhere ( $more_where)

Add an OR ... to the SQL Where clause

Parameters
string$more_whereThe extra part of the where clause

Definition at line 449 of file classBrowser.php.

◆ SetDistinct()

Browser::SetDistinct ( $distinct)

Set the SQL DISTINCT clause to a specific value.

The whole clause (except the keyword) needs to be supplied

Parameters
string$distinctThe whole clause, after 'DISTINCT'

Definition at line 392 of file classBrowser.php.

◆ SetDiv()

Browser::SetDiv ( $open_div,
$close_div )

Set a div for wrapping the browse.

Parameters
string$open_divThe HTML to open the div
string$close_divThe HTML to open the div

Definition at line 343 of file classBrowser.php.

◆ SetJoins()

Browser::SetJoins ( $join_list)

Set the tables and joins for the SQL.

For a single table this should just contain the name of that table, but for multiple tables it should be the full content of the SQL 'FROM ...' clause (excluding the actual 'FROM' keyword).

Parameters
string$join_list

Definition at line 357 of file classBrowser.php.

◆ SetLimit()

Browser::SetLimit ( $limit_n)

Set the SQL LIMIT clause to a specific value.

Only the limit number should be supplied.

Parameters
int$limit_nA number of rows to limit the SQL selection to

Definition at line 403 of file classBrowser.php.

◆ SetOffset()

Browser::SetOffset ( $offset_n)

Set the SQL OFFSET clause to a specific value.

Only the offset number

Parameters
int$offset_nA number of rows to offset the SQL selection to, based from the start of the results.

Definition at line 414 of file classBrowser.php.

◆ SetSubTitle()

Browser::SetSubTitle ( $sub_title)

Set a Sub Title for the browse.

Parameters
string$sub_titleThe sub title string

Definition at line 333 of file classBrowser.php.

◆ SetTitle()

Browser::SetTitle ( $new_title)

Set the Title for the browse.

This can also be set in the constructor but if you create a template Browser and then clone it in a loop you may want to assign a different Title for each instance.

Parameters
string$new_titleThe new title for the browser

Definition at line 293 of file classBrowser.php.

◆ SetTranslatable()

Browser::SetTranslatable ( $column_list)

Set the named columns to be translatable

Parameters
array$column_listThe list of columns which are translatable

Definition at line 315 of file classBrowser.php.

◆ SetUnion()

Browser::SetUnion ( $union_select)

Set a Union SQL statement.

In rare cases this might be useful. It's currently a fairly simple hack which requires you to put an entire valid (& matching) UNION subclause (although without the UNION keyword).

Parameters
string$union_select

Definition at line 370 of file classBrowser.php.

◆ SetWhere()

Browser::SetWhere ( $where_clause)

Set the SQL Where clause to a specific value.

The WHERE keyword should not be included.

Parameters
string$where_clauseA valide SQL WHERE ... clause.

Definition at line 381 of file classBrowser.php.

◆ Title()

Browser::Title ( $new_title = null)

Accessor for the Title for the browse, which could set the title also.

Parameters
string$new_titleThe new title for the browser
Returns
string The current title for the browser

Definition at line 304 of file classBrowser.php.

Member Data Documentation

◆ $BeginExtraRow

Browser::$BeginExtraRow

Definition at line 201 of file classBrowser.php.

◆ $BeginExtraRowArgs

Browser::$BeginExtraRowArgs

Definition at line 203 of file classBrowser.php.

◆ $BeginRow

Browser::$BeginRow

Definition at line 198 of file classBrowser.php.

◆ $BeginRowArgs

Browser::$BeginRowArgs

Definition at line 200 of file classBrowser.php.

◆ $CloseExtraRow

Browser::$CloseExtraRow

Definition at line 202 of file classBrowser.php.

◆ $CloseRow

Browser::$CloseRow

Definition at line 199 of file classBrowser.php.

◆ $Columns

Browser::$Columns

Definition at line 183 of file classBrowser.php.

◆ $Distinct

Browser::$Distinct

Definition at line 187 of file classBrowser.php.

◆ $DivClose

Browser::$DivClose

Definition at line 211 of file classBrowser.php.

◆ $DivOpen

Browser::$DivOpen

Definition at line 210 of file classBrowser.php.

◆ $ExtraRows

Browser::$ExtraRows

Definition at line 206 of file classBrowser.php.

◆ $FieldNames

Browser::$FieldNames

Definition at line 182 of file classBrowser.php.

◆ $ForcedOrder

Browser::$ForcedOrder

Definition at line 193 of file classBrowser.php.

◆ $Grouping

Browser::$Grouping

Definition at line 194 of file classBrowser.php.

◆ $HiddenColumns

Browser::$HiddenColumns

Definition at line 184 of file classBrowser.php.

◆ $Joins

Browser::$Joins

Definition at line 185 of file classBrowser.php.

◆ $Limit

Browser::$Limit

Definition at line 195 of file classBrowser.php.

◆ $match_column

Browser::$match_column

Definition at line 207 of file classBrowser.php.

◆ $match_function

Browser::$match_function

Definition at line 209 of file classBrowser.php.

◆ $match_value

Browser::$match_value

Definition at line 208 of file classBrowser.php.

◆ $Offset

Browser::$Offset

Definition at line 196 of file classBrowser.php.

◆ $Order

Browser::$Order

Definition at line 189 of file classBrowser.php.

◆ $OrderBrowserKey

Browser::$OrderBrowserKey

Definition at line 192 of file classBrowser.php.

◆ $OrderDirection

Browser::$OrderDirection

Definition at line 191 of file classBrowser.php.

◆ $OrderField

Browser::$OrderField

Definition at line 190 of file classBrowser.php.

◆ $Query

Browser::$Query

Definition at line 197 of file classBrowser.php.

◆ $SubTitle

Browser::$SubTitle

Definition at line 181 of file classBrowser.php.

◆ $Title

Browser::$Title

Definition at line 180 of file classBrowser.php.

◆ $TotalFuncs

Browser::$TotalFuncs

Definition at line 205 of file classBrowser.php.

◆ $Totals

Browser::$Totals

Definition at line 204 of file classBrowser.php.

◆ $Union

Browser::$Union

Definition at line 188 of file classBrowser.php.

◆ $Where

Browser::$Where

Definition at line 186 of file classBrowser.php.


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