Quote:
Originally Posted by Renada
Hi Andrew,
Thank you so much for this mod, it's incredible.
Could you tell me if its possible, and if so how I do it, to set this as a "read only" mod instead of a download?
For example, if someone clicks on a text file could it "open" as opposed to them downloading it?
Thanks for your help.
Regards,
Renada
|
If you set the mimetype information (VB/admin/attachments) for text files to "Content-type: text/plain", then a simple left click on an entry which is a text file opens automatically in the browser window. This works correctly, as far as I can tell, with IE, Firefox and Opera.
However, the user can still force a "save as" using right click with the mouse, or by doing a "view source" and then save. You can disable the 'right click' menu by adding a bit of javascript to the page.
For example, if you edit clientscript/ldm_global.js and add these lines to the end:
Code:
document.oncontextmenu = function(){return false}
if(document.layers) {
window.captureEvents(Event.MOUSEDOWN);
window.onmousedown = function(e){
if(e.target==document)return false;
}
}
else {
document.onmousedown = function(){return false}
}
then I think you'll disable the right click menu throughout LDM.