C:/drupal/includes/tablesort.inc File Reference

Go to the source code of this file.


Functions

 tablesort_init ($header)
 tablesort_sql ($header, $before= '')
 tablesort_header ($cell, $header, $ts)
 tablesort_cell ($cell, $header, $ts, $i)
 tablesort_get_querystring ()
 tablesort_get_order ($headers)
 tablesort_get_sort ($headers)


Detailed Description

Functions to aid in the creation of sortable tables.

All tables created with a call to theme('table') have the option of having column headers that the user can click on to sort the table by that column.

Definition in file tablesort.inc.


Function Documentation

tablesort_cell ( cell,
header,
ts,
i 
)

Format a table cell.

Adds a class attribute to all cells in the currently active column.

Parameters:
$cell The cell to format.
$header An array of column headers in the format described in theme_table().
$ts The current table sort context as returned from tablesort_init().
$i The index of the cell's table column.
Returns:
A properly formatted cell, ready for _theme_table_cell().

Definition at line 114 of file tablesort.inc.

References $header.

Referenced by theme_table().

tablesort_get_order ( headers  ) 

Determine the current sort criterion.

Parameters:
$headers An array of column headers in the format described in theme_table().
Returns:
An associative array describing the criterion, containing the keys:
  • "name": The localized title of the table column.
  • "sql": The name of the database field to sort on.

Definition at line 152 of file tablesort.inc.

References $header.

Referenced by tablesort_init().

tablesort_get_querystring (  ) 

Compose a query string to append to table sorting requests.

Returns:
A query string that consists of all components of the current page request except for those pertaining to table sorting.

Definition at line 138 of file tablesort.inc.

References drupal_query_string_encode().

Referenced by tablesort_init().

Here is the call graph for this function:

tablesort_get_sort ( headers  ) 

Determine the current sort direction.

Parameters:
$headers An array of column headers in the format described in theme_table().
Returns:
The current sort direction ("asc" or "desc").

Definition at line 187 of file tablesort.inc.

References $header.

Referenced by tablesort_init().

tablesort_header ( cell,
header,
ts 
)

Format a column header.

If the cell in question is the column header for the current sort criterion, it gets special formatting. All possible sort criteria become links.

Parameters:
$cell The cell to format.
$header An array of column headers in the format described in theme_table().
$ts The current table sort context as returned from tablesort_init().
Returns:
A properly formatted cell, ready for _theme_table_cell().

Definition at line 68 of file tablesort.inc.

References $title, l(), t(), and theme().

Referenced by theme_table().

Here is the call graph for this function:

tablesort_init ( header  ) 

Initialize the table sort context.

Definition at line 15 of file tablesort.inc.

References $header, tablesort_get_order(), tablesort_get_querystring(), and tablesort_get_sort().

Referenced by tablesort_sql(), and theme_table().

Here is the call graph for this function:


Generated on Mon Jun 2 15:08:08 2008 for SimpleTest by  1.5.5