Code Index

Namespaces

Classes


Class CKFinder.dataTypes.Folder

Class Summary
Constructor Attributes Constructor Name and Description
 
CKFinder.dataTypes.Folder(app, type, name, path, url, hasChildren, acl)
Folder data type.
Field Summary
Field Attributes Field Name and Description
<static>  
CKFinder.dataTypes.Folder.isBasket
Indicated that this folder is the Basket folder.
 
acl
User permissions inside of a folder.
 
Array of child folders.
 
Indicates whether folder has child folders.
 
Folder's number in the folders array.
 
Indicates whether folder has been changed (renamed, removed).
 
Indicates whether folder is opened.
 
Indicates whether folder is a resource type.
 
Folder name.
 
Parent folder.
 
Name of resource type where folder belongs to.
Method Summary
Method Attributes Method Name and Description
 
Closes a folder.
 
createNewFolder(newFolderName)
Creates new subfolder.
 
Deselects a folder.
 
getChildren(callback, force)
Returns child folders.
 
getFiles(callback)
Request list of files in a folder.
 
Returns nesting level of a folder.
 
Returns path to a folder.
 
Returns resource type of this folder.
 
Returns url to the server connector used to upload files.
 
Returns Url to a folder.
 
Checks whether folder is selected.
 
Recurrently calls callback on all loaded children (of any depth).
 
open(noLoad)
Opens a folder.
 
Deletes a folder (from the server).
 
rename(New)
Renames a folder.
 
Selects a folder.
 
showFiles(selectedFilename)
Displays files in a folder to the user.
 
Toggle between opening and closing a folder.
 
Returns a string representation of a folder.
 
Update folder reference if needed.
Class Detail
CKFinder.dataTypes.Folder(app, type, name, path, url, hasChildren, acl)
Since: 2.0
Folder data type.
Note: the CKFinder.dataTypes namespace is not directly accessible (CKFinder.dataTypes is undefined).
Data types are used internally by CKFinder and returned by many functions, like CKFinderAPI#getSelectedFolder.
var folder = api.getSelectedFolder();
if ( folder )
	alert( folder.getUrl() );
Parameters:
{Undefined} app
{Undefined} type
{Undefined} name
{Undefined} path
{Undefined} url
{Undefined} hasChildren
{Undefined} acl
Field Detail
<static> {Boolean} CKFinder.dataTypes.Folder.isBasket
Since: 2.0
Indicated that this folder is the Basket folder.
NO EXAMPLE AVAILABLE

{CKFinder.dataTypes.Acl} acl
Since: 2.0
User permissions inside of a folder.
alert( api.getSelectedFolder().acl.folderView );

{Array} childFolders
Since: 2.0
Array of child folders.

{Boolean} hasChildren
Since: 2.0
Indicates whether folder has child folders.
alert( api.getSelectedFolder().hasChildren );

{Integer} index
Since: 2.0
Folder's number in the folders array.

{Boolean} isDirty
Since: 2.0
Indicates whether folder has been changed (renamed, removed).
alert( api.getSelectedFolder().isDirty );

{Boolean} isOpened
Since: 2.0
Indicates whether folder is opened.
alert( api.getSelectedFolder().isOpened );

{Boolean} isRoot
Since: 2.0
Indicates whether folder is a resource type.
alert( api.getSelectedFolder().isRoot );

{String} name
Since: 2.0
Folder name.

{CKFinder.dataTypes.Folder} parent
Since: 2.0
Parent folder. Resource types don't have parent folder (parent is null).
alert( api.getSelectedFolder().parent );

{String} type
Since: 2.0
Name of resource type where folder belongs to.
Method Detail
{Undefined} close()
Since: 2.0
Closes a folder.
api.getSelectedFolder().close();

{Undefined} createNewFolder(newFolderName)
Since: 2.0
Creates new subfolder.
var folder = api.getSelectedFolder();
folder.createNewFolder( 'newDirectory' );
Parameters:
{String} newFolderName
New folder name.

