liberty
[ class tree: liberty ] [ index: liberty ] [ all elements ]

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:

author:  spider <spider@steelsun.com>
filesource:  Source Code for this file


Includes:

require_once(LIBERTY_PKG_PATH.'LibertyBase.php') [line 42]
required setup






BIT_CONTENT_DEFAULT_STATUS [line 32]

BIT_CONTENT_DEFAULT_STATUS = 50

[ Top ]



BIT_CONTENT_MAX_FORMAT_GUID_LEN [line 29]

BIT_CONTENT_MAX_FORMAT_GUID_LEN = 16

[ Top ]



BIT_CONTENT_MAX_IP_LEN [line 28]

BIT_CONTENT_MAX_IP_LEN = 39

[ Top ]



BIT_CONTENT_MAX_LANGUAGE_LEN [line 27]

BIT_CONTENT_MAX_LANGUAGE_LEN = 4

[ Top ]



BIT_CONTENT_MAX_TITLE_LEN [line 25]

BIT_CONTENT_MAX_TITLE_LEN = 160
Maximum lengths for database fields


[ Top ]



LIBERTY_SPLIT_REGEX [line 44]

LIBERTY_SPLIT_REGEX = "!\.{3}split\.{3}[\t ]*\n?!"

[ Top ]




convertSortMode [line 2332]

the convertSortMode( pParamHash &$pSortMode, [ $pDefault = 'last_modified_desc'])

Validate inbound sort_mode parameter



Tags:

return:  link to display the page.


Parameters

pParamHash   &$pSortMode   hash of parameters for any getList() function
   $pDefault  
[ Top ]



decodeAjaxRequest [line 3105]

void decodeAjaxRequest( &$pParamHash)

convenience function to process a $_REQUEST array



Parameters

   &$pParamHash  
[ Top ]



expungeActionLog [line 3554]

TRUE expungeActionLog( [array $pTimeSpan = NULL])

expungeActionLog



Tags:

return:  on success, FALSE on failure - mErrors will contain reason for failure
access:  public


Parameters

array   $pTimeSpan   Anything older than this timespan will be removed
[ Top ]



expungeCache [line 3304]

TRUE expungeCache( [array $pContentId = ])

Delete liberty cache



Tags:

return:  on success, FALSE on failure
access:  public


Parameters

array   $pContentId  
[ Top ]



expungeCacheFile [line 3281]

TRUE expungeCacheFile( [array $pContentId = NULL])

Delete cache files for a given content item



Tags:

return:  on success, FALSE on failure
access:  public


Parameters

array   $pContentId  
[ Top ]



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:

return:  data
access:  public


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  
[ Top ]



getActionLogs [line 3484]

List getActionLogs( &$pListHash, array $pListHash)

Get a list of action log entries



Tags:

return:  of entries on success, FALSE on failure
access:  public


Parameters

array   $pListHash   List options
   &$pListHash  
[ Top ]



getAuthorList [line 2395]

- getAuthorList( array &$pListHash)

Get a list of users who have created entries in the content table



Tags:

return:  none the hash is updated via the reference


Parameters

