Documentation

Download

Digital Asset Management Download

Tags
copyright

CLOUDREXX CMS - CLOUDREXX AG

author

CLOUDREXX Development Team info@cloudrexx.com

subpackage

module_downloads

version
1.0.0

Table of Contents

Properties

$arrMimeTypes  : mixed
$EOF  : mixed
$error_msg  : string
Contains the message if an error occurs
$arrCachedDownloads  : array<string|int, mixed>
Array that holds all downloads which were ever loaded
$config  : array<string|int, mixed>
Local copy of the components config data
$access_groups  : mixed
$access_id  : mixed
$arrAttributes  : mixed
$arrLoadedDownloads  : array<string|int, mixed>
Array which holds all loaded downloads for later usage
$arrTypes  : mixed
$author  : mixed
$categories  : mixed
$ctime  : mixed
$defaultMimeType  : mixed
$defaultType  : mixed
$description  : string
Description in loaded interface language
$descriptions  : array<string|int, mixed>
Descriptions in all languages
$download_count  : mixed
$downloads  : mixed
$expiration  : mixed
$fileType  : string
Filetype in loaded interface language
$fileTypes  : string
Filetypes of all languages
$filtered_search_count  : int
Contains the number of currently loaded downloads
$id  : mixed
$image  : mixed
$is_active  : mixed
$isFrontendMode  : mixed
$license  : mixed
$metakey  : string
Metakeys in loaded interface language
$metakeys  : array<string|int, mixed>
Metakeys in all languages
$mime_type  : mixed
$mtime  : mixed
$name  : string
Name of download in loaded interface language
$names  : array<string|int, mixed>
Names in all languages
$order  : mixed
$owner_id  : mixed
$protected  : mixed
$size  : mixed
$source  : string
Source in loaded interface language
$source_name  : string
Source-name in loaded interface language
$source_names  : array<string|int, mixed>
Sources of all languages
$sources  : array<string|int, mixed>
Sources of all languages
$type  : mixed
$userId  : mixed
$validity  : mixed
$version  : mixed
$views  : mixed
$visibility  : mixed
$website  : mixed

Methods

__clone()  : mixed
__construct()  : mixed
delete()  : bool
Delete the current loaded download
first()  : mixed
Load first download
getAccessGroupIds()  : mixed
getAccessId()  : mixed
getActiveStatus()  : mixed
getAssociatedCategoryIds()  : mixed
getAuthor()  : mixed
getCTime()  : mixed
getDescription()  : mixed
getDownload()  : mixed
getDownloadCount()  : mixed
getDownloads()  : Download
Get related downloads
getErrorMsg()  : mixed
getExpirationDate()  : mixed
getFileIcon()  : string
Get the File Type Icon
getFileType()  : string
Get the File type using interface language
getFilteredSearchDownloadCount()  : mixed
getIcon()  : mixed
getId()  : mixed
getImage()  : mixed
getLicense()  : mixed
getMetakeys()  : mixed
getMimeType()  : mixed
getMTime()  : mixed
getName()  : string
Get name
getOrder()  : mixed
getOwnerId()  : mixed
getProtection()  : mixed
getRelatedDownloadIds()  : mixed
getSize()  : mixed
getSource()  : mixed
getSourceName()  : mixed
getTrimmedDescription()  : string
Returns the description trimmed to maximum length of 100 characters.
getType()  : mixed
getValidityTimePeriod()  : mixed
getVersion()  : mixed
getViewCount()  : mixed
getVisibility()  : mixed
getWebsite()  : mixed
incrementDownloadCount()  : mixed
incrementViewCount()  : mixed
load()  : bool
Load download data
loadDownloads()  : bool
Load downloads
loadLocales()  : mixed
next()  : mixed
Load next download
reset()  : mixed
send()  : mixed
Send asset to client
setAccessId()  : mixed
setActiveStatus()  : mixed
setAuthor()  : mixed
setCategories()  : mixed
setDescriptions()  : mixed
setDownloads()  : mixed
setGroups()  : mixed
setImage()  : mixed
setLicense()  : mixed
setMetakeys()  : mixed
setMimeType()  : mixed
setNames()  : mixed
setOrder()  : mixed
setOwnerId()  : mixed
setProtection()  : mixed
setSize()  : mixed
setSources()  : mixed
setType()  : mixed
setValidityTimePeriod()  : mixed
setVersion()  : mixed
setVisibility()  : mixed
setWebsite()  : mixed
store()  : bool
Store download
updateMTime()  : mixed
getAssociatedCategorySqlQuery()  : string
getAssociatedCategorySqlWhereFilter()  : string
walkDownloadQueryFunctions()  : mixed
Modify the locale fields query for fetching locale values based on available language
clean()  : mixed
Clean download metadata
getFilteredIdList()  : array<string|int, mixed>
Get filtered ID list
getSubCategories()  : mixed
Returns all children of the given category.
hasSubCategories()  : mixed
Check if the given category has children.
loadCategoryAssociations()  : mixed
loadRelatedDownloads()  : mixed
parseFilterConditions()  : array<string|int, mixed>
Parse filter conditions
parseSearchConditions()  : array<string|int, mixed>
Parse search conditions
setExpirationDate()  : mixed
setSortedIdList()  : array<string|int, mixed>
Set Sorted ID list
storeCategoryAssociations()  : mixed
storeDownloadRelations()  : mixed
storeLocales()  : bool
Store locales
storePermissions()  : mixed
validateName()  : mixed

