Announcing new module: GBFilePicker
Re: Announcing new module: GBFilePicker
NaN, I notice that the thumbnail displayed (in "browser" mode) once an image has been chosen from the filepicker is given a height of 96px and a width of 96px, which causes images not of a 1:1 aspect ratio to distort. Is it possible to have the "chosen" thumbnail appear the same as it does in the filepicker?
Note: the thumbnail only loses its original aspect ratio once Apply is clicked, or when entering the Edit Page screen when an image has already been selected.
Note: the thumbnail only loses its original aspect ratio once Apply is clicked, or when entering the Edit Page screen when an image has already been selected.
Last edited by Cerulean on Sat Nov 06, 2010 3:02 am, edited 1 time in total.
Re: Announcing new module: GBFilePicker
Another thing... the setting in the admin panel for "Allow upscaling" doesn't seem to work. In the filepicker, if resize images is checked and the dimensions are larger than the uploaded image then the image is indeed upscaled regardless of the admin setting.
I'm using GBFilePicker with the Advanced Content module if that makes a difference.
I'm using GBFilePicker with the Advanced Content module if that makes a difference.
Re: Announcing new module: GBFilePicker
cerulean wrote:
the setting in the admin panel for "Allow upscaling" doesn't seem to work
If you are admin or if you belong to the admin group there are no restrictions for you.module help wrote:
All params are optional and can be used with {content_module} tag as well with the api function.
Notice that some params will have no effect if you are the admin. That means the admin has always any permissions.
E.g: you cannot deny filemanagement or image resizing on upload to the admin but only to other users.
...
allow_upscaling (true/false)
* Usually this is a preference that can be set up in the modules admin panel. It specifies if images may be enlarged when resized.
With this param you can override this setting to specify certain preferences for each block individually.
Note: This has no effect if you are admin.
So you are allowed to scale the images to whatever size you want.
This is no bug but a feature since the admin cannot reduce his own permissions.
He can always do whatever he thinks is right.
Confirmed.cerulean wrote:
Note: the thumbnail only loses its original aspect ratio once Apply is clicked, or when entering the Edit Page screen when an image has already been selected.
Is an error.
Remove in the template GBFilePicker/templates/input.tpl the height attrib from the image:
It doesn't make sense here.
Thanks for reporting this.
Last edited by NaN on Sat Nov 06, 2010 10:29 pm, edited 1 time in total.
Re: Announcing new module: GBFilePicker
Thanks NaN, understood. 
For any programmers keen for a project, the News module is crying out for the integration of GBFilePicker, so images and files can be selected from the server. Ref this request from a while back: http://forum.cmsmadesimple.org/index.ph ... 071.0.html

