
Provides miscellaneous functionality for CRUD-like pages
1.0.0b5 | Updated class to use new fSession API 10/23/09 |
---|---|
1.0.0b4 | Updated class to use new fSession API 5/8/09 |
1.0.0b3 | Backwards Compatiblity Break - moved printOption() to fHTML::printOption(), showChecked() to fHTMLshowChecked(), removeListItems() and reorderListItems() to fException::splitMessage(), generateRequestToken() to fRequestgenerateCSRFToken(), and validateRequestToken() to fRequest::validateCSRFToken() 5/8/09 |
1.0.0b2 | Fixed a bug preventing loaded search values from being included in redirects 3/18/09 |
1.0.0b | The initial implementation 6/14/07 |
Return the string 'sorted' if $column is the column that is currently being sorted by, otherwise returns ''
This method will only be useful if used with the other sort methods printSortableColumn(), getSortColumn() and getSortDirection().
string getColumnClass( string $column )
string | $column | The column to check |
The CSS class for the column, either '' or 'sorted'
Returns a CSS class name for a row
Will return 'even', 'odd', or 'highlighted' if the two parameters are equal and not NULL. The first call to this method will return the appropriate class concatenated with ' first'.
string getRowClass( mixed $row_value=NULL, mixed $affected_value=NULL )
mixed | $row_value | The value from the row |
mixed | $affected_value | The value that was just added or updated |
The css class
Gets the current value of a search field
If a value is an empty string and no cast to is specified, the value will become NULL.
If a query string of ?reset is passed, all previous search values will be erased.
mixed getSearchValue( string $column, string $cast_to=NULL, string $default=NULL )
string | $column | The column that is being pulled back |
string | $cast_to | The data type to cast to |
string | $default | The default value |
The current value
Gets the current column to sort by, defaults to first one specified
string getSortColumn( string $possible_column [, ... ] )
string | $possible_column [, ... ] | The columns that can be sorted by, defaults to first |
The column to sort by
Gets the current sort direction
string getSortDirection( string $default_direction )
string | $default_direction | The default direction, 'asc' or 'desc' |
The direction, 'asc' or 'desc'
Prints a sortable column header a tag
The a tag will include the CSS class 'sortable_column' and the direction being sorted, 'asc' or 'desc'.
fCRUD::printSortableColumn('name', 'Name');
would create the following HTML based on the page context
Name
Name
void printSortableColumn( string $column, string $column_name=NULL )
string | $column | The column to create the sortable header for |
string | $column_name | This will override the humanized version of the column |
Checks to see if any values (search or sort) were loaded from the session, and if so redirects the user to the current URL with those values added
void redirectWithLoadedValues( )
Please note: this method is public, however it is primarily intended for internal use by Flourish and will normally not be useful in site/application code
Resets the configuration and data of the class
void reset( )