In a form I have added a field for images, set the file source to "Advanced upload widget (Plupload)" ( all other checkboxes are unchecked ) and I get the interface. I want to make it autoupload images after being drag and droped or selected via the add image link. The form is loaded in a custom created page using a personal made module. I tried to set
$form['field_image_article1']['#autoupload']=TRUE
in myModule_form_alter and also called a myModule_after_build. None of the situations work and I can't figure out where or better sayd when should I set this value. Here is the code for the module :
function add_new_article_menu() {
$items['addAnnouncement'] = array(
'title' => 'Adauga anunt',
'page callback' => 'add_new_article_simple_page',
'access callback' => TRUE,
);
return $items;
}
function add_new_article_simple_page() {
form_load_include($form_state, 'inc', 'node', 'node.pages');
$node_form = new stdClass;
$node_form->type = 'announcement';
$node_form->language = LANGUAGE_NONE;
$form = drupal_get_form('announcement_node_form', $node_form);
return $form;
}
function add_new_article_form_alter(&$form, &$form_state, $form_id){
if($form_id=='announcement_node_form'){
$form['#after_build'][]='add_new_article_after_build';
return $form;
}
}
function add_new_article_after_build($form, &$form_state) {
$form['field_image_article1']['#autoupload']=TRUE;
return $form;
}
Modules installed for plupload : FileField Sources Plupload, File Field Sources , Plupload integration module
Any help is most appreciated.