array   &$pListHash   hash of parameters ( content_type_guid will limit list to a single content type
[ Top ]



getAvailableContentStatuses [line 3575]

an getAvailableContentStatuses( [ $pUserMinimum = -100], [ $pUserMaximum = 100])

getAvailableContentStatus



Tags:

return:  array of content_status_id, content_status_names the current user can use on this content. Subclases may easily override with return LibertyContent::getAvailableContentStatus(-100, 0) for example to restrict to only hidden content types.
access:  public


Parameters

   $pUserMinimum  
   $pUserMaximum  
[ Top ]



getCacheBasePath [line 3188]

absolute getCacheBasePath( )

Get the path where we store liberty cached content



Tags:

return:  path
access:  public


[ Top ]



getCacheFile [line 3266]

filename getCacheFile( [array $pContentId = NULL], [ $pCacheExtension = NULL])

Get the path to file where an individual cache item is stored



Tags:

return:  on success, FALSE on failure
access:  public


Parameters

array   $pContentId   Content id of cached item
   $pCacheExtension  
[ Top ]



getCachePath [line 3199]

path getCachePath( [array $pContentId = NULL])

Get the path to directory where an individual cache item is stored



Tags:

return:  on success, FALSE on failure
access:  public


Parameters

array   $pContentId   Content id of cached item
[ Top ]



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:

return:  An array of mInfo type arrays of content objects


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  
[ Top ]



getContentRanking [line 2426]

- getContentRanking( array $pListHash)

Get a list of content ranked by certain criteria set in $pListHash['sort_mode']



Tags:

return:  data


Parameters

array   $pListHash   hash of parameters ( content_type_guid will limit list to a single content type
[ Top ]



getContentStatus [line 3591]

Status getContentStatus( [ $pDefault = 50], [array $pContentId = NULL])

getContentStatus will return the content status of the currently loaded content.



Tags:

return:  ID
access:  public


Parameters

array   $pContentId   Content ID of the content in question
   $pDefault  
[ Top ]



getContentStatusName [line 3652]

The getContentStatusName( [array $pStatusId = NULL])

getContentStatusName



Tags:

return:  name of the content status based on the status id of the content
access:  public


Parameters

array   $pStatusId   Status ID if not available in $this->mInfo['content_status_id']
[ Top ]



getDisplayUrl [line 2184]

void getDisplayUrl( )

Returns Request URL to a piece of content



[ Top ]



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
[ Top ]



getFilter [line 3332]

TRUE getFilter( array $pContentTypeGuid, &$pSql, &$pBindVars, [array $pHash = null], array $pSql, array $pBindVars)

getFilter



Tags:

return:  on success, FALSE on failure - mErrors will contain reason for failure
todo:  - i think this function is not being used and will hopefully be removed soon - xing - Saturday Jul 07, 2007 19:54:02 CEST
  • it is called in getContentList but I think that services can do what it does now - nick - Sunday Sep 30, 2007
access:  public


Parameters

array   $pContentTypeGuid  
array   $pSql  
array   $pBindVars  
array   $pHash  
   &$pSql  
   &$pBindVars  
[ Top ]



getListingPreview [line 3726]

the getListingPreview( $pMixed)

getListingPreview -- Returns a string with a preview of the content.



Tags:

return:  preview string
access:  public


Parameters

   $pMixed  
[ Top ]



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:

return:  Extracted pages


Parameters

string   &$data   Data to process
[ Top ]



getPage [line 3069]

string getPage( string &$data, integer $i)

Special parsing for a particular page of a multipage article

Temporary remove &lt;PRE&gt;&lt;/PRE&gt; secions to protect from broke &lt;PRE&gt; tags and leave well known &lt;PRE&gt; behaviour (i.e. type all text inside AS IS w/o any interpretation)




Tags:

return:  Extracted page


Parameters

string   &$data   Data to process
integer   $i   Number of page to extract
[ Top ]



getPreview [line 3738]

the getPreview( )

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:

return:  preview string
access:  public


[ Top ]



getPreviewUrl [line 2231]

string getPreviewUrl( [string $pContentId = NULL], [array $pMixed = NULL])

Not-so-pure virtual function that returns Request_URI to the preview.



Tags:

return:  Formated URL address to display the page.


Parameters

string   $pContentId   Text for DisplayLink function
array   $pMixed   different possibilities depending on derived class
[ Top ]



getSortModeFields [line 2312]

the getSortModeFields( [pParamHash 0 = hash of parameters for any getList() function])

Validate inbound sort_mode parameter



Tags:

return:  link to display the page.


Parameters

pParamHash   0   hash of parameters for any getList() function
[ Top ]



getStructures [line 2829]

void getStructures( )

Get a list of all structures this content is a member of



[ Top ]



getThumbnailFile [line 2291]

void getThumbnailFile( [ $pSize = 'small'])



Parameters

   $pSize  
[ Top ]



getThumbnailFileFromHash [line 2297]

void getThumbnailFileFromHash( &$pMixed, [ $pSize = 'small'])



Parameters

   &$pMixed  
   $pSize  
[ Top ]



getThumbnailUri [line 2275]

void getThumbnailUri( [ $pSize = 'small'])



Parameters

   $pSize  
[ Top ]



getThumbnailUriFromHash [line 2281]

void getThumbnailUriFromHash( &$pMixed, [ $pSize = 'small'])



Parameters

   &$pMixed  
   $pSize  
[ Top ]



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:

return:  Formated URL address to display the page.


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
[ Top ]



getThumbnailUrlFromHash [line 2261]

void getThumbnailUrlFromHash( &$pMixed, [ $pSize = 'small'], [ $pSecondaryId = NULL], [ $pDefault = TRUE])



Parameters

   &$pMixed  
   $pSize  
   $pSecondaryId  
   $pDefault  
[ Top ]



isCached [line 3173]

absolute isCached( [array $pContentId = NULL])

Check if content has a cache file



Tags:

return:  path
access:  public


Parameters

array   $pContentId   Content id of cached item
[ Top ]



isCommentable [line 3712]

TRUE isCommentable( )

isCommentable will check allow_comments in mInfo or if it's set as a preference.



Tags:

return:  on success, FALSE on failure
access:  public


[ Top ]



isDeleted [line 3610]

true isDeleted( )

isDeleted status test



Tags:

return:  when the content status = -999


[ Top ]



isHidden [line 3640]

true isHidden( )

isHidden status test



Tags:

return:  when the content status = -10


[ Top ]



isInStructure [line 3130]

integer isInStructure( [integer $pStructureId = NULL])

Check the number of structures that the content object is being used in



Tags:

return:  Number of structures that this content object is located in


Parameters

integer   $pStructureId   Structure ID ( If NULL or not supplied check all structures )
[ Top ]



isPrivate [line 3620]

true isPrivate( )

isPrivate status test



Tags:

return:  when the content status = -999


[ Top ]



isProtected [line 3630]

true isProtected( )

isProtected status test



Tags:

return:  when the content status = -20 or content has protection flag set


[ Top ]



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:

return:  Formated data string


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
[ Top ]



parseSplit [line 2858]

void parseSplit( $pParseHash, [ $pLength = 500], [ $pForceLength = FALSE])



Parameters

   $pParseHash  
   $pLength  
   $pForceLength  
[ Top ]



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:

return:  link to display the page.


Parameters

pParamHash   &$pListHash   hash of parameters for any getList() function
[ Top ]



readCacheFile [line 3229]

the readCacheFile( the $pCacheFile)

Attempts to read from the specified cache file checking if the cached data has expired.



Tags:

return:  contents of the cache file or NULL


Parameters

the   $pCacheFile   name of the cache file from getCacheFile()
[ Top ]



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

   $pContentId  
[ Top ]



setStructure [line 3118]

void setStructure( integer $pStructureId)

Set content related mStructureId



Parameters

integer   $pStructureId   Structure ID
[ Top ]



storeActionLog [line 3370]

TRUE storeActionLog( [array $pParamHash = NULL])

storeActionLog Note: use $gBitSystem throughout that this function can be called statically if needed



Tags:

return:  on success, FALSE on failure - mErrors will contain reason for failure


Parameters

array   $pParamHash  
[ Top ]



storeActionLogFromHash [line 3355]

TRUE storeActionLogFromHash( [array $pParamHash = NULL])

storeActionLog Note: use $gBitSystem throughout that this function can be called statically if needed



Tags:

return:  on success, FALSE on failure - mErrors will contain reason for failure


Parameters

array   $pParamHash  
[ Top ]



storeData [line 3676]

bool storeData( $pData, $pType)

Store Data into liberty_content_data



Tags:

return:  true ( will not currently report a failure )


Parameters

   $pData  
   $pType  
[ Top ]



storeStatus [line 3700]

void storeStatus( array $pContentStatusId)

storeStatus store liberty contenet status



Tags:

access:  public


Parameters

array   $pContentStatusId  
[ Top ]



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:

return:  on success, FALSE on failure


Parameters

array   $pParamHash  
   &$pParamHash  
[ Top ]



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
[ Top ]



Documentation generated on Wed, 29 Jul 2015 13:56:48 +0000 by phpDocumentor 1.5.0-lsces