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

Class: BitPage

Source Location: d:\website\PhpDocumentor\/wiki/BitPage.php

Class Overview

BitBase
   |
   --LibertyBase
      |
      --LibertyContent
         |
         --LibertyAttachable
            |
            --BitPage

Sample class to illustrate best practices when creating a new bitweaver package that builds on core bitweaver functionality, such as the Liberty CMS engine


Variables

Methods


Child classes:

BitBook
BitBook class
WikiLib

Inherited Variables

Inherited Methods

Class: LibertyAttachable

LibertyAttachable::LibertyAttachable()
LibertyAttachable::cloneAttachment()
LibertyAttachable::detachAttachment()
detach attachment from content
LibertyAttachable::expunge()
LibertyAttachable::expungeAttachment()
expunge attachment from the database
LibertyAttachable::getAttachment()
load details of a given attachment allow an optional content_id to be passed in to ease legacy lib style objects (like blogs, articles, etc.)
LibertyAttachable::getAttachmentList()
Get a list of all available attachments
LibertyAttachable::getSiblingAttachments()
Get a list of attachments which also reference the foreign_id of the given attachment
LibertyAttachable::getStorageBranch()
getStorageBranch - get url to store files for the feature site_upload_dir. It creates a calculable hierarchy of directories
LibertyAttachable::getStoragePath()
getStoragePath - get path to store files for the feature site_upload_dir. It creates a calculable hierarchy of directories
LibertyAttachable::getStorageSubDirName()
LibertyAttachable::getStorageUrl()
LibertyAttachable::load()
fully load content and insert any attachments in $this->mStorage allow an optional content_id to be passed in to ease legacy lib style objects (like blogs, articles, etc.)
LibertyAttachable::scanForAttchmentUse()
This function will scan through liberty_content.data and will search for any occurrances of {attachemt id=<id>}
LibertyAttachable::store()
LibertyAttachable::verify()
verifyStorageFile - verify if a file exists

Class: LibertyContent

LibertyContent::LibertyContent()
Construct an empty LibertyBase object with a blank permissions array
LibertyContent::addHit()
Increment the content item hit flag by 1
LibertyContent::cacheUrl()
Cache given url If \c $data present (passed) it is just associated \c $url and \c $data.
LibertyContent::copyPermissions()
Copy current permissions to another object
LibertyContent::exportHtml()
Create an export object from the data
LibertyContent::expunge()
Delete content object and all related records
LibertyContent::expungeActionLog()
expungeActionLog
LibertyContent::expungeCacheFile()
Delete cache file for a given content item
LibertyContent::expungeComments()
Delete comment entries relating to the content object
LibertyContent::expungeVersion()
Removes a specific version of a page
LibertyContent::getActionLogs()
Get a list of action log entries
LibertyContent::getAuthorList()
Get a list of users who have created entries in the content table
LibertyContent::getCacheBasePath()
Get the path where we store liberty cached content
LibertyContent::getCacheFile()
Get the path to file where an individual cache item is stored
LibertyContent::getCachePath()
Get the path to directory where an individual cache item is stored
LibertyContent::getContentDescription()
Return content type description for this content object.
LibertyContent::getContentId()
Access a content item type GUID
LibertyContent::getContentList()
Get a list of all structures this content is a member of
LibertyContent::getContentRanking()
Get a list of content ranked by certain criteria set in $pListHash['sort_mode']
LibertyContent::getContentType()
Access a content item type GUID
LibertyContent::getContentTypeDescription()
LibertyContent::getDisplayLink()
Pure virtual function that returns link to display a piece of content
LibertyContent::getDisplayUrl()
Not-so-pure virtual function that returns Request_URI to a piece of content
LibertyContent::getFilter()
LibertyContent::getHistory()
Get complete set of historical data in order to display a given wiki page version
LibertyContent::getHistoryCount()
Get count of the number of historic records for the page
LibertyContent::getHits()
Get Hits and Last Hit
LibertyContent::getNumberOfPages()
Special parsing for multipage articles
LibertyContent::getPage()
Special parsing for a particular page of a multipage article
LibertyContent::getPreference()
Returns the content preferences value for the passed in key.
LibertyContent::getRenderFile()
Pure virtual function that returns the include file that should render a page of content of this type
LibertyContent::getServicesSql()
Set up SQL strings for services used by the object
LibertyContent::getStructures()
Get a list of all structures this content is a member of
LibertyContent::getThumbnailUrl()
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.
LibertyContent::getTitle()
Create the generic title for a content item
LibertyContent::getUserPermissions()
Get specific permissions for the specified user for this content
LibertyContent::hasAdminPermission()
Determine if current user has the ability to administer this type of content
LibertyContent::hasEditPermission()
Determine if current user has the ability to edit this type of content
LibertyContent::hasPermission()
Check is a user has permission to access the object
LibertyContent::hasUserPermission()
Function that determines if this content specified permission for the current gBitUser
LibertyContent::invokeServices()
Set up access to services used by the object
LibertyContent::isAdminable()
Check permissions to establish if user has permission to admin the object
LibertyContent::isCached()
Check if given url is currently cached locally
LibertyContent::isContentType()
Check user_id to establish if the object that has been loaded was created by the current user
LibertyContent::isEditable()
Check permissions to establish if user has permission to edit the object
LibertyContent::isHidden()
LibertyContent::isInStructure()
Check the number of structures that the content object is being used in
LibertyContent::isOwner()
Check user_id to establish if the object that has been loaded was created by the current user
LibertyContent::isPrivate()
LibertyContent::isProtected()
LibertyContent::isValid()
Check mContentId to establish if the object has been loaded with a valid record
LibertyContent::isViewable()
Check permissions to establish if user has permission to view the object
LibertyContent::load()
Assume a derived class has joined on the liberty_content table, and loaded it's columns already.
LibertyContent::loadAllObjectPermissions()
Load all permissions assigned to a given object. This is not for general consumption.
LibertyContent::loadPermissions()
Check permissions for the object that has been loaded against the permission database
LibertyContent::loadPreferences()
LibertyContent::pageExists()
Determines if a wiki page (row in wiki_pages) exists, and returns a hash of important info. If N pages exists with $pPageName, returned existsHash has a row for each unique pPageName row.
LibertyContent::parseData()
Process the raw content blob using the speified content GUID processor
LibertyContent::postGetList()
Updates results from any getList function to provide the control set
LibertyContent::registerContentType()
Copy current permissions to another object
LibertyContent::removeLastVersion()
Removes last version of the page (from pages) if theres some
LibertyContent::removePermission()
Remove a permission to access the object
LibertyContent::rollbackVersion()
Roll back to a specific version of a page
LibertyContent::setHits()
Set Hits and Last Hit
LibertyContent::setIndexData()
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.
LibertyContent::setPreference()
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.
LibertyContent::setStructure()
Set content related mStructureId
LibertyContent::store()
Create a new content object or update an existing one
LibertyContent::storeActionLog()
storeActionLog Note: use $gBitSystem throughout that this function can be called statically if needed
LibertyContent::storeHistory()
LibertyContent::storePermission()
Store a permission for the object that has been loaded in the permission database
LibertyContent::storePreference()
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.
LibertyContent::updateUserPermissions()
This function will replace all permissions for a particular package with the ones set using the content permissions
LibertyContent::verify()
Verify the core class data required to update the liberty_content table entries
LibertyContent::verifyAccessControl()
Check permissions to establish if user has permission to access the object
LibertyContent::verifyActionLog()
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

