PHP Class Contao\DC_Folder

Inheritance: extends DataContainer, implements listable, implements editable
Show file Open project: contao/core-bundle

Protected Properties

Property Type Description
$arrCounts array Counts
$arrFilemounts array Current filemounts
$arrMessages array Messages
$arrValidFileTypes array Valid file types
$blnCreateNewVersion boolean True if a new version has to be created
$blnIsDbAssisted boolean Database assisted
$strExtension string Current file extension
$strPath string Current path

Public Methods

Method Description
__construct ( string $strTable ) Initialize the object
__get ( string $strKey ) : mixed Return an object property
__set ( string $strKey, mixed $varValue ) Set an object property
ajaxTreeView ( string $strFolder, integer $level ) : string Generate a particular subpart of the tree and return it as HTML string
copy ( string $source = null, string $destination = null ) Recursively duplicate files and folders
copyAll ( ) Move all selected files and folders
create ( ) Create a new folder
cut ( string $source = null ) Move an existing file or folder
cutAll ( ) Move all selected files and folders
delete ( string $source = null ) Recursively delete files and folders
deleteAll ( ) Delete all files and folders that are currently shown
edit ( ) : string Auto-generate a form to rename a file or folder
editAll ( ) : string Auto-generate a form to edit all records that are currently shown
getPalette ( ) : string Return the name of the current palette
move ( boolean $blnIsAjax = false ) : string Move one or more local files to the server
protect ( ) Protect a folder
show ( ) : string Automatically switch to showAll
showAll ( ) : string List all files and folders of the file system
source ( ) : string Load the source editor
sync ( ) : string Synchronize the file system with the database
undo ( ) : string Automatically switch to showAll

Protected Methods

Method Description
generateTree ( string $path, integer $intMargin, boolean $mount = false, boolean $blnProtected = true, array $arrClipboard = null, array $arrFound = [] ) : string Render the file tree and return it as HTML string
getMD5Folders ( string $strPath ) : array Return an array of encrypted folder names
isMounted ( string $strFolder ) : boolean Return true if the current folder is mounted
isProtectedPath ( string $path ) : boolean Check if a path is protected (see #287)
isValid ( string $strFile ) : boolean Check a file operation
panel ( ) : string Build the sort panel and return it as string
save ( mixed $varValue ) Save the current value
searchMenu ( ) : string Return a search form that allows to search results using regular expressions

Method Details

__construct() public method

Initialize the object
public __construct ( string $strTable )
$strTable string

__get() public method

Return an object property
public __get ( string $strKey ) : mixed
$strKey string
return mixed

__set() public method

Set an object property
public __set ( string $strKey, mixed $varValue )
$strKey string
$varValue mixed

ajaxTreeView() public method

Generate a particular subpart of the tree and return it as HTML string
public ajaxTreeView ( string $strFolder, integer $level ) : string
$strFolder string
$level integer
return string

copy() public method

Recursively duplicate files and folders
public copy ( string $source = null, string $destination = null )
$source string
$destination string

copyAll() public method

Move all selected files and folders
public copyAll ( )

create() public method

Create a new folder
public create ( )

cut() public method

Move an existing file or folder
public cut ( string $source = null )
$source string

cutAll() public method

Move all selected files and folders
public cutAll ( )

delete() public method

Recursively delete files and folders
public delete ( string $source = null )
$source string

deleteAll() public method

Delete all files and folders that are currently shown
public deleteAll ( )

edit() public method

Auto-generate a form to rename a file or folder
public edit ( ) : string
return string

editAll() public method

Auto-generate a form to edit all records that are currently shown
public editAll ( ) : string
return string

generateTree() protected method

Render the file tree and return it as HTML string
protected generateTree ( string $path, integer $intMargin, boolean $mount = false, boolean $blnProtected = true, array $arrClipboard = null, array $arrFound = [] ) : string
$path string
$intMargin integer
$mount boolean
$blnProtected boolean
$arrClipboard array
$arrFound array
return string

getMD5Folders() protected method

Return an array of encrypted folder names
protected getMD5Folders ( string $strPath ) : array
$strPath string
return array

getPalette() public method

Return the name of the current palette
public getPalette ( ) : string
return string

isMounted() protected method

Return true if the current folder is mounted
protected isMounted ( string $strFolder ) : boolean
$strFolder string
return boolean

isProtectedPath() protected method

Check if a path is protected (see #287)
protected isProtectedPath ( string $path ) : boolean
$path string
return boolean

isValid() protected method

Check a file operation
protected isValid ( string $strFile ) : boolean
$strFile string
return boolean

move() public method

Move one or more local files to the server
public move ( boolean $blnIsAjax = false ) : string
$blnIsAjax boolean
return string

panel() protected method

Build the sort panel and return it as string
protected panel ( ) : string
return string

protect() public method

Protect a folder
public protect ( )

save() protected method

Save the current value
protected save ( mixed $varValue )
$varValue mixed

searchMenu() protected method

Return a search form that allows to search results using regular expressions
protected searchMenu ( ) : string
return string

show() public method

Automatically switch to showAll
public show ( ) : string
return string

showAll() public method

List all files and folders of the file system
public showAll ( ) : string
return string

source() public method

Load the source editor
public source ( ) : string
return string

sync() public method

Synchronize the file system with the database
public sync ( ) : string
return string

undo() public method

Automatically switch to showAll
public undo ( ) : string
return string

Property Details

$arrCounts protected property

Counts
protected array $arrCounts
return array

$arrFilemounts protected property

Current filemounts
protected array $arrFilemounts
return array

$arrMessages protected property

Messages
protected array $arrMessages
return array

$arrValidFileTypes protected property

Valid file types
protected array $arrValidFileTypes
return array

$blnCreateNewVersion protected property

True if a new version has to be created
protected bool $blnCreateNewVersion
return boolean

$blnIsDbAssisted protected property

Database assisted
protected bool $blnIsDbAssisted
return boolean

$strExtension protected property

Current file extension
protected string $strExtension
return string

$strPath protected property

Current path
protected string $strPath
return string