b2evolution

Multilingual multiuser multiblog engine

b2evolution Technical Documentation (Version 1.9) [ class tree: evocore ] [ index: evocore ] [ all elements ]

Class: ItemList2

Source Location: /blogs/inc/MODEL/items/_itemlist2.class.php

Class ItemList2

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::$DB
Results::$filter_area
Results::$functions_area
Results::$global_idx
Results::$global_is_first
Results::$global_is_last
Results::$group_by
Results::$grp_cols
Results::$ID_col
Results::$limit
Results::$nb_cols
Results::$order_callbacks
Results::$order_field_list
Results::$order_param
Results::$page
Results::$page_ID_array
Results::$page_ID_list
Results::$page_param
Results::$params
Results::$param_prefix
Results::$result_num_rows
Results::$rows
Results::$sql
Results::$total_pages
Results::$total_rows

Inherited From Widget

Widget::$global_icons
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::move_down()
Move down the element order in database
DataObjectList2::move_up()
Move up the element order in database

Inherited From FilteredResults

FilteredResults::is_filtered()
Check if the Result set is filtered or not

Inherited From Results

Results::Results()
Constructor
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_colselect()
Display the column selection
Results::display_filters()
Display the filtering form
Results::display_first()
returns the link to the first page, if necessary
Results::display_functions()
Display the functions
Results::display_head()
Display list/table head.
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_list_end()
Display list/table end.
Results::display_list_start()
Display list/table start.
Results::display_nav()
Display navigation text, based on template.
Results::display_next()
returns a link to next pages, if necessary
Results::display_option_area()
Display options area
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::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::restart()
Rewind resultset

Inherited From Widget

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   $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
ItemList2   ItemList2()   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 function: 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)
array   get_col_sort_values()   Returns values needed to make sort links for a given column
array   get_filter_titles()   Generate a title for the current list, depending on its filtering params
void   &get_item()   This is basically just a stub for backward compatibility
void   get_lastpostdate()   Get date 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   query()  
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   $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 ItemList2  [line 100]

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

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
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
   $restrict_to: 

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

[ Top ]
activate_preset_filters  [line 480]

  void activate_preset_filters( )

Activate preset default filters if necessary



[ Top ]
dates_to_end  [line 1355]

  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 1385]

  void date_if_changed( [string $before = '<h2>'], [string $after = '</h2>'], [string $format = ''], [string|NULL $before_empty_day = NULL], [string|NULL $after_empty_day = NULL]  )

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

Optionally also displays empty dates in between.

Parameters:
string   $before:  string to display before the date (if changed)
string   $after:  string to display after the date (if changed)
string   $format:  date/time format: leave empty to use locale default time format
string|NULL   $before_empty_day:  string to display before any empty dates. Set to NULL in order not to display empty dates.
string|NULL   $after_empty_day:  string to display after any empty dates.


[ Top ]
get_advertised_start_date  [line 1200]

  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 1263]

  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_col_sort_values  [line 1139]

  array get_col_sort_values( integer $col_idx  )

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 needed to order in ascending order
  • order_desc
  • order_toggle : url needed to toggle sort order

Parameters:
integer   $col_idx:  column to sort


Redefinition of:
Results::get_col_sort_values()
Returns values needed to make sort links for a given column

[ Top ]
get_filter_titles  [line 870]

  array get_filter_titles( )

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


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

[ Top ]
get_item  [line 1120]

  void &get_item( )

This is basically just a stub for backward compatibility


API Tags:
Deprecated:  


[ Top ]
get_lastpostdate  [line 782]

  void get_lastpostdate( )

Get date of the last post/item



[ Top ]
get_total_num_posts  [line 1109]

  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 302]

  boolean load_from_Request( )

Init filter params from Request params


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


[ Top ]
query  [line 552]

  void query( )


Information Tags:
Todo:  count?

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

[ Top ]
restore_filterset  [line 518]

  boolean restore_filterset( )

Load previously saved filterset from session.


API Tags:
Return:  true if we could restore something


[ Top ]
save_filterset  [line 500]

  void save_filterset( )

Save current filterset to session.



[ Top ]
set_default_filters  [line 174]

  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 188]

  void set_filters( array $filters  )

Set/Activate filterset

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

Parameters:
array   $filters: 


[ Top ]
set_start_date  [line 1336]

  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 Tue, 18 Dec 2007 22:47:29 +0100 by phpDocumentor 1.4.0