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

Class: LibertyContent

Source Location: /liberty/LibertyContent.php

Class Overview

BitBase
   |
   --LibertyBase
      |
      --LibertyContent

Virtual base class (as much as one can have such things in PHP) for all derived tikiwiki classes that require database access.


Implements interfaces:

Variables

Methods


Child classes:

BitNewsletter
Calendar
LibertyAttachable
LibertyAttachable class
LibertyMime
LibertyMime class

Inherited Constants

Inherited Variables

Inherited Methods

Class: LibertyBase

LibertyBase::__construct()
Constructor building on BitBase object
LibertyBase::getLibertyClass()
given a content_type_guid this will return an object of the proper type
LibertyBase::getLibertyObject()
Given a content_id, this will return and object of the proper type
LibertyBase::getNewObject()
Simple method to create a given class with a specified content_id. The purpose of a method is to allow for derived classes to override as necessary.
LibertyBase::getNewObjectById()
Simple method to create a given class with a specified primary_id. The purpose of a method is to allow for derived classes to override as necessary.

Class: BitBase

BitBase::BitBase()
During initialisation, we assign a name which is used by the class.
BitBase::__construct()
BitBase::clearFromCache()
BitBase::expunge()
Delete content object and all related records
BitBase::load()
BitBase::__destruct()

Class Details

[line 52]
Virtual base class (as much as one can have such things in PHP) for all derived tikiwiki classes that require database access.



[ Top ]


Class Variables

$mAdminContentPerm =

[line 97]


Type:   mixed


[ Top ]

$mContentId =

[line 57]

Content Id if an object has been loaded



Tags:

public:  

Type:   mixed


[ Top ]

$mContentTypeGuid =

[line 69]

Content type GUID for this LibertyContent object



Tags:

public:  

Type:   mixed


[ Top ]

$mCreateContentPerm =

[line 95]


Type:   mixed


[ Top ]

$mExpungeContentPerm =

[line 96]


Type:   mixed


[ Top ]

$mPrefs =  NULL

[line 87]

Preferences hash specific to this LibertyContent object - accessed via getPreference/storePreference



Tags:

private:  

Type:   mixed


[ Top ]

$mStructureId =

[line 63]

If this content is being viewed within a structure



Tags:

public:  

Type:   mixed


[ Top ]

$mType =

[line 75]

Content type hash for this LibertyContent object



Tags:

public:  

Type:   mixed


[ Top ]

$mUpdateContentPerm =

[line 94]


Type:   mixed


[ Top ]

$mUserContentPerms =

[line 81]

Permissions hash specific to the user accessing this LibertyContetn object



Tags:

public:  

Type:   mixed


[ Top ]

$mViewContentPerm =

[line 93]

Control permission specific to this LibertyContent type



Tags:

private:  

Type:   mixed


[ Top ]



Class Methods


static method getContentWithPermissionsList [line 1359]

static TRUE getContentWithPermissionsList( )

Get a list of content with permissions



Tags:

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


[ Top ]

static method getDisplayUriFromHash [line 2164]

static string getDisplayUriFromHash( string &$pParamHash, array 1)

Not-so-pure virtual function that returns fully qualified URI to a piece of content



Tags:

return:  Formated URL address to display the page.
access:  public


Parameters:

array   1   different possibilities depending on derived class
string   &$pParamHash   Text for DisplayLink function

[ Top ]

static method getDisplayUrlFromHash [line 2173]

static string getDisplayUrlFromHash( &$pParamHash, array $pMixed)

Not-so-pure virtual function that returns Request_URI to a piece of content



Tags:

return:  Formated URL address to display the page.
access:  public


Overridden in child classes as:

BitNewsletter::getDisplayUrlFromHash()
Generate a valid url for the Newsletter
BitArticle::getDisplayUrlFromHash()
Generates the URL to the article
BitBlog::getDisplayUrlFromHash()
BitBlogPost::getDisplayUrlFromHash()
Generate a valid url for the Blog
BitNewsletterEdition::getDisplayUrlFromHash()
Generate a valid url for the Newsletter Edition
BitUser::getDisplayUrlFromHash()
getDisplayUrl
BitEvents::getDisplayUrlFromHash()
Generates the URL to the article
BitPage::getDisplayUrlFromHash()
Generates the URL to this wiki page
BitBoardTopic::getDisplayUrlFromHash()
Generates the URL to the bitboard page
BitBoard::getDisplayUrlFromHash()
Generates the URL to the bitboard page
LibertyComment::getDisplayUrlFromHash()
BitBoardPost::getDisplayUrlFromHash()
Generates the URL to the bitboard page
FisheyeImage::getDisplayUrlFromHash()
Function that returns link to display a piece of content
FisheyeGallery::getDisplayUrlFromHash()
Function that returns link to display a piece of content

