b2evolution

Multilingual multiuser multiblog engine

b2evolution Technical Documentation (CVS HEAD) [ class tree: evocore ] [ index: evocore ] [ all elements ]

Class: ItemListLight

Source Location: /blogs/inc/items/model/_itemlistlight.class.php

Class ItemListLight

Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From FilteredResults

FilteredResults::$default_filters
FilteredResults::$filters

Inherited From Results

Results::$Cache
Results::$cols
Results::$col_headers
Results::$current_group_ID
Results::$current_idx
Results::$current_Obj
Results::$functions_area
Results::$global_idx
Results::$global_is_first
Results::$global_is_last
Results::$group_by
Results::$group_by_obj_prop
Results::$grp_cols
Results::$ID_col
Results::$limit
Results::$nofollow_pagenav
Results::$order_callbacks
Results::$order_field_list
Results::$order_param
Results::$page
Results::$page_ID_array
Results::$page_ID_list
Results::$page_param
Results::$result_num_rows
Results::$rows
Results::$sql
Results::$total_rows

Inherited From Table

Table::$displayed_cols_count
Table::$displayed_lines_count
Table::$fadeout_array
Table::$fadeout_count
Table::$filter_area
Table::$is_fadeout_line
Table::$nb_cols
Table::$no_results_text
Table::$param_prefix
Table::$total_pages

Inherited From Widget

Widget::$global_icons
Widget::$params
Widget::$title

Inherited From DataObjectList2

DataObjectList2::DataObjectList2()
Constructor
DataObjectList2::get_by_idx()
Instantiate an object for requested row and cache it:
DataObjectList2::get_filter_title()
Display a global title matching filter params
DataObjectList2::get_next()
Get next object in list
DataObjectList2::get_row_by_idx()
DataObjectList2::move_down()
Move down the element order in database
DataObjectList2::move_up()
Move up the element order in database

Inherited From FilteredResults

FilteredResults::dump_active_filters()
Show every active filter that is not the same as the defaults
FilteredResults::get_active_filter()
Get a specific active filter
FilteredResults::get_active_filters()
Get every active filter that is not the same as the defaults
FilteredResults::is_filtered()
Check if the Result set is filtered or not

Inherited From Results

Results::Results()
Constructor
Results::callback_group_by_obj_prop()
Callback, to sort Result::$rows according to Result::$group_by_obj_prop.
Results::count_total_rows()
Count the total number of rows of the SQL result (all pages)
Results::display()
Display paged list/table based on object parameters
Results::display_body()
Display list/table body.
Results::display_first()
returns the link to the first page, if necessary
Results::display_functions()
Display the functions
Results::display_if_empty()
Template function: display message if list is empty
Results::display_init()
Initialize things in order to be ready for displaying.
Results::display_last()
returns the link to the last page, if necessary
Results::display_nav()
Display navigation text, based on template.
Results::display_next()
returns a link to next pages, if necessary
Results::display_prev()
returns a link to previous pages, if necessary
Results::display_totals()
Display totals line if set.
Results::first()
Returns the first page number to be displayed in the list
Results::get_col_sort_values()
Returns values needed to make sort links for a given column
Results::get_num_rows()
Get number of rows available for display
Results::get_order_field_list()
Returns order field list add to SQL query:
Results::get_page_ID_array()
Get an array of IDs for current page
Results::get_page_ID_list()
Get a list of IDs for current page
Results::instantiate_page_to_Cache()
Note: this function might actually not be very useful.
Results::last()
returns the last page number to be displayed in the list
Results::mergesort()
Merge sort. This is required to not re-order items when sorting for e.g. grouping at the end.
Results::move_icons()
Results::next_idx()
Increment and update all necessary counters before processing a new line in result set
Results::order_callback_wrapper_objects()
Wrapper method to http://www.php.net/usort, which instantiates objects and passed them on to the order callback.
Results::order_callback_wrapper_rows()
Wrapper method to http://www.php.net/usort, which passes the rows to the order callback.
Results::page_list()
Returns the page link list under the table
Results::page_scroll_list()
Results::parse_col_content()
Handle variable subtitutions for column contents.
Results::query()
Run the query now!
Results::replace_callback()
Widget callback for template vars.
Results::reset()
Reset the query -- EXPERIMENTAL
Results::restart()
Rewind resultset

Inherited From Table

Table::Table()
Constructor
Table::display_body_end()
Table::display_body_start()
Table::display_colselect()
Display the column selection
Table::display_col_end()
Table::display_col_headers()
Display column headers
Table::display_col_start()
Start a column (data).
Table::display_filters()
Display the filtering form
Table::display_head()
Display list/table head.
Table::display_init()
Initialize things in order to be ready for displaying.
Table::display_line_end()
Table::display_line_start()
Table::display_list_end()
Display list/table end.
Table::display_list_start()
Display list/table start.
Table::display_option_area()
Display options area
Table::replace_callback()
Widget callback for template vars.

Inherited From Widget

Widget::Widget()
Constructor
Widget::disp_template_raw()
Display a template param without replacing variables
Widget::disp_template_replaced()
Display a template param with its variables replaced
Widget::gen_global_icons()
Generate img tags for registered icons, through global_icon().
Widget::global_icon()
Registers a global action icon
Widget::replace_callback()
Callback function used to replace only necessary values in template.
Widget::replace_callback_wrapper()
This is an additional wrapper to replace_vars() that allows to react on the return value of it.
Widget::replace_vars()
Replaces $vars$ with appropriate values.

[ Top ]
Property Summary
mixed   $advertised_stop_date  
mixed   $Blog   Blog object this ItemList refers to
mixed   $getting_adv_start_date   Anti infinite loops:
mixed   $getting_adv_stop_date  
mixed   $group_by_cat  
mixed   $ItemQuery   SQL object for the Query
mixed   $last_displayed_date   Last date that has been output by date_if_changed()
mixed   $single_post   Did we request a single post?
mixed   $unit   list unit: 'posts' or 'days'

[ Top ]
Method Summary
ItemListLight   ItemListLight()   Constructor
void   activate_preset_filters()   Activate preset default filters if necessary
void   dates_to_end()   Template function: display potentially remaining empty days until the end of the filter interval
void   date_if_changed()   Template tag: Display the date if it has changed since last call
void   get_advertised_start_date()   Get the adverstised start date (does not include timestamp_min)
void   get_advertised_stop_date()   Get the adverstised stop date (does not include timestamp_max)
void   &get_category_group()   If the list is sorted by category...
array   get_filter_titles()   Generate a title for the current list, depending on its filtering params
void   &get_item()   If the list is sorted by category...
string   get_lastpostdate()   Get datetime of the last post/item
void   get_total_num_posts()   Return total number of posts
boolean   load_from_Request()   Init filter params from Request params
void   page_links()   Template tag
void   query()   Run Query: GET DATA ROWS *** LIGHT ***
void   query_init()  
void   reset()   Reset the query -- EXPERIMENTAL
boolean   restore_filterset()   Load previously saved filterset from session.
void   save_filterset()   Save current filterset to session.
void   set_default_filters()   Set default filter values we always want to use if not individually specified otherwise:
void   set_filters()   Set/Activate filterset
void   set_start_date()   Make sure date displaying starts at the beginning of the current filter interval

[ Top ]
Properties
mixed   $advertised_stop_date [line 79]

[ Top ]
mixed   $Blog [line 57]

Blog object this ItemList refers to


[ Top ]
mixed   $getting_adv_start_date = false [line 83]

Anti infinite loops:


[ Top ]
mixed   $getting_adv_stop_date = false [line 84]

[ Top ]
mixed   $group_by_cat = 0 [line 86]

[ Top ]
mixed   $ItemQuery [line 52]

SQL object for the Query


[ Top ]
mixed   $last_displayed_date = '' [line 72]

Last date that has been output by date_if_changed()


[ Top ]
mixed   $single_post = false [line 67]

Did we request a single post?


[ Top ]
mixed   $unit [line 62]

list unit: 'posts' or 'days'


[ Top ]
Methods
Constructor ItemListLight  [line 102]

  ItemListLight ItemListLight( Blog &$Blog, [mixed $timestamp_min = NULL], [mixed $timestamp_max = NULL], [integer|NULL $limit = 20], [string $cache_name = 'ItemCacheLight'], [string $param_prefix = ''], [array $filterset_name = '']  )

Constructor

Parameters:
Blog   &$Blog: 
mixed   $timestamp_min:  Default filter set: Do not show posts before this timestamp, can be 'now'
mixed   $timestamp_max:  Default filter set: Do not show posts after this timestamp, can be 'now'
integer|NULL   $limit:  Limit
string   $cache_name:  name of cache to be used (for table prefix info)
string   $param_prefix:  prefix to differentiate page/order params when multiple Results appear one same page
array   $filterset_name:  restrictions for itemlist (position, contact, firm, ...) key: restriction name, value: ID of the restriction

Information Tags:
Todo:  add param for saved session filter set

[ Top ]
activate_preset_filters  [line 535]

  void activate_preset_filters( )

Activate preset default filters if necessary



[ Top ]
dates_to_end  [line 1407]

  void dates_to_end( [string $before_empty_day = '<h2>'], [string $after_empty_day = '</h2>'], [string $format = '']  )

Template function: display potentially remaining empty days until the end of the filter interval

Parameters:
string   $before_empty_day:  string to display before the date (if changed)
string   $after_empty_day:  string to display after the date (if changed)
string   $format:  date/time format: leave empty to use locale default time format


[ Top ]
date_if_changed  [line 1433]

  void date_if_changed( [array $params = array()]  )

Template tag: Display the date if it has changed since last call

Optionally also displays empty dates in between.

Parameters:
array   $params: 


[ Top ]
get_advertised_start_date  [line 1252]

  void get_advertised_start_date( )

Get the adverstised start date (does not include timestamp_min)

Note: there is a priority order in the params to determine the start date: -dstart -week + m -m -dstop - x days


API Tags:
See:  ItemQuery::where_datestart()


[ Top ]
get_advertised_stop_date  [line 1315]

  void get_advertised_stop_date( )

Get the adverstised stop date (does not include timestamp_max)

Note: there is a priority order in the params to determine the stop date. -dstop -week + m -m -dstart + x days



[ Top ]
get_category_group  [line 1189]

  void &get_category_group( )

If the list is sorted by category...

Note: this only supports one level of categories (nested cats will be flatened)



[ Top ]
get_filter_titles  [line 901]

  array get_filter_titles( [ $ignore = array()], [ $params = array()]  )

Generate a title for the current list, depending on its filtering params

Parameters:
   $ignore: 
   $params: 

API Tags:
Return:  List of titles to display, which are escaped for HTML display (dh> only checked this for 'authors'/?authors=, where the output was not escaped)

Information Tags:
Todo:  cleanup some displays
Todo:  implement HMS part of YMDHMS

[ Top ]
get_item  [line 1218]

  void &get_item( )

If the list is sorted by category...

This is basically just a stub for backward compatibility



Redefined in descendants as:

[ Top ]
get_lastpostdate  [line 827]

  string get_lastpostdate( [string $dateformat = 'Y-m-d H:i:s']  )

Get datetime of the last post/item

Parameters:
string   $dateformat:  Date format (see http://www.php.net/date)

API Tags:
Return:  'Y-m-d H:i:s' formatted; If there are no items this will be $localtimenow.

Information Tags:
Todo:  dh> Optimize this, if this can be said after having done query() already.
Todo:  dh> Cache result

[ Top ]
get_total_num_posts  [line 1178]

  void get_total_num_posts( )

Return total number of posts

This is basically just a stub for backward compatibility


API Tags:
Deprecated:  


[ Top ]
load_from_Request  [line 334]

  boolean load_from_Request( [boolean $use_filters = true]  )

Init filter params from Request params

Parameters:
boolean   $use_filters:  do we want to use saved filters ?

API Tags:
Return:  true if we could apply a filterset based on Request params (either explicit or reloaded)


[ Top ]
page_links  [line 1486]

  void page_links( [ $params = array()]  )

Template tag

Parameters:
   $params: 


[ Top ]
query  [line 791]

  void query( )

Run Query: GET DATA ROWS *** LIGHT ***

Contrary to ItemList2, we only do 1 query here and we extract only a few selected params. Basically all we want is being able to generate permalinks.



Redefinition of:
Results::query()
Run the query now!

Redefined in descendants as:

[ Top ]
query_init  [line 614]

  void query_init( )


Information Tags:
Todo:  count?

[ Top ]
reset  [line 175]

  void reset( )

Reset the query -- EXPERIMENTAL

Useful to requery with a slighlty moidified filterset



Redefinition of:
Results::reset()
Reset the query -- EXPERIMENTAL

[ Top ]
restore_filterset  [line 573]

  boolean restore_filterset( )

Load previously saved filterset from session.


API Tags:
Return:  true if we could restore something


[ Top ]
save_filterset  [line 555]

  void save_filterset( )

Save current filterset to session.



[ Top ]
set_default_filters  [line 190]

  void set_default_filters( array $default_filters, [array $preset_filters = array()]  )

Set default filter values we always want to use if not individually specified otherwise:

Parameters:
array   $default_filters:  default filters to be merged with the class defaults
array   $preset_filters:  default filters for each preset, to be merged with general default filters if the preset is used


[ Top ]
set_filters  [line 205]

  void set_filters( array $filters, [boolean $memorize = true]  )

Set/Activate filterset

This will also set back the GLOBALS !!! needed for regenerate_url().

Parameters:
array   $filters: 
boolean   $memorize: 


[ Top ]
set_start_date  [line 1388]

  void set_start_date( )

Make sure date displaying starts at the beginning of the current filter interval

Note: we're talking about strict dates (no times involved)



[ Top ]

Documentation generated on Sat, 06 Mar 2010 04:16:21 +0100 by phpDocumentor 1.4.2. This site is hosted and maintained by Daniel HAHLER (Contact).