[ Index ]
 

Code source de b2evolution 2.1.0-beta

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/blogs/inc/_core/ui/results/ -> _results.class.php (sommaire)

This file implements the Results class. This file is part of the evoCore framework - {@link http://evocore.net/} See also {@link http://sourceforge.net/projects/evocms/}.

Author: fplanque: Francois PLANQUE
Author: fsaya: Fabrice SAYA-GASNIER / PROGIDISTRI
Copyright: (c)2003-2007 by Francois PLANQUE - {@link http://fplanque.net/}
Version: $Id: _results.class.php,v 1.4 2007/11/03 21:04:26 fplanque Exp $
Poids: 2067 lignes (57 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

Results:: (38 méthodes):
  Results()
  restart()
  next_idx()
  query()
  mergesort()
  callback_group_by_obj_prop()
  order_callback_wrapper_objects()
  order_callback_wrapper_rows()
  get_page_ID_list()
  get_page_ID_array()
  count_total_rows()
  instantiate_page_to_Cache()
  display()
  display_init()
  display_option_area()
  display_colselect()
  display_filters()
  display_head()
  display_body()
  display_totals()
  display_functions()
  display_nav()
  get_col_sort_values()
  get_order_field_list()
  parse_col_content()
  move_icons()
  replace_callback()
  first()
  last()
  display_first()
  display_last()
  display_prev()
  display_next()
  page_list()
  page_scroll_list()
  get_num_rows()
  display_if_empty()
  conditional()


Classe: Results  - X-Ref

Results class

Results( $sql, $param_prefix = '', $default_order = '', $limit = NULL, $count_sql = NULL, $init_page = true )   X-Ref
Constructor

param: string SQL query
param: string prefix to differentiate page/order params when multiple Results appear one same page
param: string default ordering of columns (special syntax) if not specified in the URL params
param: integer number of lines displayed on one page (0 to disable paging; null to use $UserSettings/results_per_page)
param: string SQL to get the total count of results
param: boolean
param: NULL|string SQL query used to count the total # of rows (if NULL, we'll try to COUNT(*) by ourselves)

restart()   X-Ref
Rewind resultset


next_idx()   X-Ref
Increment and update all necessary counters before processing a new line in result set


query( $create_default_cols_if_needed = true, $append_limit = true, $append_order_by = true, $query_title = 'Results::Query()   X-Ref
Run the query now!

Will only run if it has not executed before.

mergesort(&$array, $cmp_function)   X-Ref
Merge sort. This is required to not re-order items when sorting for e.g. grouping at the end.

param: array List of items to sort
param: callback Sort function/method

callback_group_by_obj_prop( $row_a, $row_b, $depth = 0 )   X-Ref
Callback, to sort {@link Result::$rows} according to {@link Result::$group_by_obj_prop}.

param: array DB row for object A
param: array DB row for object B
param: integer Depth, used internally (you can group on a list of member properties)
return: integer

order_callback_wrapper_objects( $row_a, $row_b )   X-Ref
Wrapper method to {@link usort()}, which instantiates objects and passed them on to the
order callback.

return: integer

order_callback_wrapper_rows( $row_a, $row_b )   X-Ref
Wrapper method to {@link usort()}, which passes the rows to the order callback.

return: integer

get_page_ID_list()   X-Ref
Get a list of IDs for current page


get_page_ID_array()   X-Ref
Get an array of IDs for current page


count_total_rows( $sql_count = NULL )   X-Ref
Count the total number of rows of the SQL result (all pages)

This is done by dynamically modifying the SQL query and forging a COUNT() into it.


instantiate_page_to_Cache( & $Cache )   X-Ref
Note: this function might actually not be very useful.
If you define ->Cache before display, all rows will be instantiated on the fly.
No need to restart et go through the rows a second time here.

param: DataObjectCache

display( $display_params = NULL, $fadeout = NULL )   X-Ref
Display paged list/table based on object parameters

This is the meat of this class!

param: array|NULL
param: array Fadeout settings array( 'key column' => array of values ) or 'session'
return: int # of rows displayed

display_init( $display_params = NULL, $fadeout = NULL )   X-Ref
Initialize things in order to be ready for displaying.

This is useful when manually displaying, i-e: not by using Results::display()

param: array ***please document***
param: array Fadeout settings array( 'key column' => array of values ) or 'session'

display_option_area( $option_name, $area_name, $option_title, $submit_title, $default_folde_state = 'expanded' )   X-Ref
Display options area

param: string name of the option ( ma_colselect, tsk_filter....)
param: string area name ( colselect_area, filter_area )
param: string option title
param: string submit button title
param: string default folde state when is empty in the session

display_colselect()   X-Ref
Display the column selection


display_filters()   X-Ref
Display the filtering form


display_head()   X-Ref
Display list/table head.

This includes list head/title and column headers.
EXPERIMENTAL: also dispays <tfoot>


display_body()   X-Ref
Display list/table body.

This includes groups and data rows.


display_totals()   X-Ref
Display totals line if set.


display_functions()   X-Ref
Display the functions


display_nav( $template )   X-Ref
Display navigation text, based on template.

param: string template: 'header' or 'footer'

get_col_sort_values( $col_idx )   X-Ref
Returns values needed to make sort links for a given column

Returns an array containing the following values:
- current_order : 'ASC', 'DESC' or ''
- order_asc : url to order in ascending order
- order_desc
- order_toggle : url to toggle sort order

param: integer column to sort
return: array

get_order_field_list()   X-Ref
Returns order field list add to SQL query:

return: string May be empty

parse_col_content( $content )   X-Ref
Handle variable subtitutions for column contents.

This is one of the key functions to look at when you want to use the Results class.
- $var$
- £var£
- #var#
- {row}
- %func()%
- ¤func()¤

move_icons( )   X-Ref


replace_callback( $matches )   X-Ref
Widget callback for template vars.

This allows to replace template vars, see {@link Widget::replace_callback()}.

return: string

first()   X-Ref
Returns the first page number to be displayed in the list


last()   X-Ref
returns the last page number to be displayed in the list


display_first( $page_url = '' )   X-Ref
returns the link to the first page, if necessary


display_last( $page_url = '' )   X-Ref
returns the link to the last page, if necessary


display_prev( $page_url = '' )   X-Ref
returns a link to previous pages, if necessary


display_next( $page_url = '' )   X-Ref
returns a link to next pages, if necessary


page_list( $min, $max, $page_url = '' )   X-Ref
Returns the page link list under the table


page_scroll_list()   X-Ref
Pas de description

get_num_rows()   X-Ref
Get number of rows available for display

return: integer

display_if_empty( $params = array()   X-Ref
Template function: display message if list is empty

return: boolean true if empty

conditional( $condition, $on_true, $on_false = '' )   X-Ref
Pas de description



Généré le : Thu Nov 29 23:58:50 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics