I've tried to build on some of the work by javanaut.

This is my first attempt at PHP, so I'd love for someone to review it. Actually, it would be very good if someone could take a look at the code for a security point of view.

I hope goba is going to continue development on this module, as it has pretty interesting functionality for druapl.

Anyway, the changes:

changes by cjm:
functional:
- rewritten node display functionality - each mode properly handles its own contents, but
does so by using URL parameters.
- pages can now have a body above the directory listing.
- pages display a directory listing instead of rewriting the breadcrumbs
(module page unchanged)
- provided work around for directory icon display bug.
- made base directory display via menu/URL an option
- made showing .** files an option
- stopped the attemped display of non-readable directories.
- pages show their url alias if present
other:
- added some standard icons
- added a postgres compatible db file

comments:
- the workhorse functions are a bit clumsy in order to allow nodes to work
with URL arguments and the module page to work with the URL/directories

CommentFileSizeAuthor
#2 filebrowser_nodeified_1.patch12.65 KBcjm
filebrowser_update.tar.gz18.28 KBcjm
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Tobias Maier’s picture

it would be nice if you could provide a patch-file, like every one else does it.
see bhttp://drupal.org/node/22568
a patch-file is easier to review.

it would be good if you could port your changes to the CVS-Head.
Because 4.5 is not anymore supported if 4.7 gets released.

cjm’s picture

hi tobias

sorry, the patch is included in the tar file. have included it with this post anyway.

also about updating to cvs, I would love for this to happen to, and I might be able to do this in the near future, but I'm still pretty new to drupal... I'm not exactly sure at this stage how much change will be needed. I'm not actually sure how 'drupal-ready' it is now... I have a feeling that support for theming needs work.

fax8’s picture

I'm having problems when I apply the patch

fabio@beta:~/public_html/fabiovaresano.1.vg/modules/filebrowser$ patch -p0 -u < filebrowser_nodeified_1.patch
patching file README.txt
patching file filebrowser.module
Hunk #9 succeeded at 442 with fuzz 2.

Maybe I made a mistake, I'm not an expert of patch.

fax8’s picture

problem unserstood.
The patch you submitted is for filebrowser.module ver 1.1
when the latest is 1.2

I don't know if I did something wrong but I can't see some of the changes you
was talking about.

-pages can now have a body above the directory listing.
I can't see them. I can add body to the node (theisn't a form for body)

- made showing .** files an option
only option here is for defining icons folder

- provided work around for directory icon display bug.
here they displays not good.

bomarmonk’s picture

The changes are there (apply the patch in the tar file to the filebrowser module in the tar file-- don't forget the database tables need to be added):

Create content now lists a file-browser page!
I can add instructions or anything to this node body.

Very nice. It would also be nice if there was a way to hide child directories or folders-- in my case, I want the browser and user of the site to see only the html files in the parent directory. I'll poke around and see if this is possible! Thanks for the work. Is there a patch that works with version 1.2?

bomarmonk’s picture

BTW this is working in 4.6.5!

Gábor Hojtsy’s picture

Status: Needs review » Needs work

I have just updated the module for 4.7 (it is not branched yet for 4.7, but the HEAD version now works with 4.7). I fully intend to keep the module as simple as possible. Therefore as I have just explained to javanaut, the complication brought in by these patches is not what is the future of this module IMHO. Although I look forward on refactoring some code to an include file to share between the simple filebrowser and and 'advanced' one, if any of you are interested in maintaining the advanced version.

bernardl’s picture

I'm a bit confused here. The patch that's included in the tarball and the one posted in this thread (filebrowser_nodeified_1.patch) seems to be different. The one posted in the thread seems to be the original patch by javanut - can somebody please confirm? Are you supposed to apply both patches?

Secondly, after applying the patch from the tarball, my filebrowser lost formatting - i.e. I do not see icons or columns - everything's just plain text. Anybody knows where to start looking?

I currently am running javanut's original patch - not sure if things got messed up...

Thanks!

bomarmonk’s picture

I'm definitely interested in a more advanced version of this module, with the ability to node-ify browser pages and add content (instructions, etc) to the filebrowser node (as included in cjm's patch). The latest updates by cjm give this module more flexibility and without this, the module really wouldn't be useable for my needs. I am also looking for a way to only display certain file types (only .html files and no subfolders).

In the end, this is a good module in its original form, but it is a very flexible and useable module with some of these latest updates. In some ways, it seems a shame to split these features into another module, as they don't prevent the module from being used in a more basic way... my two cents. I know from a maintenance perspective, it gets more difficult to update and preserve as the module gets more complicated, but this seems to be a force that hurts useability and scatters features into too many modules. But I shouldn't talk: I am not currently maintaining any modules.

Gábor Hojtsy’s picture

Version: 4.5.x-1.x-dev » 4.7.x-1.x-dev
Status: Needs work » Closed (works as designed)

This would be a completely different module. Filebrowser is a simple FTP-like browser. It does not need to be a catch-all solution. Please open a new project if you would like to have something this different.