Properties

$arrMimeTypes

public static mixed $arrMimeTypes = array('image' => array('description' => 'TXT_DOWNLOADS_TYPE_IMAGE', 'extensions' => array('jpg', 'jpeg', 'gif', 'png', 'bmp', 'webp'), 'icon' => 'picture.png', 'icon_small' => 'picture_small.png'), 'document' => array('description' => 'TXT_DOWNLOADS_TYPE_DOCUMENT', 'extensions' => array('doc', 'xls', 'txt', 'ppt', 'xml', 'odt', 'ott', 'sxw', 'stw', 'dot', 'rtf', 'sdw', 'wpd', 'jtd', 'cvs'), 'icon' => 'document.png', 'icon_small' => 'document_small.png'), 'pdf' => array('description' => 'TXT_DOWNLOADS_TYPE_PDF', 'extensions' => array('pdf'), 'icon' => 'pdf.png', 'icon_small' => 'pdf_small.png'), 'media' => array('description' => 'TXT_DOWNLOADS_TYPE_MEDIA', 'extensions' => array('avi', 'mp3', 'mpeg', 'wmv', 'mov', 'rm', 'wav', 'ogg'), 'icon' => 'media.png', 'icon_small' => 'media_small.png'), 'archive' => array('description' => 'TXT_DOWNLOADS_TYPE_ARCHIVE', 'extensions' => array('tar', 'tar.gz', 'tar.bz2', 'tbz2', 'tb2', 'tbz', 'tgz', 'taz', 'tar.Z', 'zip', 'rar', 'cab'), 'icon' => 'archive.jpg', 'icon_small' => 'archive_small.png'), 'application' => array('description' => 'TXT_DOWNLOADS_TYPE_APPLICATION', 'extensions' => array('exe', 'sh', 'bin', 'dmg', 'deb', 'rpm', 'msi', 'jar', 'pkg'), 'icon' => 'software.png', 'icon_small' => 'software_small.png'), 'link' => array('description' => 'TXT_DOWNLOADS_TYPE_LINK', 'extensions' => array(), 'icon' => 'links.png', 'icon_small' => 'links_small.png'))

$error_msg

Contains the message if an error occurs

public string $error_msg = array()

$arrCachedDownloads

Array that holds all downloads which were ever loaded

protected array<string|int, mixed> $arrCachedDownloads = array()
Tags
access

protected

$config

Local copy of the components config data

protected array<string|int, mixed> $config = array()

$arrAttributes

private mixed $arrAttributes = array('core' => array('id' => 'int', 'type' => 'string', 'mime_type' => 'string', 'size' => 'int', 'image' => 'string', 'owner_id' => 'int', 'access_id' => 'int', 'license' => 'string', 'version' => 'string', 'author' => 'string', 'website' => 'string', 'ctime' => 'int', 'mtime' => 'int', 'is_active' => 'int', 'visibility' => 'int', 'order' => 'int', 'views' => 'int', 'download_count' => 'int', 'expiration' => 'int', 'validity' => 'int'), 'locale' => array('name' => 'string', 'description' => 'string', 'source' => 'string', 'source_name' => 'string', 'file_type' => 'string'))

$arrLoadedDownloads

Array which holds all loaded downloads for later usage

private array<string|int, mixed> $arrLoadedDownloads = array()
Tags
access

private

$description

Description in loaded interface language

private string $description

$descriptions

Descriptions in all languages

