CKFinder 3 Documentation

CKFinder.Models.Folder

Hierarchy

Backbone.Model
CKFinder.Models.Folder

Subclasses

Represents the folder model. A folder model extends Backbone.Model. To access its attributes, use the get( "attributeName" ) method.

Defined By

Properties

CKFinder.Models.Folder
: CKFinder.ACL
Folder's ACL definition. ...

Folder's ACL definition.

 if ( folder.get( 'acl' ).fileDelete ) {
     // Files in this folder can be deleted
 }
CKFinder.Models.Folder
: Boolean
Whether the folder contains subfolders. ...

Whether the folder contains subfolders.

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

Defaults to: false

CKFinder.Models.Folder
: Boolean
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

CKFinder.Models.Folder
: Boolean
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.Folder
: String
A folder's name. ...

A folder's name.

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

Defaults to: ''

CKFinder.Models.Folder
: CKFinder.Models.Folder

The parent folder.

The parent folder.

CKFinder.Models.Folder
: String
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.Folder
: String
Optional attribute with the folder's URL. ...

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

Methods

Defined By

Instance methods

CKFinder.Models.Folder
( ) : String
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
CKFinder.Models.Folder
( [data] ) : 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
CKFinder.Models.Folder
( ) : CKFinder.Models.Folder
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

CKFinder.Models.Folder
( ) : 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.

Defined By

Static methods

CKFinder.Models.Folder
( folderName ) : Booleanstatic
Returns true if the folder name is valid. ...

Returns true if the folder name is valid.

var Folder = CKFinder.require( 'CKFinder/Models/Folder' );
console.log( Folder.isValidName( 'foo.bar' ) );

Parameters

  • folderName : String

    The folder name.

Returns

  • Boolean