LibertyAttachable Class Reference

Inheritance diagram for LibertyAttachable:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 detachAttachment ($pAttachmentId, $pContentId=NULL)
 expunge ($pDeleteAttachments=FALSE)
 expungeAttachment ($pAttachmentId)
 expungingAttachment ($pAttachmentId, $pContentIds)
 extractMetaData (&$pParamHash)
 getAttachment ($pAttachmentId)
 getAttachmentList (&$pListHash)
 getStorageBranch ($pSubDir=NULL, $pUserId=NULL, $pPackage=ACTIVE_PACKAGE, $pPermissions=0755, $pRootDir=NULL)
 getStoragePath ($pSubDir=NULL, $pUserId=NULL, $pPackage=ACTIVE_PACKAGE, $pPermissions=0755, $pRootDir=NULL)
 getStorageSubDirName ()
 getStorageUrl ($pSubDir=NULL, $pUserId=NULL, $pPackage=ACTIVE_PACKAGE, $pPermissions=0755, $pRootDir=NULL)
 LibertyAttachable ()
 load ($pContentId=NULL)
 scanForAttchmentUse ($pAttachmentId)
 store (&$pParamHash)
 storeAttachments (&$pParamHash, $pExisting=TRUE)
 storeExistingAttachments (&$pParamHash)
 storeNewAttachments (&$pParamHash)
 storePrimaryAttachmentId ($pParamHash)
 verify (&$pParamHash)
 verifyAttachment (&$pParamHash, $file)
 verifyAttachments (&$pParamHash)
 verifyPrimaryAttachmentId (&$pParamHash)

Public Attributes

 $mContentId
 $mStorage

Detailed Description

Definition at line 40 of file LibertyAttachable.php.


Member Function Documentation

LibertyAttachable::detachAttachment ( pAttachmentId,
pContentId = NULL 
)

detach attachment from content

Parameters:
array $pAttachmentId Attachment id that needs to be detached from the content loaded
array $pContentId Optional content ID that the attachment should be detached from public
Returns:
TRUE on success, FALSE on failure - mErrors will contain reason for failure

Definition at line 695 of file LibertyAttachable.php.

References $query, $ret, FALSE, mContentId, mDb, tra(), and BitBase::verifyId().

Referenced by expunge().

Here is the call graph for this function:

LibertyAttachable::expunge ( pDeleteAttachments = FALSE  ) 

Expunges the content deleting attachments if asked to do so, otherwise just detaching them

Reimplemented in FisheyeGallery, FisheyeImage, Pigeonholes, TreasuryGallery, and TreasuryItem.

Definition at line 586 of file LibertyAttachable.php.

References $i, detachAttachment(), LibertyContent::expunge(), expungeAttachment(), mInfo, and mStorage.

Here is the call graph for this function:

LibertyAttachable::expungeAttachment ( pAttachmentId  ) 

expunge attachment from the database (and file system via the plugin if required)

Parameters:
numeric $pAttachmentId attachment id of the item that should be deleted public
Returns:
TRUE on success, FALSE on failure - mErrors will contain reason for failure

Definition at line 610 of file LibertyAttachable.php.

References $contentTypes, $gBitUser, $gLibertySystem, $guid, $ret, $row, $sql, $user_id, LibertyBase::getLibertyClass(), LibertyContent::isOwner(), mDb, mStorage, and BitBase::verifyId().

Referenced by expunge(), BitUser::purgeImage(), and FisheyeImage::store().

Here is the call graph for this function:

LibertyAttachable::expungingAttachment ( pAttachmentId,
pContentIds 
)

Called during attachment deletion to notify a content type that an attachment for content of that type is going away so it can take appropriate action. Note that it is VITAL that content NOT call expunge(TRUE) as part of handling this notification or else the universe will implode.

Parameters:
the id of the attachment being deleted
an array of content_ids that reference this attachment that are of this type.

Reimplemented in FisheyeImage, and TreasuryItem.

Definition at line 683 of file LibertyAttachable.php.

LibertyAttachable::extractMetaData ( &$  pParamHash  ) 

Definition at line 118 of file LibertyAttachable.php.

References $pParamHash, FALSE, BitBase::getField(), and title.

Referenced by verifyAttachment().

Here is the call graph for this function:

LibertyAttachable::getAttachment ( pAttachmentId  ) 

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

Parameters:
array $pAttachmentId public
Returns:
TRUE on success, FALSE on failure - mErrors will contain reason for failure

Definition at line 765 of file LibertyAttachable.php.

References $gLibertySystem, $query, $result, $ret, $row, mDb, and BitBase::verifyId().

Referenced by BitArticle::getImageUrl().

Here is the call graph for this function:

LibertyAttachable::getAttachmentList ( &$  pListHash  ) 

Get a list of all available attachments

Parameters:
array $pListHash public
Returns:
TRUE on success, FALSE on failure - mErrors will contain reason for failure