Parameters:

array   $pMixed   a hash of params to add to the url
   &$pParamHash  

[ Top ]

static method getTitleFromHash [line 1936]

static string getTitleFromHash( array &$pHash, [ $pDefault = TRUE])

Create the generic title for a content item

This will normally be overwriten by extended classes to provide an appropriate title string




Tags:

return:  Descriptive title for the page
access:  public


Overridden in child classes as:

BitBlogPost::getTitleFromHash()
getTitle
LibertyComment::getTitleFromHash()
Fill title with date if available
FisheyeImage::getTitleFromHash()

Parameters:

array   &$pHash   pHash type hash of data to be used to provide base data
   $pDefault  

[ Top ]

static method isCacheableClass [line 124]

static void isCacheableClass( )



Tags:

access:  public


Overridden in child classes as:

BitUser::isCacheableClass()

[ Top ]

constructor __construct [line 102]

LibertyContent __construct( )

Construct an empty LibertyBase object with a blank permissions array



Overridden in child classes as:

BitNewsletter::__construct()
BitNewsletterEdition::__construct()
FisheyeGallery::__construct()

Overrides LibertyBase::__construct() (Constructor building on BitBase object)

[ Top ]

method addHit [line 1872]

bool addHit( )

Increment the content item hit flag by 1



Tags:

return:  true ( will not currently report a failure )


[ Top ]

method checkContentPermission [line 1271]

bool checkContentPermission( integer $pParamHash, integer 1, string 2, string 3)

Check is a user has permission to access the object



Tags:

return:  true if access is allowed


Parameters:

integer   1   Content Itentifier
string   2   Content Type GUID
string   3   Name of the permission
integer   $pParamHash   User Identifier

[ Top ]

method convertQueryHash [line 1045]

Results convertQueryHash( &$pQueryHash, [ $pCountQuery = FALSE])

Convert a built up pQueryHash into a single query string and set of bind variables.

A pQueryHash is an array with required keys select and from, and optional keys join, where and order. Each key other than order should be an array with an 'sql' key which points to an array with statements. Statements should not include the keywords to start them excluding join statements nor should they include trailing delimeters such as commas as the conversion adds these where required. All where statments are automatically ANDed together. Each key other than order can optionally have a 'vars' key which points to an array with bind variables. The order key can either be an array or a single value. convertSortmode is automatically called on each order statement and built into the ORDER BY clause with delimeters where required.




Tags:

return:  come back in $pQueryHash['query'] $pQueryHash['bind_vars'] and $pQueryHash['query_count'] if requested
TODO:  this function still contains legacy code.


Parameters:

   &$pQueryHash  
   $pCountQuery  

[ Top ]

method exportHash [line 783]

export exportHash( )

Create an export hash from the data



Tags:

return:  data
access:  public


Overridden in child classes as:

BitUser::exportHash()
Create an export hash from the data
FisheyeImage::exportHash()
FisheyeGallery::exportHash()

[ Top ]

method exportList [line 761]

void exportList( $pList)



Parameters:

   $pList  

[ Top ]

method expunge [line 439]

TRUE expunge( )

Delete content object and all related records



Tags:

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


Overridden in child classes as:

BitNewsletter::expunge()
BitArticle::expunge()
Removes currently loaded article
BitBlog::expunge()
BitBlogPost::expunge()
Remove complete blog post set and any comments
BitNewsletterEdition::expunge()
BitUser::expunge()
expunge removes user and associated private data
BitEvents::expunge()
This function removes a events entry
BitPage::expunge()
Remove page from database
BitBoard::expunge()
This function removes a bitboard entry
LibertyComment::expunge()
BitBoardPost::expunge()
This function removes a bitboard entry
FisheyeImage::expunge()
FisheyeGallery::expunge()

Overrides BitBase::expunge() (Delete content object and all related records)

[ Top ]

method expungeComments [line 420]

TRUE expungeComments( )

Delete comment entries relating to the content object



Tags:

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


[ Top ]

