Page 1 of 1
Selecting an image from a module admin (Announcing plFileHandler)
Posted: Sat Nov 07, 2009 12:38 am
by plger
Hi community,
I think all module developers have been faced with the problem of letting non-geek users choose files (from the server or upload them) for content modules (be it content types, news or custom modules). Over time I used different solutions, and I made my last one an independent module that could be (easily) called from any other module to provide a file-selection interface. I've shared this module on the Forge ( plFileHandler ), and would like to invite anyone interested to check it out (the module includes a sample of it in
action) and share his thoughts...
Thanks,
Pierre-Luc
(Notes:
- Module relies on javascript
- Beta means I haven't tested on any other computer than mine, and just in firefox)
Re: Selecting an image from a module admin (Announcing plFileHandler)
Posted: Sat Nov 07, 2009 6:25 am
by vilkis
I can't find this module in Forge. May you provide a link?
vilkis
Re: Selecting an image from a module admin (Announcing plFileHandler)
Posted: Sat Nov 07, 2009 8:35 am
by Jos
You can find the project in the Forge at
http://dev.cmsmadesimple.org/projects/plfilehandler
And it is in ModuleManager now too.
Re: Selecting an image from a module admin (Announcing plFileHandler)
Posted: Sat Nov 07, 2009 8:57 am
by plger
(Thanks Jos... quite strange, the module doesn't seem indexed at all for the Forge's search)
Re: Selecting an image from a module admin (Announcing plFileHandler)
Posted: Fri Nov 19, 2010 11:10 pm
by george_gr
Is it possible to select the upload folder with this module ? Its wonderful in all other aspects...
Re: Selecting an image from a module admin (Announcing plFileHandler)
Posted: Sat Nov 20, 2010 4:44 pm
by plger
george_gr wrote:
Is it possible to select the upload folder with this module ? Its wonderful in all other aspects...
You can use the "startdir" parameter when calling the module. This, however, limits you to choosing a folder somewhere within the uploads folder.
I'll try to think of adding the possibility to specify a default upload folder in the module preferences in the next release (to help me not to forget, you're hereby invited to post a feature request).
plger
Re: Selecting an image from a module admin (Announcing plFileHandler)
Posted: Sun Nov 21, 2010 2:45 pm
by spcherub
Is it different from the GBFilePicker?
Re: Selecting an image from a module admin (Announcing plFileHandler)
Posted: Sun Nov 21, 2010 5:21 pm
by george_gr
cool

thanks alot for the reply

will go ahead and add the feature request

Excellent module for sure
thanks a lot.
Re: Selecting an image from a module admin (Announcing plFileHandler)
Posted: Sun Nov 21, 2010 5:30 pm
by NaN
spcherub wrote:
Is it different from the GBFilePicker?
Tough question.
I would say "Yes and No"
I recently noticed plFileHandler and was impressed and felt somewhat fed up at once.
When i was looking for a filepicker to integrate it into AdvancedContent i didn't find plFileHandler in the forge. And all other projects wasn't ready to use at this time. So i created GBFilePicker. Otherwise i would have used plFileHandler because it seems to do exactly the same. This would have saved me lots of time and work. First we did not have any proper working filepicker module, now we have two that does almost the same
At this time the first obvious difference between GBFilePicker and plFileHandler is that plFileHandler does not support the {content_module} tag yet to provide its function also to the edit page form.
But the functions to create the filepicker input and the filebrowser etc. seems to be equal.
plFileHandler seems to be a bit more flexible in template stuff. There is no template management for the output in GBFilePicker at the moment. But you can create own templates and just pass the moduleinstance that creates the filepicker input and the template name using the params input_template and filebrowser_template to use modulespecific templates in GBFilePicker. Or you create a template and store it in the module_custom/GBFilePicker/templates/ folder and pass the templates name with the parameters. Not that easy like in plFileHanlder but also possible.
I like the features of plFileHandlers templates such as sort and search functions. plFileHandler templates seems to be more slim and lightweight than GBFilePicker.
GBFilePicker doesn't crop images on resize. And i think it never will. IMHO image transform simply is not its job. This should be done by more specific modules/plugins (in the most cases they will do a better job than i would ever be able to integrate in the filepicker).
But the main difference is that in plFileHandler all params are passed in the URLs of plFileHandler. So you can manipulate the filehandlers behaviour by just adding or changing some URL params. That means i would never suggest to use plFileHandler in frontend. In plFileHandler you can browse the entire webspace by just passing some "../../../" in the urls. Or you can grant filemanagement even if you do not have permission. IMHO this is a huge security leak.
In GBFilePicker all params are stored in a php session var and so you can pass whatever you want in the URLs to GBFilePicker you cannot override the session params. Additionally in GBFilePicker you can only browse relative to the uploads dir no matter what is passed in the url for the dir param. So it is much more secure at the moment.
I cannot tell you wich one is better at all since they do very similar - and good - jobs. Both seems to be stable even if they are just BETA versions. (plFileHandler has some notices and warnings in debug mode, but nothing critical) So you need to decide by yourself wich one fits your needs.
Honestly i'm not planing to improve the GBFilePicker a lot. What is in now will be all. Maybe some template management and some more demo templates but no additional functions. I'm courious about how plgers plFilehandler will evolve.
Re: Selecting an image from a module admin (Announcing plFileHandler)
Posted: Tue Nov 23, 2010 4:02 pm
by spcherub
NaN - Thanks for thoughtful and detailed reply.
I wish that the {content_image} was more like GBFilePicker, even if it was for only being able to browse to other folder/sub-folders (preview would be nice too). That would make it more flexible an usable without needing additional modules. The single drop-down concept is long in the tooth - inflexible and does not scale well.
I use GBFilePicker exactly as described above (like {content_image} on steriods). I have not used the upload functionality - I think that should stay in the File & Image Managers that are already built in to the core.
Just my $0.02 worth!
- Sanjay
Re: Selecting an image from a module admin (Announcing plFil
Posted: Wed Feb 23, 2011 11:40 am
by plger
Hi NaN... I hope you'll get this answer despite the huge delay...
NaN wrote:First we did not have any proper working filepicker module, now we have two that does almost the same
I'm not very "competitive" when it comes to modules (and as a matter of fact the next version of CTLModuleMaker will support GBFilePicker if users want to use this), so if you're willing to pitch our efforts together to come up with one "ideal" filepicker, I'm in.
NaN wrote:In plFileHandler you can browse the entire webspace by just passing some "../../../" in the urls. Or you can grant filemanagement even if you do not have permission. IMHO this is a huge security leak.
Indeed it is, and I'm quite angry I didn't notice this (I actually never used it in the frontend myself...). I would have been very grateful for a bug report on this (because it's easily avoidable), but thanks just the same for mentioning it here. I'll prevent outrooting immediately, but in the future I believe you are right in using sessions.
My offer is on the table,
plger
Re: Selecting an image from a module admin (Announcing plFil
Posted: Sat Jul 30, 2011 2:50 am
by Cerulean
plger, I have been using GBFilePicker like spcherub describes above: as an enhancement of the {content_image} tag.
I have recently discovered that GBFilePicker isn't working with Internet Explorer, so while the bug is unfixed I'm looking for a replacement.
Can plFileHandler be used in templates in a similar way - to provide a image browser in the Edit Page screen (in Admin) that inserts the path to the selected image into the page? Could you explain how to use plFileHandler in a template? The help info is aimed at module developers and I can't get it working in a template. Thanks.