private array<string|int, mixed> $descriptions

$fileType

Filetype in loaded interface language

private string $fileType

$filtered_search_count

Contains the number of currently loaded downloads

private int $filtered_search_count = 0
Tags
access

private

$metakey

Metakeys in loaded interface language

private string $metakey

$metakeys

Metakeys in all languages

private array<string|int, mixed> $metakeys

$name

Name of download in loaded interface language

private string $name

$names

Names in all languages

private array<string|int, mixed> $names

$source

Source in loaded interface language

private string $source

$source_name

Source-name in loaded interface language

private string $source_name

$source_names

Sources of all languages

private array<string|int, mixed> $source_names

$sources

Sources of all languages

private array<string|int, mixed> $sources

Methods

__construct()

public __construct([array<string|int, mixed> $config = array() ]) : mixed
Parameters
$config : array<string|int, mixed> = array()

Config data of DownloadsLibrary

delete()

Delete the current loaded download

public delete([mixed $categoryId = null ]) : bool
Parameters
$categoryId : mixed = null
Return values
bool

getAssociatedCategoryIds()

public getAssociatedCategoryIds([bool $enforcePermissions = true ]) : mixed
Parameters
$enforcePermissions : bool = true

If set to TRUE, then only those IDs of associated categories are returned on which the currently signed-in user has permission to access to.

getDescription()

public getDescription([mixed $langId = 0 ]) : mixed
Parameters
$langId : mixed = 0

getDownload()

public getDownload(mixed $id) : mixed
Parameters
$id : mixed

getDownloads()

Get related downloads

public getDownloads([mixed $filter = null ][, string $search = null ][, array<string|int, mixed> $arrSort = null ][, array<string|int, mixed> $arrAttributes = null ][, int $limit = null ][, int $offset = null ][, bool $listDownloadsOfCurrentLanguage = false ]) : Download
Parameters
$filter : mixed = null

Filter option, it should be array or integer

$search : string = null

Search term

$arrSort : array<string|int, mixed> = null

Array of sorting fields and its order

$arrAttributes : array<string|int, mixed> = null

Array of fields list

$limit : int = null

Entries per page

$offset : int = null

Offset value

$listDownloadsOfCurrentLanguage : bool = false

If true get Related Downloads of current language otherwise get Related Downloads of all language

Return values
Download

getFileIcon()

Get the File Type Icon

public getFileIcon() : string
Return values
string

getFileType()

Get the File type using interface language

public getFileType([int $langId = 0 ]) : string
Parameters
$langId : int = 0

The language ID

Return values
string

Filetype of Download

getFilteredSearchDownloadCount()

public getFilteredSearchDownloadCount() : mixed

getIcon()

public getIcon([mixed $small = false ]) : mixed
Parameters
$small : mixed = false

getMetakeys()

public getMetakeys([mixed $langId = 0 ]) : mixed
Parameters
$langId : mixed = 0

getName()

Get name

public getName([int $langId = 0 ][, bool $force = false ]) : string
Parameters
$langId : int = 0

Lang ID

$force : bool = false

If true force to get downloads name from $names based on $langId Otherwise $langId is current lang then taken from $name else taken from $names

Return values
string

getRelatedDownloadIds()

public getRelatedDownloadIds() : mixed

getSource()

public getSource([mixed $langId = 0 ]) : mixed
Parameters
$langId : mixed = 0

getSourceName()

public getSourceName([mixed $langId = 0 ]) : mixed
Parameters
$langId : mixed = 0

getTrimmedDescription()

Returns the description trimmed to maximum length of 100 characters.

public getTrimmedDescription([int $langId = LANG_ID ]) : string
Parameters
$langId : int = LANG_ID

ID of the locale the trimmed description shall be returned in

Return values
string

The trimmed description of locale $langId

getValidityTimePeriod()

public getValidityTimePeriod() : mixed

incrementDownloadCount()

public incrementDownloadCount() : mixed

load()

Load download data

public load(int $id[, bool $listDownloadsOfCurrentLanguage = false ]) : bool

Get meta data of download from database and put them into the analogous class variables.

Parameters
$id : int

Download ID

$listDownloadsOfCurrentLanguage : bool = false

If true load Download of current language otherwise load Download of other language

Return values
bool

loadDownloads()

Load downloads

public loadDownloads([mixed $filter = null ][, string $search = null ][, array<string|int, mixed> $arrSort = null ][, array<string|int, mixed> $arrAttributes = null ][, int $limit = null ][, int $offset = null ][, bool $subCategories = false ][, bool $listDownloadsOfCurrentLanguage = false ]) : bool
Parameters
$filter : mixed = null