method expungeContentPermissions [line 1392]

TRUE expungeContentPermissions( )

Expunge Content Permissions



Tags:

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


[ Top ]

method expungeVersion [line 734]

TRUE expungeVersion( [pVersion $pVersion = NULL], [pComment $pComment = ''])

Removes a specific version of a page



Tags:

return:  if completed successfully


Parameters:

pVersion   $pVersion   Version number to roll back to
pComment   $pComment   Comment text to be added to the action log

[ Top ]

method generateDescription [line 1966]

array generateDescription( )

Attempt to create a brief description of this object, most useful for <meta name="description" />



Tags:

return:  list of aliases


[ Top ]

method generateKeywords [line 1986]

array generateKeywords( )

Attempt to create a collection of relevant words about this object, most useful for <meta name="keywords" />



Tags:

return:  list of aliases


[ Top ]

method getAliases [line 1998]

array getAliases( )

Get array of aliases for this content object



Tags:

return:  list of aliases


[ Top ]

method getCacheKey [line 134]

void getCacheKey( )



Tags:

access:  public


Overridden in child classes as:

BitUser::getCacheKey()

[ Top ]

method getContentDescription [line 2073]

string getContentDescription( )

Return content type description for this content object.



Tags:

return:  content_type_guid description for the object


[ Top ]

method getContentId [line 2060]

string getContentId( )

Access a content item content_id



Tags:

return:  content_type_guid for the object


[ Top ]

method getContentListPermissionsSql [line 1243]

TRUE getContentListPermissionsSql( array $pPermName, &$pSelectSql, &$pJoinSql, &$pWhereSql, &$pBindVars, array $pSelectSql, array $pJoinSql, array $pWhereSql, array $pBindVars)

getContentListPermissionsSql



Tags:

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


Parameters:

array   $pPermName  
array   $pSelectSql  
array   $pJoinSql  
array   $pWhereSql  
array   $pBindVars  
   &$pSelectSql  
   &$pJoinSql  
   &$pWhereSql  
   &$pBindVars  

[ Top ]

method getContentPermissionsList [line 1325]

void getContentPermissionsList( )

Load all permissions assigned to a given object.

This function is mainly used to fetch a list of custom permissions of a given content item.




Tags:

access:  public


[ Top ]

method getContentPermissionsSql [line 1214]

TRUE getContentPermissionsSql( array $pPermName, &$pSelectSql, &$pJoinSql, &$pWhereSql, &$pBindVars, array $pSelectSql, array $pJoinSql, array $pWhereSql, array $pBindVars)

getContentPermissionsSql



Tags:

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


Parameters:

array   $pPermName  
array   $pSelectSql  
array   $pJoinSql  
array   $pWhereSql  
array   $pBindVars  
   &$pSelectSql  
   &$pJoinSql  
   &$pWhereSql  
   &$pBindVars  

[ Top ]

method getContentType [line 2011]

string getContentType( )

Access a content item type GUID



Tags:

return:  content_type_guid for the content


[ Top ]

method getContentTypeDescription [line 2043]

TRUE getContentTypeDescription( [array $pContentType = NULL])

getContentTypeDescription



Tags:

return:  on success, FALSE on failure
access:  public


Parameters:

array   $pContentType  

[ Top ]

method getContentTypeName [line 2030]

string getContentTypeName( [boolean $pPlural = FALSE])

Get the display name of the content type



Tags:

return:  the display name of the content type


Parameters:

boolean   $pPlural   true will return the plural form of the content type display name

[ Top ]

method getDisplayLink [line 2112]

string getDisplayLink( [string $pLinkText = NULL], [array $pMixed = NULL], [string $pAnchor = NULL])

Pure virtual function that returns link to display a piece of content



Tags:

return:  Formated html the link to display the page.


Overridden in child classes as:

BitBlogPost::getDisplayLink()
Generate a valid display link for the Blog
BitUser::getDisplayLink()
getDisplayLink
LibertyComment::getDisplayLink()
FisheyeImage::getDisplayLink()
Generate a valid display link for the Blog

Parameters:

string   $pLinkText   Text for the link unless overriden by object title
array   $pMixed   different possibilities depending on derived class
string   $pAnchor   anchor string e.g.: #comment_123

[ Top ]

method getDisplayUri [line 2152]

string getDisplayUri( string 0, array 1)

Not-so-pure virtual function that returns fully qualified URI to a piece of content



