MediaManager
extends MediaLibrary
in package
Media Manager
Tags
Table of Contents
Properties
- $_arrSettings : mixed
- $_objImage : mixed
- $_objTpl : mixed
- $_strOkMessage : mixed
- $archive : mixed
- $arrImageQualityValues : mixed
- $arrPaths : mixed
- $arrWebPaths : mixed
- $chmodFile : mixed
- $chmodFolder : mixed
- $dirLog : mixed
- $docRoot : mixed
- $fileLog : mixed
- $getAct : mixed
- $getData : mixed
- $getFile : mixed
- $getPath : mixed
- $highlightCCColor : mixed
- $highlightColor : mixed
- $highlightName : mixed
- $limitToArchive : int
- $pageTitle : mixed
- $path : mixed
- $shopEnabled : mixed
- $thumbHeight : mixed
- $thumbQuality : mixed
- $tmpPath : mixed
- $tmpPathName : mixed
- $webPath : mixed
- $act : string
- $cx : Cx
- $sortBy : mixed
- $sortDesc : mixed
Methods
- __construct() : mixed
- Constructor
- _getIcon() : string
- Gets the icon for the file
- _getIconPath() : string
- Returns icon's absolute path
- _getIconWebPath() : string
- Returns icon's web path
- _settings() : void
- Display and editing Media settings for a given archive
- createSettingsArray() : array<string|int, mixed>
- Create an array containing all settings of the media-module.
- editImage() : bool
- Edits and saves an image.
- getDirectoryTree() : array<string|int, mixed>
- Get files by search term
- getFileTypeIconWebPath() : string
- Get the web path to the icon used for displaying the file type of a file
- getImage() : image
- This method is used for the image preview.
- getImageSettings() : array<string|int, mixed>
- Returns the image settings array.
- getMediaPage() : void
- Gets the requested page
- handleRedirect() : void
- Redirect to the page by requested redirect url
- isFileValidToShow() : bool
- Return whether file is valid to show or not
- isIllegalFileName() : bool
- Check the the file name is illegal or not.
- renMedia() : void
- Renames a media file
- uploadFinished() : string
- this is called as soon as uploads have finished.
- _copyMedia() : void
- copies the media -> paste inserts the media
- _createNewDir() : void
- act: newDir creates a new directory through php or ftp
- _cutMedia() : void
- cuts the media -> paste insterts the media
- _deleteMedia() : void
- _deleteMedia2() : string
- _downloadMedia() : void
- Send a file for downloading
- _formatDate() : string
- _formatPerm() : string
- _formatSize() : string
- _formatType() : string
- _getDate() : string
- _getJavaScriptCodePreview() : string
- _getMDate() : string
- _getPerm() : string
- _getSize() : string
- _getType() : string
- _overviewMedia() : void
- Overview Media Data
- _pasteMedia() : void
- Inserts the file
- _pathCheck() : string
- _renameMedia() : void
- Rename Media Data
- _saveSettings() : bool
- Validate and save settings from $_POST into the database.
- _sortDirTree() : array<string|int, mixed>
- _sortingClass() : array<string|int, mixed>
- Sorting CSS classes for backend views
- _sortingIcons() : array<string|int, mixed>
- checkModule() : bool
- Checks whether the specified module is available and active.
- editMedia() : void
- Shows the image manipulation component.
- getUrl() : Url
- Returns a basic URL pointing back at the current archive
- getUrlBaseParams() : array<string|int, mixed>
- Returns the basic params to set to an URL for pointing to this archive
- isFileLocatedInCurrentArchive() : bool
- Verify that $path is located within the current archive ({@see static::$path}).
Properties
$_arrSettings
public
mixed
$_arrSettings
= array()
$_objImage
public
mixed
$_objImage
$_objTpl
public
mixed
$_objTpl
$_strOkMessage
public
mixed
$_strOkMessage
= ''
$archive
public
mixed
$archive
$arrImageQualityValues
public
mixed
$arrImageQualityValues
= array(5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100)
$arrPaths
public
mixed
$arrPaths
$arrWebPaths
public
mixed
$arrWebPaths
$chmodFile
public
mixed
$chmodFile
= 0644
$chmodFolder
public
mixed
$chmodFolder
= 0777
$dirLog
public
mixed
$dirLog
$docRoot
public
mixed
$docRoot
$fileLog
public
mixed
$fileLog
$getAct
public
mixed
$getAct
$getData
public
mixed
$getData
$getFile
public
mixed
$getFile
$getPath
public
mixed
$getPath
$highlightCCColor
public
mixed
$highlightCCColor
= '#ffe7e7'
$highlightColor
public
mixed
$highlightColor
= '#d8ffca'
$highlightName
public
mixed
$highlightName
= array()
$limitToArchive
public
int
$limitToArchive
= 1
$pageTitle
public
mixed
$pageTitle
$path
public
mixed
$path
$shopEnabled
public
mixed
$shopEnabled
$thumbHeight
public
mixed
$thumbHeight
= 80
$thumbQuality
public
mixed
$thumbQuality
= 80
$tmpPath
public
mixed
$tmpPath
= array()
$tmpPathName
public
mixed
$tmpPathName
= array()
$webPath
public
mixed
$webPath
$act
protected
string
$act
$cx
protected
Cx
$cx
Current Cx instance
$sortBy
protected
mixed
$sortBy
= 'name'
$sortDesc
protected
mixed
$sortDesc
= false
Methods
__construct()
Constructor
public
__construct() : mixed
Tags
_getIcon()
Gets the icon for the file
public
static _getIcon(string $file[, string $fileType = null ]) : string
Parameters
- $file : string
-
The File Path
- $fileType : string = null
-
(optional) The File type
Return values
string —The Icon name
_getIconPath()
Returns icon's absolute path
public
static _getIconPath() : string
Return values
string_getIconWebPath()
Returns icon's web path
public
static _getIconWebPath() : string
Return values
string_settings()
Display and editing Media settings for a given archive
public
_settings(int $archive) : void
Parameters
- $archive : int
-
Archive number to limit setting to
createSettingsArray()
Create an array containing all settings of the media-module.
public
createSettingsArray() : array<string|int, mixed>
Example: $arrSettings[$strSettingName] for the content of $strSettingsName
Tags
Return values
array<string|int, mixed> —$arrReturn
editImage()
Edits and saves an image.
public
editImage(array<string|int, mixed> $arrData) : bool
Parameters
- $arrData : array<string|int, mixed>
-
Contains $_POST array.
Return values
bool —True on success, false otherwise.
getDirectoryTree()
Get files by search term
public
getDirectoryTree([string $path = '' ][, string $searchTerm = '' ][, array<string|int, mixed> &$result = array() ][, bool $recursive = false ]) : array<string|int, mixed>
Parameters
- $path : string = ''
-
Path to search files
- $searchTerm : string = ''
-
Search term
- $result : array<string|int, mixed> = array()
-
Result files and directory array
- $recursive : bool = false
-
True to search recursive
Return values
array<string|int, mixed> —Files array by given search term
getFileTypeIconWebPath()
Get the web path to the icon used for displaying the file type of a file
public
static getFileTypeIconWebPath(string $file[, string $fileType = null ]) : string
Parameters
- $file : string
-
File of which the related file type icon path shall be returned. File must be an absolute file system path or an URL.
- $fileType : string = null
-
(optional) The file type of $file (as file extension). When supplied, the method will skip the file type detection and will run quite faster.
Return values
string —Web path to the icon.
getImage()
This method is used for the image preview.
public
getImage(array<string|int, mixed> $arrData) : image
Parameters
- $arrData : array<string|int, mixed>
-
Contains $_GET array.
Return values
image —On error,
getImageSettings()
Returns the image settings array.
public
getImageSettings() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —$arrImageSettings
getMediaPage()
Gets the requested page
public
getMediaPage() : void
Tags
handleRedirect()
Redirect to the page by requested redirect url
public
handleRedirect() : void
isFileValidToShow()
Return whether file is valid to show or not
public
isFileValidToShow(string $filePath, string $fileName) : bool
Parameters
- $filePath : string
-
Folder path to the file
- $fileName : string
-
File name
Return values
bool —True when file is valid to show, False otherwise
isIllegalFileName()
Check the the file name is illegal or not.
public
static isIllegalFileName(type $file) : bool
Parameters
- $file : type
Return values
boolrenMedia()
Renames a media file
public
renMedia() : void
uploadFinished()
this is called as soon as uploads have finished.
public
static uploadFinished(mixed $tempPath, mixed $tempWebPath, mixed $data, mixed $uploadId, mixed $fileInfos, mixed $response) : string
takes care of moving them to the right folder
Parameters
- $tempPath : mixed
- $tempWebPath : mixed
- $data : mixed
- $uploadId : mixed
- $fileInfos : mixed
- $response : mixed
Return values
string —the directory to move to
_copyMedia()
copies the media -> paste inserts the media
protected
_copyMedia() : void
act: copy
_createNewDir()
act: newDir creates a new directory through php or ftp
protected
_createNewDir(string $dirName) : void
Parameters
- $dirName : string
_cutMedia()
cuts the media -> paste insterts the media
protected
_cutMedia() : void
act: cut
_deleteMedia()
protected
_deleteMedia() : void
_deleteMedia2()
protected
_deleteMedia2(mixed $file) : string
Parameters
- $file : mixed
Return values
string_downloadMedia()
Send a file for downloading
protected
_downloadMedia() : void
_formatDate()
protected
_formatDate(mixed $date) : string
Parameters
- $date : mixed
Return values
string_formatPerm()
protected
_formatPerm(mixed $perm, mixed $key) : string
Parameters
- $perm : mixed
- $key : mixed
Return values
string_formatSize()
protected
_formatSize(mixed $size) : string
Parameters
- $size : mixed
Return values
string_formatType()
protected
_formatType(mixed $type) : string
Parameters
- $type : mixed
Return values
string_getDate()
protected
_getDate(mixed $file) : string
Parameters
- $file : mixed
Return values
string_getJavaScriptCodePreview()
protected
_getJavaScriptCodePreview() : string
Return values
string_getMDate()
protected
_getMDate(mixed $file) : string
Parameters
- $file : mixed
Return values
string_getPerm()
protected
_getPerm(mixed $file) : string
Parameters
- $file : mixed
Return values
string_getSize()
protected
_getSize(mixed $file) : string
Parameters
- $file : mixed
Return values
string_getType()
protected
_getType(mixed $file) : string
Parameters
- $file : mixed
Return values
string_overviewMedia()
Overview Media Data
protected
_overviewMedia() : void
Tags
_pasteMedia()
Inserts the file
protected
_pasteMedia() : void
act: paste
_pathCheck()
protected
_pathCheck(mixed $path) : string
Parameters
- $path : mixed
Return values
string_renameMedia()
Rename Media Data
protected
_renameMedia() : void
Tags
_saveSettings()
Validate and save settings from $_POST into the database.
protected
_saveSettings(int $archive) : bool
Parameters
- $archive : int
Tags
Return values
bool —Whether settings were saved or not
_sortDirTree()
protected
_sortDirTree(mixed $tree) : array<string|int, mixed>
Parameters
- $tree : mixed
Return values
array<string|int, mixed>_sortingClass()
Sorting CSS classes for backend views
protected
_sortingClass() : array<string|int, mixed>
Return values
array<string|int, mixed> —Classes indexed by field name
_sortingIcons()
protected
_sortingIcons() : array<string|int, mixed>
Return values
array<string|int, mixed>checkModule()
Checks whether the specified module is available and active.
protected
checkModule(mixed $module) : bool
Parameters
- $module : mixed
Return values
bool —True or false.
editMedia()
Shows the image manipulation component.
protected
editMedia() : void
Tags
getUrl()
Returns a basic URL pointing back at the current archive
protected
getUrl([array<string|int, mixed> $params = array() ]) : Url
Parameters
- $params : array<string|int, mixed> = array()
-
(optional) Additional params to set
Return values
Url —Base URL for pointing at current archive
getUrlBaseParams()
Returns the basic params to set to an URL for pointing to this archive
protected
getUrlBaseParams([array<string|int, mixed> $params = array() ]) : array<string|int, mixed>
Parameters
- $params : array<string|int, mixed> = array()
-
(optional) Additional params to set
Return values
array<string|int, mixed> —Key/Value array containing URL arguments
isFileLocatedInCurrentArchive()
Verify that $path is located within the current archive ({@see static::$path}).
protected
isFileLocatedInCurrentArchive(string $path) : bool
Parameters
- $path : string
-
Filesystem path to verify.
Return values
bool —True if $path is located within the current archive