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

Procedural File: LibertyMime.php

Source Location: /liberty/LibertyMime.php



Classes:

LibertyMime
LibertyMime class


Page Details:

Manages liberty Uploads



Tags:

filesource:  Source Code for this file


Includes:

require_once(LIBERTY_PKG_PATH.'LibertyContent.php') [line 11]
required setup

require_once(LIBERTY_PKG_PATH."plugins/processor.".$gBitSystem->getConfig('image_processor','gd').".php") [line 15]





MAX_THUMBNAIL_DIMENSION [line 19]

MAX_THUMBNAIL_DIMENSION = 99999

[ Top ]




clearPrimaryAttachment [line 720]

TRUE clearPrimaryAttachment( numeric $pContentId)

clearPrimaryAttachment will remove the primary flag for all attachments with the given content_id



Tags:

return:  on succes


Parameters

numeric   $pContentId   the content_id for which primary should be unset.
[ Top ]



expunge [line 545]

void expunge( )

Expunges the content deleting attached attachments



[ Top ]



expungeAttachment [line 561]

TRUE expungeAttachment( numeric $pAttachmentId)

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



Tags:

return:  on success, FALSE on failure
access:  public


Parameters

numeric   $pAttachmentId   attachment id of the item that should be deleted
[ Top ]



expungeAttachmentPreferences [line 886]

TRUE expungeAttachmentPreferences( array $pAttachmentId)

expungeAttachmentPreferences will remove all attachment preferences of a given attachmtent



Tags:

return:  on success, FALSE on failure
access:  public


Parameters

array   $pAttachmentId   attachemnt we want to remove the prefs for
[ Top ]



expungeMetaData [line 1067]

query expungeMetaData( array $pAttachmentId)

expungeMetaData will remove the meta data for a given attachment



Tags:

return:  result
access:  public


Parameters

array   $pAttachmentId   Attachment ID of attachment
[ Top ]



getAttachment [line 636]

attachment getAttachment( numeric $pAttachmentId, [array $pParams = NULL])

getAttachment will load details of a given attachment



Tags:

return:  details
access:  public


Parameters

numeric   $pAttachmentId   Attachment ID of the attachment
array   $pParams   optional parameters that might contain information like display thumbnail size
[ Top ]



getAttachmentDownloadUrl [line 897]

void getAttachmentDownloadUrl( $pAttachmentId)



Parameters

   $pAttachmentId  
[ Top ]



getAttachmentList [line 487]

TRUE getAttachmentList( &$pListHash, array $pListHash)

Get a list of all available attachments



Tags:

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


Parameters

array   $pListHash  
   &$pListHash  
[ Top ]



getAttachmentPreference [line 747]

void getAttachmentPreference( string $pAttachmentId, string $pPrefName, [int $pPrefDefault = NULL])

Returns the attachment preference value for the passed in key.



Parameters

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



getAttachmentPreferences [line 771]

void getAttachmentPreferences( string $pAttachmentId, string 1, int 2)

Returns the attachment preferences for a given attachment id



Parameters

string   1   Default value to return if the preference is empty
int   2   Optional content_id for arbitrary content preference
string   $pAttachmentId   Hash key for the mPrefs value
[ Top ]



getDownloadUrl [line 910]

void getDownloadUrl( )



[ Top ]



getMetaData [line 995]

array getMetaData( numeric $pAttachmentId, [string $pType = NULL], [string $pTitle = NULL])

getMetaData



Tags:

return:  with meta data on success, FALSE on failure $note: Output format varies depending on requested data
access:  public


Parameters

numeric   $pAttachmentId   AttachmentID the data belongs to
string   $pType   Type of data. e.g.: EXIF, ID3.
string   $pTitle   Title of data. e.g.: Artist, Album.
[ Top ]



getMetaDescription [line 1099]

description getMetaDescription( string $pId, [string $pTable = 'type'])

getMetaDescription



Tags:

return:  on sucess, FALSE on failure
access:  public


Parameters

string   $pId   ID of type or title we want the description for
string   $pTable   Table data is stored in - either 'type' or 'title'
[ Top ]



getMetaId [line 1082]

meta getMetaId( string $pDescription, [string $pTable = 'type'])

getMetaId



Tags:

return:  type or title id on sucess, FALSE on failure
access:  public


Parameters

string   $pDescription   Description of meta key. e.g.: Exif, ID3, Album, Artist
string   $pTable   Table data is stored in - either 'type' or 'title'
[ Top ]



getSourceFile [line 380]

void getSourceFile( [ $pParamHash = array()])



Parameters

   $pParamHash  
[ Top ]



getSourceUrl [line 364]

void getSourceUrl( [ $pParamHash = array()])



Parameters

   $pParamHash  
[ Top ]



getStorageBranch [line 431]

string getStorageBranch( $pSubDir $pParamHash, $pUserId 1, $pRootDir 2)

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



Tags:

return:  full path on local filsystem to store files.
author:  Christian Fowler<spider@steelsun.com>
access:  public


Parameters

$pUserId   1   indicates the 'users/.../<user_id>' branch or use the 'common' branch if null
$pRootDir   2   **deprecated, unused, will be removed in future relase**.
$pSubDir   $pParamHash   any desired directory below the StoragePath. this will be created if it doesn't exist
[ Top ]



getStoragePath [line 406]