Tags:

return:  Formated URL address to display the page.
access:  public


Parameters:

string   0   Text for DisplayLink function
array   1   different possibilities depending on derived class

[ Top ]

method getHistory [line 585]

array getHistory( [array $pVersion = NULL], [array $pUserId = NULL], [int $pOffset = 0], [array $max_records = -1])

Get complete set of historical data in order to display a given wiki page version



Tags:

return:  of mInfo data
access:  public


Parameters:

array   $pVersion  
array   $pUserId  
int   $pOffset  
array   $max_records  

[ Top ]

method getHistoryCount [line 562]

count getHistoryCount( )

Get count of the number of historic records for the page



Tags:

access:  public


[ Top ]

method getHits [line 1916]

bool getHits( )

Get Hits and Last Hit



Tags:

return:  true ( will not currently report a failure )


[ Top ]

method getLibertySql [line 933]

void getLibertySql( $pJoinColumn, &$pQueryHash, [ $pJoins = NULL], [ $pServiceFunction = NULL], [ $pObject = NULL], [ $pParamHash = NULL])

Default liberty sql for joining a content object table to liberty.

We are proposing a new way of building queries here where we build up everything in a hash with implicit AND over all where clauses and then do an array_merge and concatenation in a single function at the end. See convertQueryHash for details.

This is an example current, and would be invoked in getList $queryHash = array('summary', 'users', 'hits', 'avatar', 'primary'), array('select' => array('sql' => $selectSql), 'join' => array('sql' => $joinSql), 'where' => array('sql' => $whereSql, 'var' => $bindVars )); $this->getLibertySql( 'bp.`content_id`', $queryHash);




Parameters:

   $pJoinColumn  
   &$pQueryHash  
   $pJoins  
   $pServiceFunction  
   $pObject  
   $pParamHash  

[ Top ]

method getPreference [line 1777]

void getPreference( string $pPrefName, [string $pPrefDefault = NULL], [int $pContentId = NULL])

Returns the content preferences value for the passed in key.



Parameters:

string   $pPrefName   Hash key for the mPrefs value
string   $pPrefDefault   Default value to return if the preference is empty
int   $pContentId   Optional content_id for arbitrary content preference

[ Top ]

method getRenderFile [line 2100]

the getRenderFile( )

Pure virtual function that returns the include file that should render a page of content of this type



Tags:

return:  fully specified path to file to be included


Overridden in child classes as:

BitArticle::getRenderFile()
Returns include file that will setup vars for display
BitBlogPost::getRenderFile()
Returns include file that will
BitUser::getRenderFile()
getRenderFile Returns include file that will
BitEvents::getRenderFile()
BitPage::getRenderFile()
Returns include file that will
FisheyeImage::getRenderFile()
Returns include file that will setup vars for display
FisheyeGallery::getRenderFile()
Returns include file that will setup the object for rendering

[ Top ]

method getServicesSql [line 1155]

void getServicesSql( $pServiceFunction, &$pSelectSql, &$pJoinSql, &$pWhereSql, &$pBindVars, [ $pObject = NULL], [ &$pParamHash = NULL])

Set up SQL strings for services used by the object

TODO: set this function deprecated and eventually nuke it




Parameters:

   $pServiceFunction  
   &$pSelectSql  
   &$pJoinSql  
   &$pWhereSql  
   &$pBindVars  
   $pObject  
   &$pParamHash  

[ Top ]

method getServicesSql2 [line 986]

TRUE getServicesSql2( array $pServiceFunction, &$pQueryHash, [array $pObject = NULL], [array $pParamHash = NULL], array $pQueryHash)

getServicesSql2



Tags:

return:  on success, FALSE on failure - mErrors will contain reason for failure
TODO:  this function still contains legacy code.
TODO:  rename this function to getServicesSql has been weened out
access:  public


Parameters:

array   $pServiceFunction  
array   $pQueryHash  
array   $pObject  
array   $pParamHash  
   &$pQueryHash  

[ Top ]

method getTitle [line 1953]

string getTitle( )

Create the generic title for a content item

This will normally be overwriten by extended classes to provide an appropriate title string




Tags:

return:  Descriptive title for the page


Overridden in child classes as:

FisheyeImage::getTitle()

[ Top ]

method getUserPermissions [line 1638]

Array getUserPermissions( )

Get specific permissions for the specified user for this content



Tags:

return:  of all permissions for the current user joined with perms for the current content. This should handle cases where non-default permissions is assigned, default permission is removed, and duplicate default permissions where one team's perm is revoked, but another is still permitted. If the permission is revoked, is_revoked will be set to 'y'


[ Top ]

method getViewTemplate [line 2085]

void getViewTemplate( string $pAction)

returns a path to the template type requested this is intended for package override. while not a requirement please use a naming convention of center_<action>_<content_type_guid>.tpl for new tpls



Overridden in child classes as:

BitBlog::getViewTemplate()
BitBlogPost::getViewTemplate()
BitPage::getViewTemplate()
Returns the center template for the view selected

Parameters:

string   $pAction   the type of template. common types are view and list

[ Top ]

method hasAdminPermission [line 1460]

bool hasAdminPermission( [ $pVerifyAccessControl = TRUE])

Determine if current user has the ability to administer this type of content



Tags:

return:  True if user has this type of content administration permission


Parameters:

   $pVerifyAccessControl  

[ Top ]

method hasCreatePermission [line 1556]

bool hasCreatePermission( [ $pVerifyAccessControl = TRUE])

Determine if current user has the ability to craete this type of content



Tags:

return:  True if user has this type of content administration permission


Parameters:

   $pVerifyAccessControl  

[ Top ]

method hasEditPermission [line 1520]

bool hasEditPermission( [ $pVerifyAccessControl = TRUE], [ $pCheckGlobalPerm = TRUE])

Deprecated, use hasUpdatePermission



Tags:

return:  True if user has this type of content administration permission


Parameters:

   $pVerifyAccessControl  
   $pCheckGlobalPerm  

[ Top ]

method hasExpungePermission [line 1486]

bool hasExpungePermission( [ $pVerifyAccessControl = TRUE])

Determine if current user has the ability to delete/expunge this type of content



Tags:

return:  True if user has this type of content expunge permission


Parameters:

   $pVerifyAccessControl  

[ Top ]

method hasPostCommentsPermission [line 1608]

bool hasPostCommentsPermission( [ $pVerifyAccessControl = TRUE])

Determine if current user has the ability to post comments to this type of content



Tags:

return:  True if user has this type of content administration permission


Parameters:

   $pVerifyAccessControl  

[ Top ]

method hasService [line 887]

void hasService( $pServiceGuid)

check if a service is active for this content type

requires package LCConfig provisional method until LCConfig package is integrated into the core




Parameters:

   $pServiceGuid  

[ Top ]

method hasUpdatePermission [line 1511]

bool hasUpdatePermission( [ $pVerifyAccessControl = TRUE])

Determine if current user has the ability to edit this type of content



Tags:

return:  True if user has this type of content administration permission


Parameters:

   $pVerifyAccessControl  

[ Top ]

method hasUserPermission [line 1425]

bool hasUserPermission( string $pPermName, [string $pVerifyAccessControl = TRUE], string 2)

Function that determines if this content specified permission for the current gBitUser.

Assigned content perms override the indvidual global perms, so the result is the union of the global permission set + overridden individual content perms




Tags:

return:  true if user has permission to access file


Parameters:

string   2   return default user permission setting when no content perms are set
string   $pPermName   Name of the permission to check
string   $pVerifyAccessControl   Check access control service if available

[ Top ]

method hasUserPermissions [line 1195]

Number hasUserPermissions( )

Check to see if the loaded content has individually assigned permissions



Tags:

return:  of custom assigned permissions set for the loaded content item
access:  public


[ Top ]

method hasViewPermission [line 1582]

bool hasViewPermission( [ $pVerifyAccessControl = TRUE])

Determine if current user has the ability to view this type of content Note that this will always return TRUE if you haven't set the mViewContentPerm in your class



Tags:

return:  True if user has this type of content administration permission


Parameters:

   $pVerifyAccessControl  

[ Top ]

method invokeServices [line 866]

void invokeServices( $pServiceFunction, [ &$pFunctionParam = NULL])

Set up access to services used by the object



Parameters:

   $pServiceFunction  
   &$pFunctionParam  

[ Top ]

method isAdminable [line 827]

void isAdminable( [ $pContentId = NULL])

Check permissions to establish if user has permission to admin the object

That would include permission to delete an object or change it's permissions Should be provided by the decendent package




Parameters:

   $pContentId  

[ Top ]

method isCacheableObject [line 130]

