I have been trying to do this with the remote functionality of the filefield_sources module for days now... I am examining YOUR module now to see what you did. Prior I was hacking at the remote.inc file to gain clarity of what was going on.

You aren't by any chance planning on already adding this functionality are you? We have several use cases for it at the university I work for.

Basically I would like the exact same thing you did with autocomplete, however, I would like to add the URL into the remote transfer source when clicking an image from the modal/dialog.

I am creating a view using Views XML Backend for retrieving the data. I am falling short on intercepting filefield_sources at the right place in the code.

Any thoughts? or Help?

Thanks!

Comments

bradallenfisher’s picture

Title: Extend this to remote functionality with Views XML Backend Module » Extend this to use the file field sources remote source functionality with Views XML Backend Module
rudiedirkx’s picture

It looks like what I did, which isn't super elegant, because FFS indeed misses entry hooks. I used a lot of JS to

1. open the view,
2. remember state (images in the view),
3. insert it into an existing FFS widget (the existing file)

If your thing has a view and FFS has a corresponding widget (remote file?), you can copy much of my code.

It would't fit IN VSF I think, but it could be a submodule. If you make it, I'll check and add and maintain is.

bradallenfisher’s picture

Thanks for the response. I got this working and it will soon be part of the ELMS distribution. If you have any need for what I did let me know and I will send it your way.

Here is what I have working...

  • Choose file from a view that contains a list of image thumbnails and their corresponding remote URL's.
  • Using views data export on the remote server (which might get changed to restws) I populate the dialog browser on local site.
  • On the local site I use views xml backend to pull in the image thumbs and the URL.
  • Inject the url into the remote transfer field and trigger the mousedown.

This essentially allows you to run a media server offsite and use it's resources (currently only images) in your local site.

I am cleaning it up still and there will be more iterations of it I'm sure. Thanks for your hard work... there was very little that I had to "write."

bradallenfisher’s picture

Status: Active » Closed (fixed)
rudiedirkx’s picture

Is it a submodule of VSF or separate?

If it's a nice module, not inside your custom code, post it here, so everyone can enjoy an offsite media library. Sounds like a great addition. Or even better: make it a Drupal project.

bradallenfisher’s picture

It is a forked version of your code as a separate module. It is basically the exact same module you wrote but repurposed for the remote transfer field.
Let me get a README together and swap out the URL to my media server (in my view) and I will put it on github.
I will post back here with a link...