string getStoragePath( $pSubDir $pParamHash, [$pCommon $pRootDir = NULL], $pRootDir 2)

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



Tags:

return:  full path on local filsystem to store files.
author:  Christian Fowler<spider@steelsun.com>
access:  public


Parameters

$pRootDir   2   override BIT_ROOT_DIR with a custom absolute path - useful for areas where no we access should be allowed
$pSubDir   $pParamHash   any desired directory below the StoragePath. this will be created if it doesn't exist
$pCommon   $pRootDir   indicates not to use the 'common' branch, and not the 'users/.../<user_id>' branch
[ Top ]



getStorageSubDirName [line 442]

appropriate getStorageSubDirName( [array $pFileHash = NULL])

getStorageSubDirName get a filename based on the uploaded file



Tags:

return:  sub dir name
access:  public


Parameters

array   $pFileHash   File information provided in $_FILES
[ Top ]



getStorageUrl [line 417]

void getStorageUrl( $pParamHash)



Parameters

   $pParamHash  
[ Top ]



liberty_mime_get_default_file_name [line 1256]

void liberty_mime_get_default_file_name( $pFileName, $pMimeType)



Parameters

   $pFileName  
   $pMimeType  
[ Top ]



liberty_mime_get_storage_path [line 1212]

void liberty_mime_get_storage_path( $pParamHash)



Parameters

   $pParamHash  
[ Top ]



liberty_mime_get_storage_sub_dir_name [line 1129]

appropriate liberty_mime_get_storage_sub_dir_name( [array $pFileHash = NULL])

mime_get_storage_sub_dir_name get a filename based on the uploaded file



Tags:

return:  sub dir name
access:  public


Parameters

array   $pFileHash   File information provided in $_FILES
[ Top ]



liberty_mime_get_storage_url [line 1206]

void liberty_mime_get_storage_url( $pParamHash)



Parameters

   $pParamHash  
[ Top ]



loadAttachment [line 609]

attachment loadAttachment( numeric $pAttachmentId, [array $pParams = NULL])

loadAttachment will load details of a given attachment



Tags:

return:  details
access:  public


Parameters

numeric   $pAttachmentId   Attachment ID of the attachment
array   $pParams   optional parameters that might contain information like display thumbnail size
[ Top ]



loadAttachmentPreferences [line 846]

array loadAttachmentPreferences( [numeric $pContentId = NULL], numeric $pAttachmentId)

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



Tags:

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


Parameters

numeric   $pContentId   content_id of the item we want the prefs from (optional)
numeric   $pAttachmentId   attachment_id of the item we want the prefs from (optional)
[ Top ]



normalizeMetaDescription [line 1115]

normalized normalizeMetaDescription( string $pDescription)

normalizeMetaDescription



Tags:

return:  meta description that can be used as a guid
access:  public


Parameters

string   $pDescription   Description of meta key. e.g.: Exif, ID3, Album, Artist
[ Top ]



setAttachmentPreference [line 802]

TRUE setAttachmentPreference( array $pAttachmentId, array $pPrefName, array $pPrefValue)

setAttachmentPreference will set an attachment preferences without storing it in the database



Tags:

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


Parameters

array   $pAttachmentId  
array   $pPrefName  
array   $pPrefValue  
[ Top ]



setPrimaryAttachment [line 672]

TRUE setPrimaryAttachment( [mixed $pAttachmentId = NULL], [numeric $pContentId = NULL], [boolean $pAutoPrimary = TRUE])

setPrimaryAttachment will set is_primary 'y' for the specified attachment and will ensure that all others are set to 'n'



Tags:

return:  on success, FALSE on failure
access:  public


Parameters

mixed   $pAttachmentId   attachment id of the item we want to set as the primary attachment. Use 'none' to clear.
numeric   $pContentId   content id we are working with.
boolean   $pAutoPrimary   automatically set primary if there is only one attachment. Defaults to true.
[ Top ]



storeAttachmentPreference [line 815]

void storeAttachmentPreference( string $pAttachmentId, string $pPrefName, [ $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.



Parameters

string   $pAttachmentId   Hash key for the prefs value
string   $pPrefName   Value for the prefs hash key
   $pPrefValue  
[ Top ]



storeMetaData [line 928]

TRUE storeMetaData( numeric $pAttachmentId, [string $pType = &quot;Meta Data&quot;], array $pStoreHash)

storeMetaData



Tags:

return:  on success, FALSE on failure
access:  public


Parameters

numeric   $pAttachmentId   AttachmentID the data belongs to
string   $pType   Type of data. e.g.: EXIF, ID3. This will default to "Meta Data"
array   $pStoreHash   Data that needs to be stored in the database in an array. The key will be used as the meta_title.
[ Top ]



storeMetaId [line 969]

newly storeMetaId( string $pDescription, [string $pTable = 'type'])

storeMetaId



Tags:

return:  stored ID on success, FALSE on failure
access:  public


Parameters

string   $pDescription   Description of meta key. e.g.: Exif, ID3, Album, Artist
string   $pTable   Table data is stored in - either 'type' or 'title'
[ Top ]



validateStoragePath [line 466]

TRUE validateStoragePath( array $pPath)

validateStoragePath make sure that the file/dir you are trying to delete is valid



Tags:

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


Parameters

array   $pPath   absolute path to the file/dir we want to validate
[ Top ]



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