For any programmers keen for a project, the News module is crying out for the integration of GBFilePicker, so images and files can be selected from the server. Ref this request from a while back: http://forum.cmsmadesimple.org/index.ph ... 071.0.html
Last edited by Cerulean on Sun Nov 07, 2010 12:05 am, edited 1 time in total.
Re: Announcing new module: GBFilePicker
NaN, I'm having some trouble getting the "dir" parameter to work for Users outside the Admin group. In short, having a dir parameter set seems to allow a non-admin user to access any directory but the specified dir.
I have the Editor group permissions allowing "Modify Files", and I have "Restrict user's dir access" unchecked in the GBFilePicker options.
My template uses GBFilePicker like this:
{content_module module="GBFilePicker" block="image1" label="Image One" mode="browser" dir="images/homepage-feature-photos/"}
This works fine for Admin users, but Editors get an error "This directory is empty".
If I include show_subdirs="true" in the tag an Editor is redirected to the "uploads" directory. They can then browse into the "images" subdirectory, but if they try to browse into "homepage-feature-photos" (my specified dir) they are again redirected to the "uploads" root.
If I leave out the dir parameter and include show_subdirs="true", the Editor can browse all the way into "homepage-feature-photos".
Any idea what's going on there? Thanks.
I have the Editor group permissions allowing "Modify Files", and I have "Restrict user's dir access" unchecked in the GBFilePicker options.
My template uses GBFilePicker like this:
{content_module module="GBFilePicker" block="image1" label="Image One" mode="browser" dir="images/homepage-feature-photos/"}
This works fine for Admin users, but Editors get an error "This directory is empty".
If I include show_subdirs="true" in the tag an Editor is redirected to the "uploads" directory. They can then browse into the "images" subdirectory, but if they try to browse into "homepage-feature-photos" (my specified dir) they are again redirected to the "uploads" root.
If I leave out the dir parameter and include show_subdirs="true", the Editor can browse all the way into "homepage-feature-photos".
Any idea what's going on there? Thanks.
Re: Announcing new module: GBFilePicker
I think the problem in internet explorer is in :
#GBFP_wrapper #GBFP .GBFP_header fieldset
{
margin : 5px;
position : relative;
}
If you remove the position : relative; On this entry it works (almost) ok on msie.
------------------------------------------------
I have been trying to implement this module inside news but I have had very little luck with it.
My knowledge of cmsms is limited though, and I am not a professional programer anyways so i am a bit fumbling here.
If anyone could help out in the following it would really be great :
Is there anyway (a hack most likely) to allow all users (groups) the same access to GBFilePicker as admins have.
Please please and info would be greatly appreciated.
Thanks
George
#GBFP_wrapper #GBFP .GBFP_header fieldset
{
margin : 5px;
position : relative;
}
If you remove the position : relative; On this entry it works (almost) ok on msie.
------------------------------------------------
I have been trying to implement this module inside news but I have had very little luck with it.
My knowledge of cmsms is limited though, and I am not a professional programer anyways so i am a bit fumbling here.
If anyone could help out in the following it would really be great :
Is there anyway (a hack most likely) to allow all users (groups) the same access to GBFilePicker as admins have.
Please please and info would be greatly appreciated.
Thanks
George
Re: Announcing new module: GBFilePicker
Thanks for the CSS hint. Seems to work. Now i can finally release v.1.2 
To grant full access to the filepicker there are various ways.
You just need to set permission "Modify Files" and set the module setting "Show filemanagement options". The users are now able to do almost any file operation.
But they cannot browse in other directories than the specified one. (and therefore they cannot create directories)
If the users may create directories you need additionally set the param show_subdirs="true". (it doesn't make sense to grant directory creation but deny browsing the created dirs. this is why you need both.)
But the users are still "trapped" in the specified directory. This cannot be changed unless you do not specify a directory. So the users are able to browse the entire uploads directory.
If you don't want to set the permission "Modify Files" to these users (because you don't want them to use the FileManager) disable this permission and use the params upload, delete, create_dirs and show_subdirs (set them all to true). So even non-admin users without permission of fileoperations are able to do fileoperations in the filepicker.
Using the {content_module} tags it may look like this:
{content_module module="GBFilePicker" block="some_block_name_without_whitespaces" label="The label of this block" mode="browser" dir="some_dir" upload="true" delete="true" create_dirs="true" show_subdirs="true"}
This grants almost any operation even to non-admin users but with one restriction: they cannot browse above the specified dir. That means the users are "trapped" in "some_dir".
If the param dir is not used, they are able to browse the entire uploads dir and can do everything an admin can do.
In version 1.2 you will additionally be able to do the opposite thing. That means instead of only to grant functions to non-admin users without appropriate permissions you can also deny certain functions even to users with sufficient permissions.
(except the admins of course)
Notice: in version 1.2 the module setting "Show filemanagement options" needs to be checked to allow non-admin users to use fileoperations in general. If this is unchecked only the admin is able to use fileoperations in filepicker. No matter what permission the non-admin users have. (Some security stuff to just turn it off)

To grant full access to the filepicker there are various ways.
You just need to set permission "Modify Files" and set the module setting "Show filemanagement options". The users are now able to do almost any file operation.
But they cannot browse in other directories than the specified one. (and therefore they cannot create directories)
If the users may create directories you need additionally set the param show_subdirs="true". (it doesn't make sense to grant directory creation but deny browsing the created dirs. this is why you need both.)
But the users are still "trapped" in the specified directory. This cannot be changed unless you do not specify a directory. So the users are able to browse the entire uploads directory.
If you don't want to set the permission "Modify Files" to these users (because you don't want them to use the FileManager) disable this permission and use the params upload, delete, create_dirs and show_subdirs (set them all to true). So even non-admin users without permission of fileoperations are able to do fileoperations in the filepicker.
Using the {content_module} tags it may look like this:
{content_module module="GBFilePicker" block="some_block_name_without_whitespaces" label="The label of this block" mode="browser" dir="some_dir" upload="true" delete="true" create_dirs="true" show_subdirs="true"}
This grants almost any operation even to non-admin users but with one restriction: they cannot browse above the specified dir. That means the users are "trapped" in "some_dir".
If the param dir is not used, they are able to browse the entire uploads dir and can do everything an admin can do.
In version 1.2 you will additionally be able to do the opposite thing. That means instead of only to grant functions to non-admin users without appropriate permissions you can also deny certain functions even to users with sufficient permissions.
(except the admins of course)
Notice: in version 1.2 the module setting "Show filemanagement options" needs to be checked to allow non-admin users to use fileoperations in general. If this is unchecked only the admin is able to use fileoperations in filepicker. No matter what permission the non-admin users have. (Some security stuff to just turn it off)
Re: Announcing new module: GBFilePicker
thank you very much for the guide NaN much much appreciated.
Re: Announcing new module: GBFilePicker
Has anyone found a fix the bug logged here: http://dev.cmsmadesimple.org/bug/view/6484 ?
GBFilePicker v1.3 won't open from the "Browse" link in Internet Explorer 6, 7 or 8 (not sure about IE9 as I'm using XP).
Error is: 'GBFP.tmp.template.#GBFP_filelist' is null or not an object
Would be great to be able to use this excellent module again.
GBFilePicker v1.3 won't open from the "Browse" link in Internet Explorer 6, 7 or 8 (not sure about IE9 as I'm using XP).
Error is: 'GBFP.tmp.template.#GBFP_filelist' is null or not an object
Would be great to be able to use this excellent module again.