Procedural File: LibertyContent.php
Source Location: /liberty/LibertyContent.php
Classes:
LibertyContent
Virtual base class (as much as one can have such things in PHP) for all derived tikiwiki classes that require database access.
Page Details:
Tags:
Includes:
BIT_CONTENT_DEFAULT_STATUS [line 32]
BIT_CONTENT_MAX_FORMAT_GUID_LEN [line 29]
BIT_CONTENT_MAX_IP_LEN [line 28]
BIT_CONTENT_MAX_LANGUAGE_LEN [line 27]
BIT_CONTENT_MAX_TITLE_LEN [line 25]
LIBERTY_SPLIT_REGEX [line 44]
convertSortMode [line 2332]
the convertSortMode(
pParamHash &$pSortMode, [ $pDefault = 'last_modified_desc'])
|
|
Validate inbound sort_mode parameter
Tags:
Parameters
pParamHash |
&$pSortMode |
hash of parameters for any getList() function |
|
$pDefault |
|
decodeAjaxRequest [line 3105]
void decodeAjaxRequest(
&$pParamHash)
|
|
convenience function to process a $_REQUEST array
Parameters
expungeActionLog [line 3554]
TRUE expungeActionLog(
[array $pTimeSpan = NULL])
|
|
expungeActionLog
Tags:
Parameters
array |
$pTimeSpan |
Anything older than this timespan will be removed |
expungeCache [line 3304]
TRUE expungeCache(
[array $pContentId = ])
|
|
Delete liberty cache
Tags:
Parameters
expungeCacheFile [line 3281]
TRUE expungeCacheFile(
[array $pContentId = NULL])
|
|
Delete cache files for a given content item
Tags:
Parameters
filterData [line 3017]
filtered filterData(
&$pData, &$pFilterHash, [keyword $pFilterStage = 'preparse'], array $pFilterHash, string $pFilterHash[data])
|
|
filterData will apply one of the specified filter stages to the input data
Tags:
Parameters
array |
$pFilterHash |
array of data that should be filtered |
string |
$pFilterHash[data] |
is the actual data that needs to be filtered |
keyword |
$pFilterStage |
specify what filter stage the data is at: pre, post, presplit or postsplit |
|
&$pData |
|
|
&$pFilterHash |
|
getActionLogs [line 3484]
List getActionLogs(
&$pListHash, array $pListHash)
|
|
Get a list of action log entries
Tags:
Parameters
array |
$pListHash |
List options |
|
&$pListHash |
|
getAuthorList [line 2395]
- getAuthorList(
array &$pListHash)
|
|
Get a list of users who have created entries in the content table
Tags:
Parameters
array |
&$pListHash |
hash of parameters ( content_type_guid will limit list to a single content type |
getAvailableContentStatuses [line 3575]
an getAvailableContentStatuses(
[ $pUserMinimum = -100], [ $pUserMaximum = 100])
|
|
getAvailableContentStatus
Tags:
Parameters
|
$pUserMinimum |
|
|
$pUserMaximum |
|
getCacheBasePath [line 3188]
absolute getCacheBasePath(
)
|
|
Get the path where we store liberty cached content
Tags:
getCacheFile [line 3266]
filename getCacheFile(
[array $pContentId = NULL], [ $pCacheExtension = NULL])
|
|
Get the path to file where an individual cache item is stored
Tags:
Parameters
array |
$pContentId |
Content id of cached item |
|
$pCacheExtension |
|
getCachePath [line 3199]
path getCachePath(
[array $pContentId = NULL])
|
|
Get the path to directory where an individual cache item is stored
Tags:
Parameters
array |
$pContentId |
Content id of cached item |
getContentList [line 2457]
array getContentList(
&$pListHash, string $pListHash['content_type_guid'], integer $pListHash['max_records'], integer $pListHash['offset'], string $pListHash['sort_mode'], array $pListHash['find'], integer $pListHash[''])
|
|
Get a list of all content
Tags:
Parameters
string |
$pListHash['content_type_guid'] |
Content GUID to limit the list to |
integer |
$pListHash['max_records'] |
Number of the first record to access ( used to page the list ) |
integer |
$pListHash['offset'] |
Number of records to return |
string |
$pListHash['sort_mode'] |
Name of the field to sort by ( extended by _asc or _desc for sort direction ) |
array |
$pListHash['find'] |
List of text elements to filter the results by |
integer |
$pListHash[''] |
User ID - If set, then only the objcets created by that user will be returned $pListHash['last_modified'] date - modified since $pListHash['end_date'] date - modified before |
|
&$pListHash |
|
getContentRanking [line 2426]
- getContentRanking(
array $pListHash)
|
|
Get a list of content ranked by certain criteria set in $pListHash['sort_mode']
Tags:
Parameters
array |
$pListHash |
hash of parameters ( content_type_guid will limit list to a single content type |
getContentStatus [line 3591]
Status getContentStatus(
[ $pDefault = 50], [array $pContentId = NULL])
|
|
getContentStatus will return the content status of the currently loaded content.
Tags:
Parameters
array |
$pContentId |
Content ID of the content in question |
|
$pDefault |
|
getContentStatusName [line 3652]
The getContentStatusName(
[array $pStatusId = NULL])
|
|
getContentStatusName
Tags:
Parameters
array |
$pStatusId |
Status ID if not available in $this->mInfo['content_status_id'] |
getDisplayUrl [line 2184]
Returns Request URL to a piece of content
getEditUrl [line 2197]
void getEditUrl(
[number $pContentId = NULL], [array $pMixed = NULL])
|
|
Returns the create/edit url to a piece of content
Parameters
number |
$pContentId |
a valid content id |
array |
$pMixed |
a hash of params to add to the url |
getFilter [line 3332]
TRUE getFilter(
array $pContentTypeGuid, &$pSql, &$pBindVars, [array $pHash = null], array $pSql, array $pBindVars)
|
|
getFilter
Tags:
Parameters
array |
$pContentTypeGuid |
|
array |
$pSql |
|
array |
$pBindVars |
|
array |
$pHash |
|
|
&$pSql |
|
|
&$pBindVars |
|
getListingPreview [line 3726]
the getListingPreview(
$pMixed)
|
|
getListingPreview -- Returns a string with a preview of the content.
Tags:
Parameters
getNumberOfPages [line 3038]
string getNumberOfPages(
string &$data)
|
|
Special parsing for multipage articles Temporarily remove ... sections to protect from broke pre tags and leave well known pre behaviour (i.e. type all text inside AS IS w/o any interpretation)
Tags:
Parameters
string |
&$data |
Data to process |
getPage [line 3069]
string getPage(
string &$data, integer $i)
|
|
Special parsing for a particular page of a multipage article Temporary remove <PRE></PRE> secions to protect from broke <PRE> tags and leave well known <PRE> behaviour (i.e. type all text inside AS IS w/o any interpretation)
Tags:
Parameters
string |
&$data |
Data to process |
integer |
$i |
Number of page to extract |
getPreview [line 3738]
getPreview -- Returns a string with a preview of the content. Default implementation runs getRenderFile() with $liberty_preview set in the context and gBitSystem set to only render the content.
Tags:
getPreviewUrl [line 2231]
string getPreviewUrl(
[string $pContentId = NULL], [array $pMixed = NULL])
|
|
Not-so-pure virtual function that returns Request_URI to the preview.
Tags:
Parameters
string |
$pContentId |
Text for DisplayLink function |
array |
$pMixed |
different possibilities depending on derived class |
getSortModeFields [line 2312]
the getSortModeFields(
[pParamHash 0 = hash of parameters for any getList() function])
|
|
Validate inbound sort_mode parameter
Tags:
Parameters
pParamHash |
0 |
hash of parameters for any getList() function |
getStructures [line 2829]
Get a list of all structures this content is a member of
getThumbnailFile [line 2291]
void getThumbnailFile(
[ $pSize = 'small'])
|
|
Parameters
getThumbnailFileFromHash [line 2297]
void getThumbnailFileFromHash(
&$pMixed, [ $pSize = 'small'])
|
|
Parameters
getThumbnailUri [line 2275]
void getThumbnailUri(
[ $pSize = 'small'])
|
|
Parameters
getThumbnailUriFromHash [line 2281]
void getThumbnailUriFromHash(
&$pMixed, [ $pSize = 'small'])
|
|
Parameters
getThumbnailUrl [line 2254]
string getThumbnailUrl(
[string $pSize = 'small'], [int $pSecondaryId = NULL], [int $pDefault = TRUE])
|
|
Not-so-pure virtual function that returns Request_URI to a content's thumbnail representation. It is up to the derived content what exactly this means If not implemented in the content's class, this class will return NULL, which is an acceptable case meaning no thumbnail is available. FisheyeGallery, BitUser might return pictures, BitArticle might return the article topic image, etc.
Tags:
Parameters
string |
$pSize |
Size of the url to return - should be a standard thumbnail size such as 'icon', 'avatar', 'small', 'medium', or 'large' |
int |
$pSecondaryId |
optional contentId tp generate the thumbnail, if empty, the mContentId variable should be used |
int |
$pDefault |
optional secondary id, such as user_id or products_id, etc |
getThumbnailUrlFromHash [line 2261]
void getThumbnailUrlFromHash(
&$pMixed, [ $pSize = 'small'], [ $pSecondaryId = NULL], [ $pDefault = TRUE])
|
|
Parameters
|
&$pMixed |
|
|
$pSize |
|
|
$pSecondaryId |
|
|
$pDefault |
|
isCached [line 3173]
absolute isCached(
[array $pContentId = NULL])
|
|
Check if content has a cache file
Tags:
Parameters
array |
$pContentId |
Content id of cached item |
isCommentable [line 3712]
isCommentable will check allow_comments in mInfo or if it's set as a preference.
Tags:
isDeleted [line 3610]
isDeleted status test
Tags:
isHidden [line 3640]
isHidden status test
Tags:
isInStructure [line 3130]
integer isInStructure(
[integer $pStructureId = NULL])
|
|
Check the number of structures that the content object is being used in
Tags:
Parameters
integer |
$pStructureId |
Structure ID ( If NULL or not supplied check all structures ) |
isPrivate [line 3620]
isPrivate status test
Tags:
isProtected [line 3630]
isProtected status test
Tags:
parseData [line 2926]
string parseData(
[pMixed $pMixed = NULL], [string $pFormatGuid = NULL], int 2, boolean 3, string 4, string 5)
|
|
Process the raw content blob using the speified content GUID processor This is the "object like" method. It should be more object like, but for now, we'll just point to the old lib style "parse_data" - XOXO spiderr
Tags:
Parameters
int |
2 |
pMixed['content_id'] content_id or the item to be parsed - required for caching and optimal parser performance |
boolean |
3 |
pMixed['no_cache'] disable caching |
string |
4 |
pMixed['cache_extension'] cache to a separate file. useful for truncated displays of parsed content such as article front page |
string |
5 |
pFormatGuid processor to use |
pMixed |
$pMixed |
can be a string or a hash - if a string is given, it will be parsed without the use of cache |
string |
$pFormatGuid |
pMixed['data'] string to be parsed |
parseSplit [line 2858]
void parseSplit(
$pParseHash, [ $pLength = 500], [ $pForceLength = FALSE])
|
|
Parameters
|
$pParseHash |
|
|
$pLength |
|
|
$pForceLength |
|
prepGetList [line 2353]
the prepGetList(
pParamHash &$pListHash)
|
|
Liberty override to stuff content_status_id and prepares parameters with default values for any getList function
Tags:
Parameters
pParamHash |
&$pListHash |
hash of parameters for any getList() function |
readCacheFile [line 3229]
the readCacheFile(
the $pCacheFile)
|
|
Attempts to read from the specified cache file checking if the cached data has expired.
Tags:
Parameters
the |
$pCacheFile |
name of the cache file from getCacheFile() |
setIndexData [line 3150]
void setIndexData(
[ $pContentId = 0])
|
|
This is a generic liberty content function to gather indexable words. Override this function in your BitPackage.php file if you need to add more indexable words from files other than tiki_content and users_users.
Parameters
setStructure [line 3118]
void setStructure(
integer $pStructureId)
|
|
Set content related mStructureId
Parameters
integer |
$pStructureId |
Structure ID |
storeActionLog [line 3370]
TRUE storeActionLog(
[array $pParamHash = NULL])
|
|
storeActionLog Note: use $gBitSystem throughout that this function can be called statically if needed
Tags:
Parameters
storeActionLogFromHash [line 3355]
TRUE storeActionLogFromHash(
[array $pParamHash = NULL])
|
|
storeActionLog Note: use $gBitSystem throughout that this function can be called statically if needed
Tags:
Parameters
storeData [line 3676]
bool storeData(
$pData, $pType)
|
|
Store Data into liberty_content_data
Tags:
Parameters
storeStatus [line 3700]
void storeStatus(
array $pContentStatusId)
|
|
storeStatus store liberty contenet status
Tags:
Parameters
verifyActionLog [line 3406]
TRUE verifyActionLog(
&$pParamHash, array $pParamHash)
|
|
verify the data in the action log is ready for storing First checks $pParamHash['action_log'] for information and then the content_store stuff Note: use $gBitSystem throughout that this function can be called statically if needed
Tags:
Parameters
array |
$pParamHash |
|
|
&$pParamHash |
|
writeCacheFile [line 3249]
void writeCacheFile(
the $pCacheFile, the $pData)
|
|
Unconditionally writes data to the cache file. Does not check for error assuming if write failed that the read will as well.
Parameters
the |
$pCacheFile |
name of the cache file from getCacheFile() to write |
the |
$pData |
contents to write to the file |
|
|