Page 1 of 1
File or Image picker for new module
Posted: Wed Jan 30, 2008 3:54 pm
by Lucas
Hello There,
I'm working on a new module, and would like to integrate a file/image picker in it. Preferably the one from the editor: the 'advimage' plugin. So basicalliy I need a standalone version of this plugin.
Has anyone allready made this for some module?
Thanks.
Re: File or Image picker for new module
Posted: Wed Jan 30, 2008 4:33 pm
by calguy1000
The CGExtensions module has methods to build a pulldown for files or images
Re: File or Image picker for new module
Posted: Wed Jan 30, 2008 7:12 pm
by Lucas
Thanks.
I ended up using the 'simplebrowser' code, and modified the call to the callback function a bit. Works like a charm

Re: File or Image picker for new module
Posted: Fri Feb 01, 2008 3:47 pm
by bterkuile
You can also simply use KFM File Manager as file picker. Use the following code to implement:
Code: Select all
window.SetUrl=function(url,width,height,caption){
element_you_want_to_set.value = url;
if(caption) element_that_uses_caption.value=caption;
}
window.open("<?php echo $gCms->config['root_url'];?>/modules/kfm/kfm/index.php?environment=wysiwyg","kfm","modal,width=800,height=600");
And you're done.
The future version will have a plugin system which will make it really easy to add your own plugin to the file manager.
Maybe this is of use.
Re: File or Image picker for new module
Posted: Fri Feb 01, 2008 3:51 pm
by Lucas
Yep this is the same idea. I personally prefer the use of the same layout as the editor. Makes it more recognisable for users.