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

Class: LibertyMime

Source Location: /liberty/LibertyMime.php

Class Overview

BitBase
   |
   --LibertyBase
      |
      --LibertyContent
         |
         --LibertyMime

LibertyMime class


Variables

Methods


Child classes:

BitArticle
BitBlog
BitBlogPost
BitNewsletterEdition
Class that holds all information for a given user
BitEvents
BitPage
BitBoardTopic
LibertyMime class
BitBoard
LibertyComment
Handles all comments which are actual content objects
FisheyeBase

Inherited Constants

Inherited Variables

Inherited Methods

Class: LibertyContent

LibertyContent::__construct()
Construct an empty LibertyBase object with a blank permissions array
LibertyContent::addHit()
Increment the content item hit flag by 1
LibertyContent::checkContentPermission()
Check is a user has permission to access the object
LibertyContent::convertQueryHash()
Convert a built up pQueryHash into a single query string and set of bind variables.
LibertyContent::exportHash()
Create an export hash from the data
LibertyContent::exportList()
LibertyContent::expunge()
Delete content object and all related records
LibertyContent::expungeComments()
Delete comment entries relating to the content object
LibertyContent::expungeContentPermissions()
Expunge Content Permissions
LibertyContent::expungeVersion()
Removes a specific version of a page
LibertyContent::generateDescription()
Attempt to create a brief description of this object, most useful for <meta name="description" />
LibertyContent::generateKeywords()
Attempt to create a collection of relevant words about this object, most useful for <meta name="keywords" />
LibertyContent::getAliases()
Get array of aliases for this content object
LibertyContent::getCacheKey()
LibertyContent::getContentDescription()
Return content type description for this content object.
LibertyContent::getContentId()
Access a content item content_id
LibertyContent::getContentListPermissionsSql()
getContentListPermissionsSql
LibertyContent::getContentPermissionsList()
Load all permissions assigned to a given object.
LibertyContent::getContentPermissionsSql()
getContentPermissionsSql
LibertyContent::getContentType()
Access a content item type GUID
LibertyContent::getContentTypeDescription()
getContentTypeDescription
LibertyContent::getContentTypeName()
Get the display name of the content type
LibertyContent::getContentWithPermissionsList()
Get a list of content with permissions
LibertyContent::getDisplayLink()
Pure virtual function that returns link to display a piece of content
LibertyContent::getDisplayUri()
Not-so-pure virtual function that returns fully qualified URI to a piece of content
LibertyContent::getDisplayUriFromHash()
Not-so-pure virtual function that returns fully qualified URI to a piece of content
LibertyContent::getDisplayUrlFromHash()
Not-so-pure virtual function that returns Request_URI to a piece of content
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::getLibertySql()
Default liberty sql for joining a content object table to liberty.
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::getServicesSql2()
getServicesSql2
LibertyContent::getTitle()
Create the generic title for a content item
LibertyContent::getTitleFromHash()
Create the generic title for a content item
LibertyContent::getUserPermissions()
Get specific permissions for the specified user for this content
LibertyContent::getViewTemplate()
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
LibertyContent::hasAdminPermission()
Determine if current user has the ability to administer this type of content
LibertyContent::hasCreatePermission()
Determine if current user has the ability to craete this type of content
LibertyContent::hasEditPermission()
Deprecated, use hasUpdatePermission
LibertyContent::hasExpungePermission()
Determine if current user has the ability to delete/expunge this type of content
LibertyContent::hasPostCommentsPermission()
Determine if current user has the ability to post comments to this type of content
LibertyContent::hasService()
check if a service is active for this content type
LibertyContent::hasUpdatePermission()
Determine if current user has the ability to edit this type of content
LibertyContent::hasUserPermission()
Function that determines if this content specified permission for the current gBitUser.
LibertyContent::hasUserPermissions()
Check to see if the loaded content has individually assigned permissions
LibertyContent::hasViewPermission()
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
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::isCacheableClass()
LibertyContent::isCacheableObject()
LibertyContent::isContentType()
Check if content matches content type GUID - must also be a valid content object, it will not work for generic content class
LibertyContent::isEditable()
Check permissions to establish if user has permission to edit the object
LibertyContent::isExcludedPermission()
Check to see if this permission is already in the global permissions table.
LibertyContent::isOwner()
Check user_id to establish if the object that has been loaded was created by the current user
LibertyContent::isServiceRequired()
check if a service is required for this content type
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()
load Assume a derived class has joined on the liberty_content table, and loaded it's columns already.
LibertyContent::loadPreferences()
loadPreferences of the currently loaded object or pass in to get preferences of a specific content_id
LibertyContent::registerContentType()
Register the content type for reference
LibertyContent::removeLastVersion()
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
LibertyContent::removePermission()
Remove a permission to access the content
LibertyContent::rollbackVersion()
Roll back to a specific version of a page
LibertyContent::setHits()
Set Hits and Last Hit
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::store()
Create a new content object or update an existing one
LibertyContent::storeAliases()
storeAliases will store aliases to a given content item
LibertyContent::storeHistory()
storeHistory will store the previous data into the history table for reference
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::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::verifyAdminPermission()
This code was duplicated _EVERYWHERE_ so here is an easy template to cut that down.
LibertyContent::verifyCreatePermission()
Determine if current user has the ability to create this type of content Note this will always return FALSEif the content isValid
LibertyContent::verifyEditPermission()
Deprecated, use verifyUpdatePermission
LibertyContent::verifyExpungePermission()
It will verify if a given user has a given $permission and if not, it will display the error template and die()
LibertyContent::verifyPostCommentsPermission()
It will verify if a given user has a given $permission and if not, it will display the error template and die()
LibertyContent::verifyUpdatePermission()
This code was duplicated _EVERYWHERE_ so here is an easy template to cut that down.
LibertyContent::verifyUserPermission()
Function that determines if this content specified permission for the current gBitUser, and will throw a fatal error if not.
LibertyContent::verifyViewPermission()
This code was duplicated _EVERYWHERE_ so here is an easy template to cut that down.

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 26]
LibertyMime class