Class: LibertyBase

LibertyBase::LibertyBase()
Constructor building on BitBase object
LibertyBase::getLibertyObject()
Given a content_id, this will return and object of the proper type

Class: BitBase

BitBase::BitBase()
During initialisation, we assign a name which is used by the class.
BitBase::debug()
Switch debug level in database
BitBase::display()
This method should be THE method used to display a template. php files should not access $gBitSmarty directly.
BitBase::getDb()
Return pointer to current Database
BitBase::getField()
Returns entry from the mInfo hash if field exists
BitBase::isDatabaseValid()
Determines if there is a valide database connection
BitBase::prepGetList()
Prepares parameters with default values for any getList function
BitBase::setDatabase()
Sets database mechanism for the instance
BitBase::verifyId()
Determines if any given variable exists and is a number

Class Details

[line 32]
Sample class to illustrate best practices when creating a new bitweaver package that builds on core bitweaver functionality, such as the Liberty CMS engine



[ Top ]


Class Variables

$mPageId =

[line 33]


Type:   mixed


[ Top ]

$mPageName =

[line 34]


Type:   mixed


[ Top ]



Class Methods


constructor BitPage [line 36]

BitPage BitPage( [ $pPageId = NULL], [ $pContentId = NULL])



Parameters:

   $pPageId  
   $pContentId  

[ Top ]

method expunge [line 307]

void expunge( )

Remove page from database



Overrides LibertyAttachable::expunge() (parent method not documented)

[ Top ]

method expungeFootnote [line 388]

void expungeFootnote( $pUserId)

Delete footnote



Parameters:

   $pUserId  

[ Top ]

method findByPageName [line 51]

void findByPageName( $pPageName, [ $pUserId = NULL])



Parameters:

   $pPageName  
   $pUserId  

[ Top ]

method getBacklinks [line 492]

hash getBacklinks( )

Returns content_id's that link to this page



Tags:

return:  of content


[ Top ]

method getDisplayLink [line 457]

the getDisplayLink( pExistsHash $pPageName, $pExistsHash)

Returns HTML link to display a page if it exists, or to create if not



Tags:

return:  link to display the page.


Overrides LibertyContent::getDisplayLink() (Pure virtual function that returns link to display a piece of content)

Parameters:

pExistsHash   $pPageName   the hash that was returned by LibertyContent::pageExists
   $pExistsHash  

[ Top ]

method getDisplayUrl [line 430]

the getDisplayUrl( [pExistsHash $pPageName = NULL], [ $pMixed = NULL])

Generates the URL to this wiki page



Tags:

return:  link to display the page.


Overrides LibertyContent::getDisplayUrl() (Not-so-pure virtual function that returns Request_URI to a piece of content)

Parameters:

pExistsHash   $pPageName   the hash that was returned by LibertyContent::pageExists
   $pMixed  

[ Top ]

method getFootnote [line 398]

void getFootnote( $pUserId)

Get footnote



Parameters:

   $pUserId  

[ Top ]

method getList [line 586]

void getList( [offset $offset = 0], [max_records $max_records = -1], [sort_mode $sort_mode = 'title_desc'], [find $find = ''], [pUserId $pUserId = NULL], [pExtras $pExtras = FALSE], [pOrphansOnly $pOrphansOnly = FALSE], [ $pGetData = FALSE], [ $pFilterAuthor = ''], [ $pFilterLastEditor = ''])

Generate list of pages



Overridden in child classes as:

BitBook::getList()

Parameters:

offset   $offset   Number of the first record to list
max_records   $max_records   Number of records to list
sort_mode   $sort_mode   Order in which the records will be sorted
find   $find   Filter to be applied to the list
pUserId   $pUserId   If set additionally filter on UserId
pExtras   $pExtras   If set adds additional counts of links to and from each page This can take some time to calculate, and so should not normally be enabled
pOrphansOnly   $pOrphansOnly   If Set list only unattached pages ( ones not used in other content )
   $pGetData  
   $pFilterAuthor  
   $pFilterLastEditor  

[ Top ]

method getListLink [line 412]

the getListLink( pExistsHash $pPageHash)

Generates a link to a wiki page within lists of pages



Tags:

return:  link to display the page.


Parameters:

pExistsHash   $pPageHash   the hash that was returned by LibertyContent::pageExists

[ Top ]

method getRenderFile [line 421]

the getRenderFile( )

Returns include file that will



Tags:

return:  fully specified path to file to be included


Overrides LibertyContent::getRenderFile() (Pure virtual function that returns the include file that should render a page of content of this type)

[ Top ]

method get_cache_info [line 542]

void get_cache_info( page $page)

Get cached version of page from store



Parameters:

page   $page   ? Not used

[ Top ]

method invalidateCache [line 568]

void invalidateCache( )

Flag cached version as out of date

Cache will be updated next time the page is accessed




[ Top ]

method isLocked [line 337]

void isLocked( )



[ Top ]

method isUserPage [line 324]

void isUserPage( )



[ Top ]

method isValid [line 332]

void isValid( )



Overrides LibertyContent::isValid() (Check mContentId to establish if the object has been loaded with a valid record)

[ Top ]

method load [line 62]

void load( )



Overrides LibertyAttachable::load() (fully load content and insert any attachments in $this->mStorage allow an optional content_id to be passed in to ease legacy lib style objects (like blogs, articles, etc.))

[ Top ]

method lock [line 364]

void lock( [ $pModUserId = NULL])



Parameters:

   $pModUserId  

[ Top ]

method rollbackVersion [line 510]

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

Roll back to a specific version of a page



Tags:

return:  if completed successfully


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

Parameters:

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

[ Top ]

method setIndexData [line 766]

void setIndexData( [ $pContentId = 0])



Overrides LibertyContent::setIndexData() (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 ]

method setLock [line 348]

void setLock( $pLock, [ $pModUserId = NULL])



Parameters:

   $pLock  
   $pModUserId  

[ Top ]

method setPageCache [line 531]

void setPageCache( cache $cache)

Save cached version of page to store



Parameters:

cache   $cache   Data to be cached

[ Top ]

method store [line 131]

bool store( array &$pParamHash)

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.



Tags:

return:  TRUE on success, FALSE if store could not occur. If FALSE, $this->mErrors will have reason why
access:  public


Overrides LibertyAttachable::store() (parent method not documented)

Parameters:

array   &$pParamHash   pParams hash of values that will be used to store the page

[ Top ]

method storeFootnote [line 376]

void storeFootnote( $pUserId, $data)

Store footnote



Parameters:

   $pUserId  
   $data  

[ Top ]

method unlock [line 368]

void unlock( [ $pModUserId = NULL])



Parameters:

   $pModUserId  

[ Top ]

method update [line 783]

void update( $pHashOld, $pHashNew)



Parameters:

   $pHashOld  
   $pHashNew  

[ Top ]

method updateCache [line 554]

void updateCache( data $data)

Update cached version of page in store



Parameters:

data   $data   Data to be cached

[ Top ]


Documentation generated on Thu, 15 Feb 2007 20:31:41 +0000 by phpDocumentor 1.3.0