Skip to content

Client configuration options

wolfgangihloff edited this page Oct 5, 2011 · 5 revisions

TODO this page is still not finished

This is a list of the available options for elFinder client (javascript) part, along with their default values. Options are specified by passing an object with certain properties into the first argument of $.elfinder(). Example:

var elfOptions = {
    url: 'php/connector.php',
    lang: 'en'
}
var elf = $('#elfinder').elfinder(elfOptions).elfinder('instance');   

Note: This page is in progress and as such will not list everything. For further documentation, see inside the js/elFinder.options.js file.

requestType

The AJAX request type. Available choices are post and get.

Data type: string

Default value: 'get'

dragUploadAllow

Allow to drag and drop to upload files.

Data type: string

Default value: 'auto'

customData

Data to append to all requests and to upload files. These can be any extra data that must be passed to the connector script. For example, you could use these to pass authentication information.

Data type: object

Default value: {}

lang

The interface lang to use. Can currently be one of the following: ar, cs, de, en, fr, jp, nl, pt_BR, ru

Data type: string

Default value: 'en'

cssClass

Additional css class for filemanager node. This will be applied to the main filemanager container.

Data type: string

Default value: ''

ui

UI plugins to load. Currently dir, ui, and dialogs loads always.

Data type: array

Default value: ['toolbar', 'places', 'tree', 'path', 'stat']

uiOptions

Specifies the configuration for the elFinder UI.

Data type: object

Default value:

// toolbar configuration
toolbar : [
	['back', 'forward'],
	// ['reload'],
	// ['home', 'up'],
	['mkdir', 'mkfile', 'upload'],
	['open', 'download', 'getfile'],
	['info'],
	['quicklook'],
	['copy', 'cut', 'paste'],
	['rm'],
	['duplicate', 'rename', 'edit', 'resize'],
	['extract', 'archive'],
	['search'],
	['view'],
	['help']
],
// directories tree options
tree : {
	// expand current root on init
	openRootOnLoad : true,
	// auto load current dir parents
	syncTree : true
},
// navbar options
navbar : {
	minWidth : 150,
	maxWidth : 500
}

onlyMimes

Display only certain files based on their mime type.

Data type: array

Default value: []

Example:

onlyMimes: ["image"] // display all images
onlyMimes: ["image/png", "application/x-shockwave-flash"] // display png and flash

sort

How to sort files in a directory view.

Data type: string

Default value: nameDirsFirst

Available options:

  • 'nameDirsFirst' - sort by name, directory first
  • 'kindDirsFirst' - sort by kind, name, directory first
  • 'sizeDirsFirst' - sort by size, name, directory first
  • 'name' - sort by name
  • 'kind' - sort by kind, name
  • 'size' - sort by size, name

width

The width of the elFinder main interface.

Data type: string or number

Default value: 'auto'

Available options: Can be the string 'auto' or any number measurement (in pixels).

height

The height of the elFinder main interface.

Data type: string or number

Default value: 400

Available options: Can be the string 'auto' or any number measurement (in pixels).

resizable

Whether or not the elFinder interface will be resizable. This only works if jQuery UI has the resizable plugin loaded.

Data type: boolean

Default value: true

notifyDelay

Timeout before open notifications dialogs.

Data type: number

Default value: 500

validName

Used to validate file names. By default, no empty names or '..' allowed.

Data type: boolean, regexp, or function

Default value: false

Example:

// disable names with spaces
validName: /^[^\s]$/

contextmenu

The configuration for the right-click context menu. Need some better documentation on this.

Default value:

contextmenu : {
// navbarfolder menu
navbar : 
  ['open', '|', 'copy', 'cut', 'paste', 'duplicate', '|', 'rm', '|', 'info'],
// current directory menu
cwd    : 
  ['reload', 'back', '|', 'upload', 'mkdir', 'mkfile', 'paste', '|', 'info'],
// current directory file menu
files  : 
  ['getfile', '|','open', 'quicklook', '|', 'download', '|', 'copy', 'cut', 'paste', 'duplicate', '|', 'rm', '|', 'edit', 'rename', 'resize', '|', 'archive', 'extract', '|', 'info']
},

Clone this wiki locally