Documentation on hiding subdirectories or displaying only certain file types
bomarmonk - September 16, 2006 - 00:47
| Project: | Filebrowser Extensions |
| Version: | 4.7.x-1.x-dev |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
There may be a way to do this already (if so, sorry). I'm simply looking for a way to not display subdirectories when embedding the content of a directory in a node (it could just be a snippet to include in the body of the node).
Any ideas?
Thanks.

#1
Not at all?
I'm remodelling the configuration a lot. This is a fair request.
I'll be adding filename filters as whitelists (eg *.jpg) or blacklists (eg CVS)
Didn't think about dirs on or off.
Need to test my latest version with snippets, I guess.
#2
Thanks for the positive response to my feature request. I'll keep my eyes peeled for the appearance of this... is this going to turn into a more developed stand-alone version of the filebrowser module? Or is the other filebrowser actually going to be updated with your hooks? Just curious.
#3
I've had to branch totally from the original :-}
I developed the need to have different instances rooted at different places, and doing so ripped out the last useful ties I had with the other version.
My current version is now stand-alone. And a bit trickier to configure (but more configurable - layers of authentication are now possible. Not implimented, but possible)
The howto for embedded snippets has changed drastically (and not documented right any more) and it may have a dependancy issue or two (I gotta rebuild a machine or two before I try a fresh install) but I'll upload the latest to CVS nowish... just for fun.
Additions include - Support for out-of-webroot 'files' directory (lacking in original)
- support for 'private' file service (required for #1)
- support for multiple ways and means of viewing multiple places, but configurable only via admin panel (not request string) for security reasons.
- support for filename filtering to select or restrict which files get shown - but no filtering of directories yet sorry.
#4
Current CVS now has this feature. Configured via the admin/settings/filebrowser_extensions page.
Um, in-page embeds still need re-documenting...
#5
Does the CVS version work with 4.7? Also, any idea on how to embed that filebrowser page? Same as before? And finally, is the CVS version a stand alone module?
Thanks for any information.
#6
This module is now stand-alone, yes.
The CVS currently published is built against Drupal 4.7 - I'm not trying to catch up to Drupal HEAD.
Embedding can be done, but I'm not sure how yet. The doc needs to be rewritten to update the examples. That;ll happen soonish.
#7
#8
I'm changing the title, category, and reopening. I still don't see any explanation of how to do this with this module. Can the readme be updated with an explanation? Thanks for any help.
#9
#10
You can open a seperate ticket for this, y'know :)
On testing, it seems that due to the way file_scan_directory() does its matching and masking, trying to set the glob pattern isn't working as expected.
First, it's not really a glob pattern, it's an eregexp.
Second, it doesn't make allowances for directories, so asking for
.*\.jpgwill list the jpgs, but not the directories in the same place, which makes browsing not a happening thing.The interface at /admin/settings/filebrowser_extensions looks like: ... um I'll attach a dump
I think it's fair to say the "which files to show" field does NOT work properly.
I may have to build my own version of file_scan_directory() to get more control over it.
#11
If you just want to hide all the subfolders, just add the below line to the profile. I have not tried (dont know if any option is there) selective hiding though.
'hide_directories' => TRUE,This worked when I tested it:
<?php
$folder = 'foldername';
$profile = array(
'cols' => 'expander;icon;name',// also used as headers. (no tablesort)
'render' => 'table',
'root' => 'browserroot', //default -> <a href="http://site.com/files
" title="http://site.com/files
" rel="nofollow">http://site.com/files
</a> 'rel_url' => 'http://site.com/browserroot',
'hide_directories' => TRUE,
//'recursive' => TRUE, or FALSE
);
print filebrowser_embed($folder,$profile);
?>
#12
Thank you! I'll give it a try.
#13
I still can't get an embedded file list to display without the subdirectories. Any ideas on what little PHp snippet I need to include in the body of a node? Thanks for any help.
#14
This module is retired