Another way to add getfilecallback as follow:
$('#finder').elfinder({
url : 'php/connector.php',
getFileCallback : function(files, fm) {
return false;
}
});
Question
Does anybody know a way to disable or in some way modify the "open" functionality in elFinder?
I'm using this in an ASP.NET MVC site and have added additional server-side filtering for file permissions and whatnot. So users don't have direct access to files, everything has to go through the server-side component that feeds elFinder. Thus, whenever someone tries to directly open a file, they get a 404 response.
There are a couple of UX pieces affected by this:
dblclick
elFilder event and simply return false
. However, this carries the undesirable effect that one can't double-click folders to open them.'open'
option from the commands
configuration, but the option was still there. A lot of other items were removable (renaming, uploading, anything other than read-only access which I'm denying users in this case), but this one isn't for some reason.Has anybody run into this before and come up with any novel solutions? I'm not against modifying the actual JavaScript for elFinder as a last resort (that would make it operationally more of a pain if I ever want to upgrade elFinder).
Solution
Another way to add getfilecallback as follow:
$('#finder').elfinder({
url : 'php/connector.php',
getFileCallback : function(files, fm) {
return false;
}
});
OTHER TIPS
Copy the open.js file from js/commands sub-directory and paste it anywhere and then include it in your html file. Now Edit the copied open.js file on line 66 after:
if (!file.read) {
return dfrd.reject(['errOpen', file.name, 'errPerm']);
},
and put here:
return false;