[ Top ]


Class Variables

$mStoragePrefs =  NULL

[line 27]


Type:   mixed


[ Top ]



Class Methods


method addDownloadHit [line 347]

adodb addDownloadHit( [numeric $pAttachmentId = NULL])

Increment the item hit flag by 1



Tags:

return:  query result or FALSE
note:  we're abusing the hits column for download count.
access:  public


Parameters:

numeric   $pAttachmentId   Attachment ID

[ Top ]

method getThumbnailUrl [line 271]

boolean getThumbnailUrl( [string $pSize = 'small'], [array $pInfoHash = NULL], [ $pSecondary = NULL], [ $pDefault = TRUE])

getThumbnailUrl will fetch the primary thumbnail for a given content. If nothing has been set, it will fetch the last thumbnail it can find.



Tags:

return:  TRUE on success, FALSE on failure - $this->mErrors will contain reason for failure
access:  public


Overridden in child classes as:

BitUser::getThumbnailUrl()
getThumbnailUrl
FisheyeImage::getThumbnailUrl()
FisheyeGallery::getThumbnailUrl()

Parameters:

string   $pSize  
array   $pInfoHash  
   $pSecondary  
   $pDefault  

[ Top ]

method load [line 36]

TRUE load( [array $pContentId = NULL], [ $pPluginParams = NULL])

load the attachments for a given content id and then stuff them in mStorage



Tags:

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


Overridden in child classes as:

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 LibertyContent::load() (load Assume a derived class has joined on the liberty_content table, and loaded it's columns already.)

Parameters:

array   $pContentId  
   $pPluginParams  

[ Top ]

method pluginStore [line 180]

TRUE pluginStore( &$pStoreHash, string $pGuid, [boolean $pUpdate = FALSE], array $pStoreHash)

pluginStore will use a given plugin to store uploaded file data



Tags:

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


Parameters:

string   $pGuid   GUID of plugin
array   $pStoreHash   Data to be prcessed and stored by the plugin
boolean   $pUpdate   set to TRUE if this is just an update
   &$pStoreHash  

[ Top ]

method store [line 83]

bool store( &$pStoreHash, array $pStoreHash)

Store a new upload



Tags:

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


Overridden in child classes as:

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()

Overrides LibertyContent::store() (Create a new content object or update an existing one)

Parameters:

array   $pStoreHash   contains all data to store the gallery
   &$pStoreHash  

[ Top ]

method updateAttachmentParams [line 300]

TRUE updateAttachmentParams( numeric $pAttachmentId, string $pPluginGuid, [array $pParamHash = array()])

updateAttachmentParams will update attachment parameters



Tags:

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


Parameters:

numeric   $pAttachmentId   attachment_id of the item we want the prefs from (optional)
string   $pPluginGuid   GUID of the plugin that should process the data
array   $pParamHash   Data to be processed by the plugin

[ Top ]

method verify [line 212]

TRUE verify( &$pParamHash, array $pStoreHash)

Verify content that is about to be stored



Tags:

return:  on success, FALSE on failure - mErrors will contain reason
todo:  If one of the uploaded files is an update, place the attachment_id with the upload hash in $_FILES or in _files_override
access:  public


Overridden in child classes as:

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

Overrides LibertyContent::verify() (Verify the core class data required to update the liberty_content table entries)

Parameters:

array   $pStoreHash   hash of all data that needs to be stored in the database
   &$pParamHash  

[ Top ]

method verifyAttachment [line 333]

TRUE verifyAttachment( array $pFile)

verifyAttachment will perform a generic check if a file is valid for processing



Tags:

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


Parameters:

array   $pFile   file array from $_FILES

[ Top ]


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