CKFinder 3 Documentation

CKFinder.Models.ResourceType

Hierarchy

Backbone.Model
CKFinder.Models.Folder
CKFinder.Models.ResourceType

Represents the resource type (root folder) model.

Defined By

Properties

Folder's ACL definition. ...

Folder's ACL definition.

 if ( folder.get( 'acl' ).fileDelete ) {
     // Files in this folder can be deleted
 }
CKFinder.Models.ResourceType
: Array
The list of file extensions that can be uploaded to the resource type. ...

The list of file extensions that can be uploaded to the resource type.

var currentFolder = finder.request( 'folder:getActive' );
var resourceType = currentFolder.getResourceType();
// 'gif,jpg,png'
var allowedExtensions = resourceType.get( 'allowedExtensions' );
CKFinder.Models.ResourceType
: Array
The list of file extensions that cannot be uploaded to the resource type. ...

The list of file extensions that cannot be uploaded to the resource type.

var currentFolder = finder.request( 'folder:getActive' );
var resourceType = currentFolder.getResourceType();
// Usually not set as whitelisting is safe, while blacklisting isn't.
var deniedExtensions = resourceType.get( 'deniedExtensions' );
Whether the folder contains subfolders. ...

Whether the folder contains subfolders.

if ( folder.get( 'hasChildren' ) ) {
    // This folder has folders inside
}

Defaults to: false

Indicates that the folder has not been fully loaded yet, i.e. ...

Indicates that the folder has not been fully loaded yet, i.e. its ACL is not known.

folder.get( 'isPending' );

Defaults to: false

Indicates that a folder is a root element (a resource type). ...

Indicates that a folder is a root element (a resource type).

folder.get( 'isRoot' );

Defaults to: false

CKFinder.Models.ResourceType
: Number
The maximum size of the file (in bytes) that can be uploaded to the resource type. ...

The maximum size of the file (in bytes) that can be uploaded to the resource type.

var currentFolder = finder.request( 'folder:getActive' );
var resourceType = currentFolder.getResourceType();
var maxSize = resourceType.get( 'maxSize' );
A folder's name. ...

A folder's name.

var currentFolder = finder.request( 'folder:getActive' );
if ( confirm( 'Delete ' + currentFolder.get( 'name' ) + '?')) {
    // Delete...
}

Defaults to: ''

The parent folder.

The parent folder.

The name of the resource type this folder belongs to. ...

The name of the resource type this folder belongs to.

// E.g. 'Files' or 'Images'
folder.get( 'resourceType' );

Defaults to: ''

CKFinder.Models.ResourceType
: String
An optional attribute with the folder's URL. ...

An optional attribute with the folder's URL. Note: Not always available, use CKFinder.Models.Folder.getUrl to always get the correct folder's URL.

Overrides: CKFinder.Models.Folder.url

Defined By

Methods

Returns a hash associated with the folder or with the parent folder. ...

Returns a hash associated with the folder or with the parent folder. Hashes are used in Ajax requests to ensure that the browser does not return cached results for requests which must return the current value.

Returns

  • String
Returns the folder path. ...

Returns the folder path. A path is a virtual description of a folder location within a resource type.

// The path to "foo->bar" will be '/foo/bar/'.
var path = folder.getPath();

// The same path will now also contain the name of the resource type at the beginning (e.g. 'Files').
// The path is now 'Files:/foo/bar/'.
var path = folder.getPath( { full:true } );

Parameters

  • data : Object (optional)
    • full : Boolean

      Gets the path with the resource type.

Returns

  • string
Returns the resource type to which the folder belongs to (the top root folder). ...

Returns the resource type to which the folder belongs to (the top root folder).

var currentFolder = finder.request( 'folder:getActive' );
var resourceType = currentFolder.getResourceType();

Returns

( ) : String|Boolean
Returns the folder URL. ...

Returns the folder URL. Returns {CKFinder.Models.Folder.url} if available, if not then the URL is calculated using the names of the parent folders.

Returns

  • String|Boolean

    The URL to a folder. If the folder is not accessible through a public URL, false is returned instead.

CKFinder.Models.ResourceType
( extension ) : Boolean
Checks if an extension is allowed for this resource type. ...

Checks if an extension is allowed for this resource type. Note: This check transforms the extension to lower case before comparison.

Parameters

  • extension : String

    The file extension.

Returns

  • Boolean

    true if an extension is allowed for this resource type.

CKFinder.Models.ResourceType
( operationName ) : Boolean
Checks if an operation with a given name should be tracked for this resource type. ...

Checks if an operation with a given name should be tracked for this resource type.

Parameters

  • operationName : String

    Operation name.

Returns

  • Boolean

    true if operation progress should ba tracked.