Going through the documentation I was also not able to find any event like extension points.
However looking through some of the source I've found the sendCommandPost
method on the CKFinder.dataTypes.Connector
which gets invoked every time when somethings needs to be send to the server. So on every important event like File/Folder - Rename/Delete/Move.
So you can easily create a custom plugin where you can access the CKFinderAPI instance and from there you can override the sendCommandPost
and add you custom logic
CKFinder.addPlugin( 'myplugin', function( api ) {
var orginalsendCommandPost = api.connector.sendCommandPost;
api.connector.sendCommandPost = function() {
// call the original function
var result = orginalsendCommandPost.apply(this, arguments);
// commandname as string: 'CreateFolder', 'MoveFiles', 'RenameFile', etc
console.log(arguments[0]);
// arguments as object
console.log(JSON.stringify(arguments[1]));
return result;
}
} );
And registering the plugin:
config.extraPlugins = "myplugin";
var ckfinder = new CKFinder( config );