Class: ItemLight
Source Location: /qp_inc/items/model/_itemlight.class.php
Class ItemLight
Inherited Properties, Constants, and Methods
Property Summary
| Blog |
$Blog |
The Blog of the Item (lazy filled, use get_Blog() to access it. |
Method Summary
| void |
categories() |
T-Tag: list all the category names |
| Blog |
&get_Blog() |
Get the Blog object for the Item. |
| integer |
get_blog_ID() |
Get the blog ID of this item (derived from main chapter). |
| void |
get_issue_date() |
T-Tag: returns formatted issue date or time (datetime) of Item |
| string |
get_title() |
Get "nice" title of the Item |
| void |
issue_date() |
T-Tag: Display issue date/time of an item |
| void |
issue_time() |
T-Tag: Display issue date/time of an item |
| boolean |
is_featured() |
T-Tag: Is this a 'featured' post? |
| boolean |
is_intro() |
T-Tag: Is this an 'intro' post? |
| void |
lang() |
Template function: display locale for item |
| void |
language() |
Template function: display language name for item |
| void |
load_Blog() |
Load the Blog object for the Item, without returning it. |
| void |
locale() |
Template function: display locale for item |
| void |
locale_flag() |
T-Tag: Displays or returns an author's locale flag |
| void |
main_category() |
Template function: display main category name |
| void |
mod_date() |
Template function: display last mod date (datetime) of Item |
| void |
mod_time() |
Template function: display last mod time (datetime) of Item |
| void |
permanent_link() |
T-Tag: Display the linked permanent url (permalink) for the item |
| void |
permanent_url() |
Template function: display permalink for item |
| boolean |
set() |
Set param value |
| void |
title() |
T-Tag: Display title for item and link to related URL |
| void |
type() |
Template function: display type of item |
Properties
The Blog of the Item (lazy filled, use get_Blog() to access it.
API Tags:
| See: | Blog::get_Blog() |
| Access: | protected |
Methods
ItemLight ItemLight(
[object table
$db_row = NULL], [string
$dbtable = 'T_items__item'], [string
$dbprefix = 'post_'], [string
$dbIDname = 'post_ID'], [string
$objtype = 'ItemLight'], [string
$datecreated_field = ''], [string
$datemodified_field = 'datemodified'], [string
$creator_field = ''], [string
$lasteditor_field = '']
)
|
|
Constructor
Parameters:
|
object table |
$db_row: |
Database row |
|
string |
$dbtable: |
|
|
string |
$dbprefix: |
|
|
string |
$dbIDname: |
|
|
string |
$objtype: |
for derived classes |
|
string |
$datecreated_field: |
datetime field name |
|
string |
$datemodified_field: |
datetime field name |
|
string |
$creator_field: |
User ID field name |
|
string |
$lasteditor_field: |
User ID field name |
void categories(
[array
$params = array()]
)
|
|
T-Tag: list all the category names
'before' => '',
'after' => ' ',
'include_main' => true,
'before_main' => '',
'after_main' => '',
'include_other' => true,
'before_other' => '',
'after_other' => '',
'include_external' => true,
'before_external' => '<em>',
'after_external' => '</em>',
'separator' => ', ',
'link_categories' => true,
'link_title' => T_('Browse category'),
'format' => 'htmlbody',
), $params );
Parameters:
void get_archive_url(
[string
$blogurl = ''], [string
$glue = '&']
)
|
|
Generate a link to the post in the archives
Parameters:
|
string |
$blogurl: |
base url to use |
|
string |
$glue: |
glue between url params |
Get the Blog object for the Item.
Get the blog ID of this item (derived from main chapter).
Get list of Chapter objects.
API Tags:
Get the chapter (category) IDs for this item.
Loads the extra categories and populates ItemLight::extra_cat_IDs if necessary. This method automatically populates the ItemCatsCache for other posts in the item list.
API Tags:
| Return: | The category IDs. |
void get_chapter_url(
[string
$blogurl = ''], [string
$glue = '&']
)
|
|
Generate a link to the post in the category
Parameters:
|
string |
$blogurl: |
base url to use |
|
string |
$glue: |
glue between url params |
string get_excerpt(
[string
$format = 'htmlbody']
)
|
|
Template function: get excerpt
Parameters:
|
string |
$format: |
filename to use to display more |
Information Tags:
| Todo: | do we want excerpts in itemLight or not? |
void get_issue_date(
[
$params = array()]
)
|
|
T-Tag: returns formatted issue date or time (datetime) of Item
'before' => '',
'after' => ' ',
'date_format' => '#', // '#' = locale_datefmt()
'use_GMT' => false,
), $params );
Parameters:
API Tags:
void get_permanent_link(
[string
$text = '#'], [string
$title = '#'], [string
$class = '']
)
|
|
T-Tag: Get the linked permanent url (permalink) for the item
Note: If you only want the permalink URL, use Item::get_permanent_url()
Parameters:
|
string |
$text: |
link text or special value: '#', '#icon#', '#text#', '#title#' '... $title$ ...' |
|
string |
$title: |
link title |
|
string |
$class: |
class name |
API Tags:
void get_permanent_url(
[string
$permalink_type = ''], [string
$blogurl = ''], [string
$glue = '&']
)
|
|
Generate the permalink for the item.
Note: Each item has an unique permalink at any given time. Some admin settings may however change the permalinks for previous items. Note: This actually only returns the URL, to get a real link, use Item::get_permanent_link()
Parameters:
|
string |
$permalink_type: |
single, archive, subchap |
|
string |
$blogurl: |
base url to use |
|
string |
$glue: |
glue between url params |
Information Tags:
| Todo: | archives modes in clean URL mode |
array get_prefetch_itemlist_IDs(
)
|
|
Get a list of item IDs from $MainList and $ItemList, if they are loaded.
This is used for prefetching item related data for the whole list(s). This will at least return the item's ID itself.
void get_single_url(
[boolean
$allow_redir = true], [string
$blogurl = ''], [string
$glue = '&']
)
|
|
Generate a single post link for the item
Parameters:
|
boolean |
$allow_redir: |
allow redir to permalink, true | false | 'auto' to prevent redit only if single isn't the current permalink type |
|
string |
$blogurl: |
base url to use |
|
string |
$glue: |
glue between url params |
string get_title(
[
$params = array()]
)
|
|
Get "nice" title of the Item
Parameters:
API Tags:
void issue_date(
[
$params = array()]
)
|
|
T-Tag: Display issue date/time of an item
Parameters:
API Tags:
void issue_time(
[
$params = array()]
)
|
|
T-Tag: Display issue date/time of an item
Parameters:
API Tags:
T-Tag: Is this a 'featured' post?
Any intro post will return false even if it's checked as "featured"
T-Tag: Is this an 'intro' post?
Template function: display locale for item
void language(
[string
$format = 'htmlbody']
)
|
|
Template function: display language name for item
Parameters:
Load the Blog object for the Item, without returning it.
This is needed for Results object callbacks.
Template function: display locale for item
void locale_flag(
[array
$params = array()]
)
|
|
T-Tag: Displays or returns an author's locale flag
'before' => ' ',
'after' => ' ',
'collection' => 'h10px', // 'h10px' or 'w16px'
'format' => 'htmlbody',
'class' => 'flag',
'align' => '',
), $params );
Parameters:
API Tags:
void locale_temp_switch(
)
|
|
T-Tag: Temporarily switch to this item's locale
API Tags:
void main_category(
[string
$format = 'htmlbody']
)
|
|
Template function: display main category name
Parameters:
void mod_date(
[string
$format = ''], [boolean
$useGM = false]
)
|
|
Template function: display last mod date (datetime) of Item
Parameters:
|
string |
$format: |
date/time format: leave empty to use locale default date format |
|
boolean |
$useGM: |
true if you want GMT |
void mod_time(
[string
$format = ''], [boolean
$useGM = false]
)
|
|
Template function: display last mod time (datetime) of Item
Parameters:
|
string |
$format: |
date/time format: leave empty to use locale default time format |
|
boolean |
$useGM: |
true if you want GMT |
void permanent_link(
[array
$params = array()]
)
|
|
T-Tag: Display the linked permanent url (permalink) for the item
Note: If you only want the permalink URL, use Item::permanent_url()
'before' => '',
'after' => '',
'text' => '#', // possible special values: '#', '#icon#', '#text#', '#title#'
'title' => '#', // '#' = T_('Permanent link to full entry'),
'class' => '',
), $params );
Parameters:
API Tags:
void permanent_url(
[string
$mode = ''], [string
$blogurl = '']
)
|
|
Template function: display permalink for item
Note: This actually only outputs the URL, to display a real link, use Item::permanent_link()
Parameters:
|
string |
$mode: |
'post', 'archive#id' or 'archive#title' |
|
string |
$blogurl: |
url to use |
boolean set(
string
$parname, mixed
$parvalue, [boolean
$make_null = false]
)
|
|
Set param value
By default, all values will be considered strings
Parameters:
|
string |
$parname: |
parameter name |
|
mixed |
$parvalue: |
parameter value |
|
boolean |
$make_null: |
true to set to NULL if empty value |
API Tags:
| Return: | true, if a value has been set; false if it has not changed |
Information Tags:
| Todo: | extra_cat_IDs recording |
Redefinition of:
- DataObject::set()
- Set param value
Redefined in descendants as:
boolean set_extracats(
array
$cats, [boolean
$add = false]
)
|
|
Set the extra categories for this item.
NOTE: Use ItemLight::set( 'extra_cat_IDs', ... ) to set the extra categories.
Parameters:
|
array |
$cats: |
An array containing the extra category IDs. |
|
boolean |
$add: |
Whether to add the new categories to the existing ones. |
API Tags:
| Return: | True if the extra categories have changed. |
Information Tags:
| Todo: | Tblue> Check whether a change should invalidate the ItemCatsCache for this Item. |
void title(
[
$params = array()]
)
|
|
T-Tag: Display title for item and link to related URL
Parameters:
API Tags:
void type(
[string
$before = ''], [string
$after = ''], [string
$format = 'htmlbody']
)
|
|
Template function: display type of item
Parameters:
|
|