Filter option, it should be array or integer

$search : string = null

Search term

$arrSort : array<string|int, mixed> = null

Array of sorting fields and its order

$arrAttributes : array<string|int, mixed> = null

Array of fields list

$limit : int = null

Entries per page

$offset : int = null

Offset value

$subCategories : bool = false

If true list also Downloads of subcategories otherwise not

$listDownloadsOfCurrentLanguage : bool = false

If true list Downloads of current language otherwise list Downloads of all language

Return values
bool

send()

Send asset to client

public send([int $langId = 0 ][, string $disposition = HTTP_DOWNLOAD_ATTACHMENT ]) : mixed

Send the file of this instance to the client. The script execution gets terminated by the end of this method call.

Parameters
$langId : int = 0

ID of locale the filename should be sent in

$disposition : string = HTTP_DOWNLOAD_ATTACHMENT

HTTP-Content-Disposition to use. One of the following constants can be used:

  • HTTP_DOWNLOAD_ATTACHMENT
  • HTTP_DOWNLOAD_INLINE
If $disposition is unknown, then HTTP_DOWNLOAD_ATTACHMENT will be assumed.

setAccessId()

public setAccessId(mixed $accessId) : mixed
Parameters
$accessId : mixed

setActiveStatus()

public setActiveStatus(mixed $isActive) : mixed
Parameters
$isActive : mixed

setAuthor()

public setAuthor(mixed $author) : mixed
Parameters
$author : mixed

setCategories()

public setCategories(mixed $arrCategories) : mixed
Parameters
$arrCategories : mixed

setDescriptions()

public setDescriptions(mixed $arrDescriptions) : mixed
Parameters
$arrDescriptions : mixed

setDownloads()

public setDownloads(mixed $arrDownloads) : mixed
Parameters
$arrDownloads : mixed

setGroups()

public setGroups(mixed $arrGroups) : mixed
Parameters
$arrGroups : mixed

setImage()

public setImage(mixed $image) : mixed
Parameters
$image : mixed

setLicense()

public setLicense(mixed $license) : mixed
Parameters
$license : mixed

setMetakeys()

public setMetakeys(mixed $arrMetakeys) : mixed
Parameters
$arrMetakeys : mixed

setMimeType()

public setMimeType(mixed $mimeType) : mixed
Parameters
$mimeType : mixed

setNames()

public setNames(mixed $arrNames) : mixed
Parameters
$arrNames : mixed

setOrder()

public setOrder(mixed $order) : mixed
Parameters
$order : mixed

setOwnerId()

public setOwnerId(mixed $ownerId) : mixed
Parameters
$ownerId : mixed

setProtection()

public setProtection(mixed $protected) : mixed
Parameters
$protected : mixed

setSize()

public setSize(mixed $size) : mixed
Parameters
$size : mixed

setSources()

public setSources(array<string|int, mixed> $sources[, array<string|int, mixed> $sourceNames = null ]) : mixed
Parameters
$sources : array<string|int, mixed>
$sourceNames : array<string|int, mixed> = null

setType()

public setType(mixed $type) : mixed
Parameters
$type : mixed

setValidityTimePeriod()

public setValidityTimePeriod(mixed $validity) : mixed
Parameters
$validity : mixed

setVersion()

public setVersion(mixed $version) : mixed
Parameters
$version : mixed

setVisibility()

public setVisibility(mixed $visibility) : mixed
Parameters
$visibility : mixed

setWebsite()

public setWebsite(mixed $website) : mixed
Parameters
$website : mixed

store()

Store download

public store([Category $objCategory = null ][, array<string|int, mixed> $selectedLanguages = array() ]) : bool

This stores the metadata of the download to the database.

Parameters
$objCategory : Category = null
$selectedLanguages : array<string|int, mixed> = array()

Allowed languages

Tags
global

ADONewConnection

global

array

Return values
bool

getAssociatedCategorySqlQuery()

protected getAssociatedCategorySqlQuery([bool $enforcePermissions = true ][, bool $preLoad = true ]) : string
Parameters
$enforcePermissions : bool = true

If set to TRUE, then the access permissions of the currently signed in user (if any) are taken into account.

$preLoad : bool = true

If set to TRUE, then the IDs of all preloaded downloads $this->arrLoadedDownloads will be fetch in the SQL-query.

