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.
File or Image picker for new module
File or Image picker for new module
Last edited by Lucas on Wed Jan 30, 2008 4:13 pm, edited 1 time in total.
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
- Location: Fernie British Columbia, Canada
Re: File or Image picker for new module
The CGExtensions module has methods to build a pulldown for files or images
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Re: File or Image picker for new module
Thanks.
I ended up using the 'simplebrowser' code, and modified the call to the callback function a bit. Works like a charm
I ended up using the 'simplebrowser' code, and modified the call to the callback function a bit. Works like a charm

Last edited by Lucas on Wed Jan 30, 2008 10:11 pm, edited 1 time in total.
Re: File or Image picker for new module
You can also simply use KFM File Manager as file picker. Use the following code to implement:
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.
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");
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
Yep this is the same idea. I personally prefer the use of the same layout as the editor. Makes it more recognisable for users.