File or Image picker for new module

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
Lucas
New Member
New Member
Posts: 7
Joined: Mon Nov 26, 2007 12:31 pm
Location: Netherlands

File or Image picker for new module

Post 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.
Last edited by Lucas on Wed Jan 30, 2008 4:13 pm, edited 1 time in total.
calguy1000
Support Guru
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

Post by calguy1000 »

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.
Lucas
New Member
New Member
Posts: 7
Joined: Mon Nov 26, 2007 12:31 pm
Location: Netherlands

Re: File or Image picker for new module

Post by Lucas »

Thanks.

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.
bterkuile
Forum Members
Forum Members
Posts: 97
Joined: Sun Jul 22, 2007 11:48 am
Location: Netherlands

Re: File or Image picker for new module

Post 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.
Lucas
New Member
New Member
Posts: 7
Joined: Mon Nov 26, 2007 12:31 pm
Location: Netherlands

Re: File or Image picker for new module

Post 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.
Post Reply

Return to “Developers Discussion”