Procedural File: LibertyMime.php
Source Location: /liberty/LibertyMime.php
Classes:
LibertyMime
LibertyMime class
Page Details:
Manages liberty Uploads
Tags:
Includes:
MAX_THUMBNAIL_DIMENSION [line 19]
clearPrimaryAttachment [line 720]
TRUE clearPrimaryAttachment(
numeric $pContentId)
|
|
clearPrimaryAttachment will remove the primary flag for all attachments with the given content_id
Tags:
Parameters
numeric |
$pContentId |
the content_id for which primary should be unset. |
expunge [line 545]
Expunges the content deleting attached attachments
expungeAttachment [line 561]
TRUE expungeAttachment(
numeric $pAttachmentId)
|
|
expunge attachment from the database (and file system via the plugin if required)
Tags:
Parameters
numeric |
$pAttachmentId |
attachment id of the item that should be deleted |
expungeAttachmentPreferences [line 886]
TRUE expungeAttachmentPreferences(
array $pAttachmentId)
|
|
expungeAttachmentPreferences will remove all attachment preferences of a given attachmtent
Tags:
Parameters
array |
$pAttachmentId |
attachemnt we want to remove the prefs for |
expungeMetaData [line 1067]
query expungeMetaData(
array $pAttachmentId)
|
|
expungeMetaData will remove the meta data for a given attachment
Tags:
Parameters
array |
$pAttachmentId |
Attachment ID of attachment |
getAttachment [line 636]
attachment getAttachment(
numeric $pAttachmentId, [array $pParams = NULL])
|
|
getAttachment will load details of a given attachment
Tags:
Parameters
numeric |
$pAttachmentId |
Attachment ID of the attachment |
array |
$pParams |
optional parameters that might contain information like display thumbnail size |
getAttachmentDownloadUrl [line 897]
void getAttachmentDownloadUrl(
$pAttachmentId)
|
|
Parameters
getAttachmentList [line 487]
TRUE getAttachmentList(
&$pListHash, array $pListHash)
|
|
Get a list of all available attachments
Tags:
Parameters
array |
$pListHash |
|
|
&$pListHash |
|
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 |
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 |
getDownloadUrl [line 910]
getMetaData [line 995]
array getMetaData(
numeric $pAttachmentId, [string $pType = NULL], [string $pTitle = NULL])
|
|
getMetaData
Tags:
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. |
getMetaDescription [line 1099]
description getMetaDescription(
string $pId, [string $pTable = 'type'])
|
|
getMetaDescription
Tags:
Parameters
string |
$pId |
ID of type or title we want the description for |
string |
$pTable |
Table data is stored in - either 'type' or 'title' |
getMetaId [line 1082]
meta getMetaId(
string $pDescription, [string $pTable = 'type'])
|
|
getMetaId
Tags:
Parameters
string |
$pDescription |
Description of meta key. e.g.: Exif, ID3, Album, Artist |
string |
$pTable |
Table data is stored in - either 'type' or 'title' |
getSourceFile [line 380]
void getSourceFile(
[ $pParamHash = array()])
|
|
Parameters
getSourceUrl [line 364]
void getSourceUrl(
[ $pParamHash = array()])
|
|
Parameters
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:
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 |
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:
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 |
getStorageSubDirName [line 442]
appropriate getStorageSubDirName(
[array $pFileHash = NULL])
|
|
getStorageSubDirName get a filename based on the uploaded file
Tags:
Parameters
array |
$pFileHash |
File information provided in $_FILES |
getStorageUrl [line 417]
void getStorageUrl(
$pParamHash)
|
|
Parameters
liberty_mime_get_default_file_name [line 1256]
void liberty_mime_get_default_file_name(
$pFileName, $pMimeType)
|
|
Parameters
liberty_mime_get_storage_path [line 1212]
void liberty_mime_get_storage_path(
$pParamHash)
|
|
Parameters
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:
Parameters
array |
$pFileHash |
File information provided in $_FILES |
liberty_mime_get_storage_url [line 1206]
void liberty_mime_get_storage_url(
$pParamHash)
|
|
Parameters
loadAttachment [line 609]
attachment loadAttachment(
numeric $pAttachmentId, [array $pParams = NULL])
|
|
loadAttachment will load details of a given attachment
Tags:
Parameters
numeric |
$pAttachmentId |
Attachment ID of the attachment |
array |
$pParams |
optional parameters that might contain information like display thumbnail size |
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:
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) |
normalizeMetaDescription [line 1115]
normalized normalizeMetaDescription(
string $pDescription)
|
|
normalizeMetaDescription
Tags:
Parameters
string |
$pDescription |
Description of meta key. e.g.: Exif, ID3, Album, Artist |
setAttachmentPreference [line 802]
TRUE setAttachmentPreference(
array $pAttachmentId, array $pPrefName, array $pPrefValue)
|
|
setAttachmentPreference will set an attachment preferences without storing it in the database
Tags:
Parameters
array |
$pAttachmentId |
|
array |
$pPrefName |
|
array |
$pPrefValue |
|
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:
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. |
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 |
|
storeMetaData [line 928]
TRUE storeMetaData(
numeric $pAttachmentId, [string $pType = "Meta Data"], array $pStoreHash)
|
|
storeMetaData
Tags:
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. |
storeMetaId [line 969]
newly storeMetaId(
string $pDescription, [string $pTable = 'type'])
|
|
storeMetaId
Tags:
Parameters
string |
$pDescription |
Description of meta key. e.g.: Exif, ID3, Album, Artist |
string |
$pTable |
Table data is stored in - either 'type' or 'title' |
validateStoragePath [line 466]
TRUE validateStoragePath(
array $pPath)
|
|
validateStoragePath make sure that the file/dir you are trying to delete is valid
Tags:
Parameters
array |
$pPath |
absolute path to the file/dir we want to validate |
|
|