Currently text files, images and flash files are defined as inline types
// By default, serve images, text, and flash content for display rather than
// download. Or if variable 'filefield_inline_types' is set, use its patterns.
$inline_types = variable_get('filefield_inline_types', array('^text/', '^image/', 'flash$'));
This is all good, but the problem is when say a text file is clicked, the current window is replaced with the text file. Instead the text file should open up in a new window?
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | inline_filetypes_should-966256-7.patch | 1.85 KB | subhojit777 |
| #6 | inline_filetypes_should-966256-6.patch | 1.83 KB | subhojit777 |
Comments
Comment #1
bibstha1 commentedAlso may be, put a default option to edit variable "filefield_inline_types" in filedepot settings interface itself? I don't see a way to edit this at the moment, except create my own module.
I might be wrong, is there any interface as such?
Comment #2
_randy commentedfilefield_inline_types is from the cck module called filefield which filedepot uses. Filedepot re-uses the same code lines to fetch which items are deemed to be inline.
Using the variable_get means that you can specify the inline file types as a default if the variable is not set.
Using Strongarm, I don't even see the filefield_inline_type as an exportable variable meaning that it is actually not set on a clean installation of the filefield module.
I suppose (technically) we could override that functionality by providing an interface for it. However currently there isn't one.
Hacking module/core code is sometimes a no-no, but you could override the setting in filedepot until an interface is created.
(changing this from a bug to a feature request)
Comment #3
JCB commentedHi Guys,
Here is how I got my Filedepot to supply popup box to save file instead of opening in same window.
First let me state that I think these 3 posts are all experiencing the same issue.
http://drupal.org/node/1543430
http://drupal.org/node/979482
http://drupal.org/node/966256
Here is my solution (derived from http://drupal.org/node/966256)
1. edit the filedepot.module file
2. Replace
$inline_types = variable_get('filefield_inline_types', array('^text/', '^image/', 'flash$'));with
$inline_types = ''3. Make sure you get both instances in the filedepot.module file
This worked for me.
Comment #4
_timpatrick commentedMoving this to closed unless any new issues arise
Comment #5
skuchy11 commentedThanks JCB :)
Comment #6
subhojit777Thanks @JCB. Here is a patch according to @JCB's suggestion in #3
Comment #7
subhojit777Better patch would be this.