This is great, but users still have to click on "Advanced upload" every time. I'd like Advanced to be the default (or ideally, the only) option - is there any way to enable this?

Comments

atlea’s picture

Assigned: Unassigned » atlea
Status: Active » Closed (won't fix)

This is controled by filefield_sources, witch this module is only a "plugin" to. You could try to make a feature request to disable the default?

OR - You could try to fix this with javascript in your theme. Submit a click event on the link and then hide the others.

adam_b’s picture

Thanks - I found what looks like a relevant issue here: #742134: I would like to disable the default "Upload" source in favour of using the upload option within IMCE , so I'll see what I can come up with.

osman’s picture

@adam_b, you can use jQuery to activate the Plupload tab and hide options:

    // Make Plupload default.
    $('.filefield-sources-list').each(function() {
      $('a.filefield-source-plupload', this).trigger('click');
      $(this).hide();
    });
monaw’s picture

Version: 7.x-1.x-dev » 7.x-1.0
Status: Closed (won't fix) » Active

I tried the above and it didn't work for me...no syntax error in the Safari Web Inspector. Here is the code I put in my custom module:

drupal_add_js ( '(function ($) { $(".filefield-sources-list").each(function() { $("a.filefield-source-plupload", this).trigger("click"); $(this).hide();});})(jQuery);', 'inline' );
akroplas’s picture

Try
(document).ready(function () {}

function MYMODULE_form_alter(&$form, &$form_state, $form_id){
// ....
drupal_add_js ( 
"(function ($) {
$(document).ready(function () {
	$('a.filefield-source-plupload').trigger('click');
	$('.filefield-sources-list').hide();
});
})(jQuery);", "inline" );
}

Above code works on my page.

jh81’s picture

#5 Works perfectly for me. Thanks!

jh81’s picture

Issue summary: View changes

minor edit for clarity

ryantollefson’s picture

Issue summary: View changes

Thank you!