void isCacheableObject( )



Tags:

access:  public


Overridden in child classes as:

BitUser::isCacheableObject()
Determines if a user object is cacheable. Out of paranoia, admin's are never cached.

[ Top ]

method isContentType [line 849]

void isContentType( $pContentGuid)

Check if content matches content type GUID - must also be a valid content object, it will not work for generic content class



Parameters:

   $pContentGuid  

[ Top ]

method isEditable [line 818]

void isEditable( [ $pContentId = NULL])

Check permissions to establish if user has permission to edit the object

Should be provided by the decendent package




Overridden in child classes as:

FisheyeBase::isEditable()

Parameters:

   $pContentId  

[ Top ]

method isExcludedPermission [line 1756]

TRUE isExcludedPermission( array $pTeamId, array $pPermName)

Check to see if this permission is already in the global permissions table.



Tags:

return:  if present, FALSE if not
access:  public


Parameters:

array   $pTeamId  
array   $pPermName  

[ Top ]

method isOwner [line 836]

TRUE isOwner( [$pParamHash $pParamHash = NULL])

Check user_id to establish if the object that has been loaded was created by the current user



Tags:

return:  if user owns the content


Parameters:

$pParamHash   $pParamHash   optionally pass in the hash to check against

[ Top ]

method isServiceRequired [line 910]

void isServiceRequired( $pServiceGuid)

check if a service is required for this content type

requires package LCConfig provisional method until LCConfig package is integrated into the core




Parameters:

   $pServiceGuid  

[ Top ]

method isValid [line 802]

void isValid( )

Check mContentId to establish if the object has been loaded with a valid record



Overridden in child classes as:

BitNewsletter::isValid()
BitArticle::isValid()
Check if there is an article loaded
BitBlog::isValid()
Check if there is an article loaded
BitBlogPost::isValid()
Check that the class has a valid blog loaded
BitNewsletterEdition::isValid()
BitUser::isValid()
isValid
BitEvents::isValid()
Make sure events is loaded and valid
BitPage::isValid()
BitBoard::isValid()
Make sure bitboard is loaded and valid
FisheyeImage::isValid()
FisheyeGallery::isValid()

[ Top ]

method isViewable [line 810]

void isViewable( [ $pContentId = NULL])

Check permissions to establish if user has permission to view the object

Should be provided by the decendent package




Parameters:

   $pContentId  

[ Top ]

method load [line 146]

void load( [ $pContentId = NULL], [ $pPluginParams = NULL])

load Assume a derived class has joined on the liberty_content table, and loaded it's columns already.



Tags:

access:  public


Overridden in child classes as:

BitNewsletter::load()
LibertyAttachable::load()
TODO: This code is old and is not used by any package in the bitweaver CVS anymore.
LibertyMime::load()
load the attachments for a given content id and then stuff them in mStorage
BitArticle::load()
Load the data from the database
BitBlog::load()
BitBlogPost::load()
Load a Blog Post section
BitNewsletterEdition::load()
BitUser::load()
load - loads all settings & preferences for this user
BitEvents::load()
Load the data from the database
BitPage::load()
load
BitBoardTopic::load()
Load the data from the database
BitBoard::load()
Load the data from the database
FisheyeImage::load()
FisheyeGallery::load()

Overrides BitBase::load() (parent method not documented)

Parameters:

   $pContentId  
   $pPluginParams  

[ Top ]

method loadPreferences [line 1808]

array loadPreferences( [numeric $pContentId = NULL])

loadPreferences of the currently loaded object or pass in to get preferences of a specific content_id



Tags:

return:  of preferences if $pContentId is set or pass preferences on to $this->mPrefs
access:  public


Parameters:

numeric   $pContentId   content_id of the item we want the prefs from (optional)

[ Top ]

method registerContentType [line 1861]

void registerContentType( string $pContentGuid, array $pTypeParams)

Register the content type for reference



Parameters:

string   $pContentGuid   Content Type GUID
array   $pTypeParams   Array of content type data Populates the mType array with the following entries string content_type_guid string

[ Top ]

method removeLastVersion [line 667]

void removeLastVersion( [string $pComment = ''])

Removes last version of the page (from pages) if theres some version in the liberty_content_history then the last version becomes the actual version



Tags:

access:  public


Parameters:

string   $pComment  

[ Top ]

method removePermission [line 1731]

