This is a new patch that allows imagefield to use imagebrowser to select images from the local server.

This is two patches, one for imagefield, one for imagebrowser. I'll describe them in future details with the patches.

This first patch is for imagebrowser, it abstracts out specific JS for integration into separate JS includes.

Comments

robin monks’s picture

Title: ImageBrowser/ImageFIeld Intergration » ImageBrowser/EmImage Intergration
StatusFileSize
new1.96 KB

Sorry, emimage, not imagefield, got my modules mixed up. Here's the patch for emfield:

- It adds some logic for adding a browser link for imagebrowser (needs improving)

-- Robin

robin monks’s picture

StatusFileSize
new2.36 KB

Last files, its a local content provider to emimage to link to images from the site.

It should be named local.inc and places in emimage/providers.

Robin

robin monks’s picture

Issue for EmImage lives here: http://drupal.org/node/397908

Robin

yurtboy’s picture

can you explain the install process.
Patching is easy but not sure now where to see or setup these options?
I can make a page once I setup it up myself in the drupal doc area.
???
Thanks!

domineaux’s picture

1+

I really like this mod

It has a great set of permissions, which I consider a real plus.

Steve Dondley’s picture

+1 Is the module developer going to look at this?

jdelaune’s picture

I don't use EmField, but if people have tested this patch and it works well I will commit it.

yurtboy’s picture

no the developer seems to be awol? Or just tooo busy which is understandable.
This is key to our next project so I will see if we can tidy this up a bit.
Not much reply so far as to some issues I had trying to install it so we will try and make the process easy and well documented.
More in a week or so.

aaron’s picture

Ah, sorry, I'd missed this before. I'll take a look in the next day or two!

Thanks for the great work!

aaron’s picture

can someone look at this w/ emfield's new 'custom_url' provider for emimage? it has checks in place to ensure the file is a valid image. i'd rather use that than the local.inc if possible, since it's already in place.

thanks

robin monks’s picture

Title: ImageBrowser/EmImage Intergration » ImageBrowser intergration with textfields
StatusFileSize
new3.78 KB

New version of this that provides the same functionality in a much more flexible way, creating a new plugin called ib_any, letting it work with any textfield.

--Robin

robin monks’s picture

Title: ImageBrowser intergration with textfields » ImageBrowser integration with textfields
robin monks’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev
peter törnstrand’s picture

Does not work for me. Using Drupal 6.15, latest 2.x-DEV version of ImageBrowser.

The icon shows to the left of the Image field and the image browser pops up when i click the icon. After that I can click on an image and get to the insert screen but when I click insert nothing happens.

Works when using Embedded Media Field module, not Image Field module.

This is a great feature. The only thing that doesn't make sense is that you get to choose ImageCache preset and Styles for the image you are inserting. Would be great if we could bypass those settings when using this module.

The settings for the module could use some UX love. Perhaps all defined CCK fields could be listed and the user would check the ones she wants to enable Image Browser for.

peter törnstrand’s picture

I propose the following changes to file ib_any.js:

// Assemble path to image including ImageCache preset.
var filename = data.filepath.replace(Drupal.settings.imagebrowser.filepath, '');
var path = Drupal.settings.basePath + Drupal.settings.imagebrowser.filepath + '/imagecache/' + data.preset + filename;

$(instanceId).val(location.protocol + '//' + location.hostname + path);

That modification allows you the display the image using the selected ImageCache preset. However, this could interfere with any preset you specified under "Display fields" or in the Embedde Image Field settings.

Don't really know how to deal with that.

jdelaune’s picture

No we shouldn't let users set ImageCache presets from within IB when it comes to CCK fields. That only applies for WYSIWYG editors. Perhaps a better solution would be to expand the IB API to allow modules to choose to either have the 'Settings stage' (where you choose imagecache presets etc.) or to return the selected image information straight away on click.

Maybe an extra variable option in the hook array. Something like 'settings' => true; or false in the case with this CCK plugin.

Those are just my thoughts. Let me know :)

I've recently written a Vimeo module which ties in heavily with CCK (http://www.drupal.org/project/vimeo) it might be worth tweaking that one day to create an IB CCK plugin to forgo the requirement of the embedded media field module. But that's for another day.

scroogie’s picture

Starnox: The API setting would be great, as I could use it on the Plugin for filefield_sources as well: #439212: Integration with Image Browser