Definition at line 526 of file LibertyAttachable.php.

References $attachment, $gBitSystem, $gBitUser, $gLibertySystem, $query, $res, $result, $ret, $sql, mDb, BitBase::postGetList(), and LibertyContent::prepGetList().

Here is the call graph for this function:

LibertyAttachable::getStorageBranch ( pSubDir = NULL,
pUserId = NULL,
pPackage = ACTIVE_PACKAGE,
pPermissions = 0755,
pRootDir = NULL 
)

getStorageBranch - get url to store files for the feature site_upload_dir. It creates a calculable hierarchy of directories

public

Author:
Christian Fowler<spider@steelsun.com>
Parameters:
$pSubDir any desired directory below the StoragePath. this will be created if it doesn't exist
$pUserId indicates the 'users/.../<user_id>' branch or use the 'common' branch if null
$pRootDir override BIT_ROOT_DIR with a custom absolute path - useful for areas where no we access should be allowed
Returns:
string full path on local filsystem to store files.

Definition at line 87 of file LibertyAttachable.php.

References $gBitSystem, and $ret.

Referenced by getStoragePath(), BitUser::storeAvatar(), BitUser::storeLogo(), storeNewAttachments(), BitUser::storePortrait(), and treasury_default_verify().

LibertyAttachable::getStoragePath ( pSubDir = NULL,
pUserId = NULL,
pPackage = ACTIVE_PACKAGE,
pPermissions = 0755,
pRootDir = NULL 
)

getStoragePath - get path to store files for the feature site_upload_dir. It creates a calculable hierarchy of directories

public

Author:
Christian Fowler<spider@steelsun.com>
Parameters:
$pSubDir any desired directory below the StoragePath. this will be created if it doesn't exist
$pCommon indicates not to use the 'common' branch, and not the 'users/.../<user_id>' branch
$pRootDir override BIT_ROOT_DIR with a custom absolute path - useful for areas where no we access should be allowed
Returns:
string full path on local filsystem to store files.

Definition at line 58 of file LibertyAttachable.php.

References $ret, and getStorageBranch().

Referenced by PackagerBase::getStoragePath().

Here is the call graph for this function:

LibertyAttachable::getStorageSubDirName (  ) 

Definition at line 73 of file LibertyAttachable.php.

Referenced by storeNewAttachments().

LibertyAttachable::getStorageUrl ( pSubDir = NULL,
pUserId = NULL,
pPackage = ACTIVE_PACKAGE,
pPermissions = 0755,
pRootDir = NULL 
)

Definition at line 69 of file LibertyAttachable.php.

Referenced by TreasuryGallery::getGalleryThumbBaseUrl(), PackagerBase::getStorageUrl(), and BitArticleTopic::getTopicImageBaseUrl().

LibertyAttachable::LibertyAttachable (  ) 

Definition at line 44 of file LibertyAttachable.php.

References LibertyContent::LibertyContent().

Referenced by BitArticle::BitArticle(), BitBlogPost::BitBlogPost(), BitBoard::BitBoard(), BitBoardTopic::BitBoardTopic(), BitEvents::BitEvents(), BitGmap::BitGmap(), BitPage::BitPage(), BitSticky::BitSticky(), BitUser::BitUser(), FisheyeBase::FisheyeBase(), BitUser::getUserAttachments(), Pigeonholes::Pigeonholes(), and TreasuryBase::TreasuryBase().

Here is the call graph for this function:

LibertyAttachable::load ( pContentId = NULL  ) 

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

Parameters:
array $pContentId public
Returns:
TRUE on success, FALSE on failure - mErrors will contain reason for failure

Reimplemented from LibertyContent.

Reimplemented in BitArticle, BitBlogPost, FisheyeGallery, BitGmap, TreasuryGallery, and TreasuryItem.

Definition at line 729 of file LibertyAttachable.php.

References $gLibertySystem, $query, $result, $row, LibertyContent::load(), mContentId, mDb, mStorage, and BitBase::verifyId().

Referenced by Pigeonholes::load(), FisheyeImage::load(), BitPage::load(), BitNewsletterEdition::load(), BitEvents::load(), BitBoard::load(), BitBlogPost::load(), and BitArticle::load().

Here is the call graph for this function:

LibertyAttachable::scanForAttchmentUse ( pAttachmentId  ) 

This function will scan through liberty_content.data and will search for any occurrances of {attachemt id=<id>}

Parameters:
array $pAttachmentId Attachment id of interest public
Returns:
array of content using a given attachment

Definition at line 791 of file LibertyAttachable.php.

References $contentTypes, $gBitSystem, $gLibertySystem, $query, $result, $ret, $type, editor, mDb, mPackages, title, tra(), and BitBase::verifyId().

Here is the call graph for this function:

LibertyAttachable::store ( &$  pParamHash  ) 

Create a new content object or update an existing one

Parameters:
array Array of content data to be stored
See verify for details of the values required