bool removePermission( integer $pTeamId, string $pPermName, [ $pContentId = NULL])

Remove a permission to access the content



Tags:

return:  true ( will not currently report a failure )


Parameters:

integer   $pTeamId   Group Identifier
string   $pPermName   Name of the permission
   $pContentId  

[ Top ]

method rollbackVersion [line 694]

TRUE rollbackVersion( pVersion $pVersion, [pComment $pComment = ''])

Roll back to a specific version of a page



Tags:

return:  if completed successfully


Overridden in child classes as:

BitPage::rollbackVersion()
Roll back to a specific version of a page

Parameters:

pVersion   $pVersion   Version number to roll back to
pComment   $pComment   Comment text to be added to the action log

[ Top ]

method setHits [line 1897]

bool setHits( $pHits, [ $pLastHit = 0])

Set Hits and Last Hit



Tags:

return:  true ( will not currently report a failure )


Parameters:

   $pHits  
   $pLastHit  

[ Top ]

method setPreference [line 1824]

void setPreference( string $pPrefName, string $pPrefValue)

Set a hash value in the mPrefs hash. This does *NOT* store the value in the database. It does no checking for existing or duplicate values. the main point of this function is to limit direct accessing of the mPrefs hash. I will probably make mPrefs private one day.



Parameters:

string   $pPrefName   Hash key for the mPrefs value
string   $pPrefValue   Value for the mPrefs hash key

[ Top ]

method store [line 347]

void store( array &$pParamHash)

Create a new content object or update an existing one



Overridden in child classes as:

BitNewsletter::store()
LibertyAttachable::store()
TODO: This code is old and is not used by any package in the bitweaver CVS anymore.
LibertyMime::store()
Store a new upload
BitArticle::store()
Store article data after submission
BitBlog::store()
BitBlogPost::store()
Store a Blog Post
BitNewsletterEdition::store()
BitUser::store()
store
BitEvents::store()
Any method named Store inherently implies data will be written to the database
BitPage::store()
This is the ONLY method that should be called in order to store (create or update) a wiki page! It is very smart and will figure out what to do for you. It should be considered a black box.
BitBoardTopic::store()
This function stickies a topic
BitBoard::store()
Any method named Store inherently implies data will be written to the database
BitBoardPost::store()
This function stores a post
FisheyeImage::store()
FisheyeGallery::store()

Parameters:

array   &$pParamHash   Array of content data to be stored
See verify for details of the values required

[ Top ]

method storeAliases [line 513]

TRUE storeAliases( $pParamHash)

storeAliases will store aliases to a given content item



Tags:

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


Parameters:

   $pParamHash  

[ Top ]

method storeHistory [line 534]

TRUE storeHistory( )

storeHistory will store the previous data into the history table for reference



Tags:

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


[ Top ]

method storePermission [line 1701]

bool storePermission( integer $pTeamId, string $pPermName, [integer $pIsRevoked = FALSE], [ $pContentId = NULL])

Store a permission for the object that has been loaded in the permission database

Any old copy of the permission is deleted prior to loading the new copy




Tags:

return:  true ( will not currently report a failure )


Parameters:

integer   $pTeamId   Group Identifier
string   $pPermName   Name of the permission
integer   $pIsRevoked   Content Itentifier
   $pContentId  

[ Top ]

method storePreference [line 1835]

void storePreference( string $pPrefName, [string $pPrefValue = NULL])

Saves a preference to the liberty_content_prefs database table with the given pref name and value. If the value is NULL, the existing value will be delete and the value will not be saved. However, a zero will be stored. This will update the mPrefs hash.



Parameters:

string   $pPrefName   Hash key for the mPrefs value
string   $pPrefValue   Value for the mPrefs hash key

[ Top ]

method verify [line 181]

TRUE verify( &$pParamHash, array $pParamHash, array $pParamHash[content_id], array $pParamHash[user_id], array $pParamHash[modifier_user_id], array $pParamHash[created], array $pParamHash[last_modified], array $pParamHash[content_type_guid], array $pParamHash[format_guid], array $pParamHash[last_hit], array $pParamHash[event_time], array $pParamHash[hits], array $pParamHash[lang_code], array $pParamHash[title], array $pParamHash[ip], array $pParamHash[edit])

Verify the core class data required to update the liberty_content table entries

Verify will build an array [content_store] with all of the required values and populate it with the relevent data to create/update the liberty_content table record




Tags:

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