{Undefined} deselect()
Since: 2.0
Deselects a folder.
api.getSelectedFolder().deselect();

{Array} getChildren(callback, force)
Since: 2.0
Returns child folders.
api.getSelectedFolder().getChildren( function( folders ) {
	api.log( "Loaded " + folders.length + " folders" );
}, true);
Parameters:
{Function} callback
The function to be called on all child folders.
{Boolean} force
Force getting folder list from the server.
Returns:
{Array}

{Undefined} getFiles(callback)
Since: 2.0
Request list of files in a folder.
api.getSelectedFolder().getFiles( function( files ) {
		var folderSize = 0;
		for ( var i = 0 ; i < files.length ; i++ )
			folderSize += files[i].size;
		api.openMsgDialog( "Size of all files in a folder: " + folderSize + "KB" );
	}, true);
Parameters:
{Function} callback
The function to be called on all files.

{Undefined} getNestingLevel()
Since: 2.0
Returns nesting level of a folder.
api.getSelectedFolder().getNestingLevel();

{String} getPath()
Since: 2.0
Returns path to a folder.
NO EXAMPLE AVAILABLE
Returns:
{String} Path to a folder.

{CKFinder.dataTypes.ResourceType} getResourceType()
Since: 2.0
Returns resource type of this folder.
var resourceType = api.getSelectedFolder().getResourceType();
Returns:
{CKFinder.dataTypes.ResourceType}

{String} getUploadUrl()
Since: 2.0
Returns url to the server connector used to upload files.
Returns:
{String} Upload url.

{String} getUrl()
Since: 2.0
Returns Url to a folder.
Returns:
{String} Url to a folder.

{Boolean} isSelected()
Since: 2.0
Checks whether folder is selected.
Returns:
{Boolean} True if selected.

{Undefined} mapLoadedDescendants(callback)
Since: 2.0
Recurrently calls callback on all loaded children (of any depth).
var folder = api.getSelectedFolder();
folder.mapLoadedDescendants( function( child ) {
	alert(child.getUrl());
} );
Parameters:
{Function} callback

{Undefined} open(noLoad)
Since: 2.0
Opens a folder.
var folder = api.getSelectedFolder();
if ( folder && folder.hasChildren )
	folder.childFolders[0].open();
Parameters:
{Boolean} noLoad
Don't expand folder if it wasn't loaded yet.

{Undefined} remove()
Since: 2.0
Deletes a folder (from the server).
var folder = api.getSelectedFolder();
folder.remove();

{Undefined} rename(New)
Since: 2.0
Renames a folder.
var folder = api.getSelectedFolder();
folder.rename( 'New name' );
Parameters:
{String} New
folder name.

{Undefined} select()
Since: 2.0
Selects a folder.
api.getSelectedFolder().parent.select();

{Undefined} showFiles(selectedFilename)
Since: 2.0
Displays files in a folder to the user.
// Display files in a parent folder.
var parent = api.getSelectedFolder().parent;
parent.select();
parent.showFiles();
Parameters:
{String} selectedFilename
Name of the file to select (optional).

{Undefined} toggle()
Since: 2.0
Toggle between opening and closing a folder.
var folder = api.getSelectedFolder();
folder.close();
// Calling toggle() on closed folder will open it again.
folder.toggle();

{String} toString()
Since: 2.0
Returns a string representation of a folder.
Returns:
{String} Path to a folder.
See:
CKFinder.dataTypes.Folder#getPath

{Undefined} updateReference()
Since: 2.0
Update folder reference if needed. Use it folder (or it's parent) could be reloaded since creating the reference.
NO EXAMPLE AVAILABLE
Returns:
{Undefined} CKFinder.dataTypes.Folder

Copyright © 2007-2015, CKSource - Frederico Knabben. All rights reserved.