Reimplemented from LibertyContent.

Reimplemented in BitArticle, BitBlogPost, BitBoard, BitBoardTopic, BitEvents, FisheyeGallery, FisheyeImage, BitGmap, BitGmapMarker, Pigeonholes, TreasuryGallery, TreasuryItem, BitPermUser, BitUser, and BitPage.

Definition at line 487 of file LibertyAttachable.php.

References $gBitSystem, $gLibertySystem, $pParamHash, mDb, LibertyContent::store(), storeExistingAttachments(), storeNewAttachments(), storePrimaryAttachmentId(), and verify().

Referenced by TreasuryBase::getDefaultGalleryId(), Pigeonholes::store(), FisheyeImage::store(), BitPage::store(), BitEvents::store(), BitBoard::store(), BitBlogPost::store(), BitArticle::store(), BitUser::storeAvatar(), BitUser::storeLogo(), and BitUser::storePortrait().

Here is the call graph for this function:

LibertyAttachable::storeAttachments ( &$  pParamHash,
pExisting = TRUE 
)

Definition at line 504 of file LibertyAttachable.php.

References $pParamHash, mDb, storeExistingAttachments(), storeNewAttachments(), and verifyAttachments().

Here is the call graph for this function:

LibertyAttachable::storeExistingAttachments ( &$  pParamHash  ) 

Definition at line 407 of file LibertyAttachable.php.

References $pParamHash, $query, mContentId, mDb, tra(), and BitBase::verifyId().

Referenced by store(), and storeAttachments().

Here is the call graph for this function:

LibertyAttachable::storeNewAttachments ( &$  pParamHash  ) 

Definition at line 323 of file LibertyAttachable.php.

References $gBitSystem, $gBitUser, $gLibertySystem, $guid, $pParamHash, $rs, $sql, $storeRow, getStorageBranch(), getStorageSubDirName(), liberty_process_upload(), mDb, mStorage, tra(), and BitBase::verifyId().

Referenced by store(), and storeAttachments().

Here is the call graph for this function:

LibertyAttachable::storePrimaryAttachmentId ( pParamHash  ) 

Store the primary attachment id if we need to. This function can be called statically

Parameters:
array $pParamHash should contain the primary_attachment_id and the content_id the attachment_id should be linked to public
Returns:
TRUE on success, FALSE on failure - mErrors will contain reason for failure

Definition at line 470 of file LibertyAttachable.php.

References $gBitSystem, $pParamHash, $query, $ret, FALSE, and mDb.

Referenced by store(), and treasury_default_store().

LibertyAttachable::verify ( &$  pParamHash  ) 

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

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

Returns:
integer Count of the number of errors ( 0 for success )
[pParamHash] will be extended to include array [content_store] populated with the require values for LibertyContent::store()

Reimplemented from LibertyContent.

Reimplemented in BitArticle, BitBlogPost, BitBoard, BitBoardTopic, BitEvents, BitGmap, BitGmapMarker, BitNewsletterEdition, Pigeonholes, TreasuryGallery, TreasuryItem, BitUser, and BitPage.

Definition at line 279 of file LibertyAttachable.php.

References $gBitSystem, $gBitUser, $pParamHash, mUserId, tra(), verifyAttachments(), BitBase::verifyId(), and verifyPrimaryAttachmentId().

Referenced by BitEvents::preview(), and store().

Here is the call graph for this function:

LibertyAttachable::verifyAttachment ( &$  pParamHash,
file 
)

Definition at line 179 of file LibertyAttachable.php.

References $gBitSystem, $gBitUser, $gLibertySystem, $pParamHash, $tmp, extractMetaData(), and title.

Referenced by verifyAttachments().

Here is the call graph for this function:

LibertyAttachable::verifyAttachments ( &$  pParamHash  ) 

Definition at line 240 of file LibertyAttachable.php.

References $gBitSystem, $i, $pParamHash, and verifyAttachment().

Referenced by storeAttachments(), and verify().

Here is the call graph for this function:

LibertyAttachable::verifyPrimaryAttachmentId ( &$  pParamHash  ) 

Verify that if somebody is setting the primary_attachment[attachment_id] that they are refering to an existing attachment

Parameters:
pParamHash Array with primary_attachment[attachment_id] set.

Definition at line 442 of file LibertyAttachable.php.

References $count, $pParamHash, $sql, mDb, tra(), and BitBase::verifyId().

Referenced by verify().

Here is the call graph for this function:


Member Data Documentation

LibertyAttachable::$mContentId

Content Id if an object has been loaded

Reimplemented from LibertyContent.

Definition at line 41 of file LibertyAttachable.php.

LibertyAttachable::$mStorage

Definition at line 42 of file LibertyAttachable.php.


The documentation for this class was generated from the following file:
Generated on Wed Aug 22 19:34:38 2007 for bitweaver by  doxygen 1.5.2