Return values
string

SQL-query to fetch the IDs of the associated categories.

getAssociatedCategorySqlWhereFilter()

protected getAssociatedCategorySqlWhereFilter() : string
Return values
string

Sql-Where-Statement to take the currently signed-in user's access permissions into account when fetching the IDs of the associated categories.

walkDownloadQueryFunctions()

Modify the locale fields query for fetching locale values based on available language

protected walkDownloadQueryFunctions(string &$item, int $key[, array<string|int, mixed> $availableLangIds = array() ]) : mixed
Parameters
$item : string

Locale field name

$key : int

Offset value

$availableLangIds : array<string|int, mixed> = array()

Array of available languages

clean()

Clean download metadata

private clean() : mixed

Reset all download metadata for a new download.

getFilteredIdList()

Get filtered ID list

private getFilteredIdList([array<string|int, mixed> $arrFilter = null ][, mixed $search = null ][, array<string|int, mixed> $subCategories = false ][, bool $listDownloadsOfCurrentLanguage = false ]) : array<string|int, mixed>
Parameters
$arrFilter : array<string|int, mixed> = null

Array of filters

$search : mixed = null

Search term

$subCategories : array<string|int, mixed> = false

Array of sub categories ID

$listDownloadsOfCurrentLanguage : bool = false

If true list Downloads of current language otherwise list Downloads of all language

Return values
array<string|int, mixed>

getSubCategories()

Returns all children of the given category.

private getSubCategories(int $parentId) : mixed
Parameters
$parentId : int
Tags
acces

private

hasSubCategories()

Check if the given category has children.

private hasSubCategories(int $parentId) : mixed
Parameters
$parentId : int
Tags
acces

private

loadCategoryAssociations()

private loadCategoryAssociations() : mixed

parseFilterConditions()

Parse filter conditions

private parseFilterConditions(array<string|int, mixed> $arrFilter) : array<string|int, mixed>

Generate conditions of the attributes for the SQL WHERE statement. The filter conditions are defined through the two dimensional array $arrFilter. Each key-value pair represents an attribute and its associated condition to which it must fit to. The condition could either be a integer or string depending on the attributes type, or it could be a collection of integers or strings represented in an array.

Examples of the filer array:

array( 'name' => '%editor%', ) // will return all downloads who's name includes 'editor'

array( 'name' => array( 'd%', 'e%', 'f%', 'g%' ) ) // will return all downloads which have a name of which its first letter is and between 'd' to 'g' (case less)

array( 'name' => array( array( '>' => 'd', '<' => 'g' ), 'LIKE' => 'g%' ) ) // same as the preview example but in an other way

array( 'is_active' => 1, 'license' => 'GPL' ) // will return all downloads that are active and are licensed by the GPL

Parameters
$arrFilter : array<string|int, mixed>
Return values
array<string|int, mixed>

parseSearchConditions()

Parse search conditions

private parseSearchConditions(mixed $search[, bool $listDownloadsOfCurrentLanguage = true ]) : array<string|int, mixed>
Parameters
$search : mixed

Search term, it should be string or array

$listDownloadsOfCurrentLanguage : bool = true

If true search Downloads of current language otherwise search Downloads of all language

Return values
array<string|int, mixed>

setExpirationDate()

private setExpirationDate(mixed $expiration) : mixed
Parameters
$expiration : mixed

setSortedIdList()

Set Sorted ID list

private setSortedIdList(array<string|int, mixed> $arrSort[, array<string|int, mixed> $sqlCondition = null ][, int $limit = null ][, int $offset = null ][, bool $listDownloadsOfCurrentLanguage = false ]) : array<string|int, mixed>
Parameters
$arrSort : array<string|int, mixed>

Array of sort values

$sqlCondition : array<string|int, mixed> = null

Array of conditions

$limit : int = null

Entries count

$offset : int = null

Offset value

$listDownloadsOfCurrentLanguage : bool = false

If true get Downloads count of current language otherwise get Downloads count of all language

Return values
array<string|int, mixed>

storeCategoryAssociations()

private storeCategoryAssociations() : mixed

storeDownloadRelations()

private storeDownloadRelations() : mixed

storeLocales()

Store locales

private storeLocales() : bool
Tags
global

ADONewConnection

Return values
bool

TRUE on success, otherwise FALSE

validateName()

private validateName(mixed $selectedLanguages) : mixed
Parameters
$selectedLanguages : mixed

        
On this page

Search results