Looking through the documentation , I also could not find any event, for example, extension points.
However, looking at some source, I found sendCommandPostmetho d in CKFinder.dataTypes.Connector, which starts every time something needs to be sent to the server. So, at every important event, such as File / Folder - Rename / Delete / Move.
This way you can easily create your own plugin in which you can access the CKFinderAPI instance , and from there you can override sendCommandPostand add custom logic
CKFinder.addPlugin( 'myplugin', function( api ) {
var orginalsendCommandPost = api.connector.sendCommandPost;
api.connector.sendCommandPost = function() {
var result = orginalsendCommandPost.apply(this, arguments);
console.log(arguments[0]);
console.log(JSON.stringify(arguments[1]));
return result;
}
} );
And register the plugin:
config.extraPlugins = "myplugin";
var ckfinder = new CKFinder( config );
source
share