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 |
void activate_preset_filters(
)
|
|
Activate preset default filters if necessary
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 |
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. |
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:
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
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
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 |
This is basically just a stub for backward compatibility
API Tags:
Get date of the last post/item
void get_total_num_posts(
)
|
|
return total number of posts
This is basically just a stub for backward compatibility
API Tags:
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) |
boolean restore_filterset(
)
|
|
Load previously saved filterset from session.
API Tags:
| Return: | true if we could restore something |
Save current filterset to session.
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 |
void set_filters(
array
$filters
)
|
|
Set/Activate filterset
This will also set back the GLOBALS !!! needed for regenerate_url().
Parameters:
Make sure date displaying starts at the beginning of the current filter interval
Note: we're talking about strict dates (no times involved)