Overridden in child classes as:

BitNewsletter::verify()
LibertyMime::verify()
Verify content that is about to be stored
BitArticle::verify()
Make sure the data is safe to store
BitBlog::verify()
BitNewsletterEdition::verify()
BitUser::verify()
verify store hash
BitBoardTopic::verify()
BitBoardPost::verify()
This function verifies the data for a post

Parameters:

array   $pParamHash   Array of content data to be stored
array   $pParamHash[content_id]  
array   $pParamHash[user_id]  
array   $pParamHash[modifier_user_id]  
array   $pParamHash[created]  
array   $pParamHash[last_modified]  
array   $pParamHash[content_type_guid]  
array   $pParamHash[format_guid]  
array   $pParamHash[last_hit]  
array   $pParamHash[event_time]  
array   $pParamHash[hits]  
array   $pParamHash[lang_code]  
array   $pParamHash[title]  
array   $pParamHash[ip]  
array   $pParamHash[edit]  
   &$pParamHash  

[ Top ]

method verifyAccessControl [line 857]

void verifyAccessControl( )

Check permissions to establish if user has permission to access the object



[ Top ]

method verifyAdminPermission [line 1472]

TRUE verifyAdminPermission( [$pVerifyAccessControl $pVerifyAccessControl = TRUE])

This code was duplicated _EVERYWHERE_ so here is an easy template to cut that down.

It will verify if a given user has a given $permission and if not, it will display the error template and die()




Tags:

return:  if permitted, method will fatal out if not
access:  public


Parameters:

$pVerifyAccessControl   $pVerifyAccessControl   check access control service if available

[ Top ]

method verifyCreatePermission [line 1567]

bool verifyCreatePermission( [ $pVerifyAccessControl = TRUE])

Determine if current user has the ability to create this type of content Note this will always return FALSEif the content isValid



Tags:

return:  True if user has this type of content administration permission


Parameters:

   $pVerifyAccessControl  

[ Top ]

method verifyEditPermission [line 1546]

void verifyEditPermission( [ $pVerifyAccessControl = TRUE], [ $pCheckGlobalPerm = TRUE])

Deprecated, use verifyUpdatePermission



Parameters:

   $pVerifyAccessControl  
   $pCheckGlobalPerm  

[ Top ]

method verifyExpungePermission [line 1497]

TRUE verifyExpungePermission( [$pVerifyAccessControl $pVerifyAccessControl = TRUE])

It will verify if a given user has a given $permission and if not, it will display the error template and die()



Tags:

return:  if permitted, method will fatal out if not
access:  public


Parameters:

$pVerifyAccessControl   $pVerifyAccessControl   check access control service if available

[ Top ]

method verifyPostCommentsPermission [line 1619]

TRUE verifyPostCommentsPermission( [$pVerifyAccessControl $pVerifyAccessControl = TRUE])

It will verify if a given user has a given $permission and if not, it will display the error template and die()



Tags:

return:  if permitted, method will fatal out if not
access:  public


Parameters:

$pVerifyAccessControl   $pVerifyAccessControl   check access control service if available

[ Top ]

method verifyUpdatePermission [line 1533]

TRUE verifyUpdatePermission( [$pVerifyAccessControl $pVerifyAccessControl = TRUE])

This code was duplicated _EVERYWHERE_ so here is an easy template to cut that down.

It will verify if a given user has a given $permission and if not, it will display the error template and die()




Tags:

return:  if permitted, method will fatal out if not
access:  public


Parameters:

$pVerifyAccessControl   $pVerifyAccessControl   check access control service if available

[ Top ]

method verifyUserPermission [line 1407]

void verifyUserPermission( string $pPermName, [string $pFatalMessage = NULL])

Function that determines if this content specified permission for the current gBitUser, and will throw a fatal error if not.



Parameters:

string   $pPermName   Name of the permission to check
string   $pFatalMessage   Message if permission denigned

[ Top ]

method verifyViewPermission [line 1594]

TRUE verifyViewPermission( [$pVerifyAccessControl $pVerifyAccessControl = TRUE])

This code was duplicated _EVERYWHERE_ so here is an easy template to cut that down.

It will verify if a given user has a given $permission and if not, it will display the error template and die()




Tags:

return:  if permitted, method will fatal out if not
access:  public


Parameters:

$pVerifyAccessControl   $pVerifyAccessControl   check access control service if available

[ Top ]


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