You are here

function mediafront_filefield_submit in MediaFront 6

Same name and namespace in other branches
  1. 6.2 includes/mediafront.filefield.inc \mediafront_filefield_submit()
  2. 7 includes/mediafront.filefield.inc \mediafront_filefield_submit()

Called when the user submits the FileField form.

1 string reference to 'mediafront_filefield_submit'
mediafront_form_content_field_edit_form_alter in includes/mediafront.filefield.inc
Implementation of hook_form_FORM_ID_alter().

File

includes/mediafront.filefield.inc, line 150

Code

function mediafront_filefield_submit($form, &$form_state) {

  // SQL to get the image cache preset name.
  $sql = "SELECT presetname FROM {imagecache_preset} WHERE presetid=%d";
  $nid = $form_state['values']['preview_image'];
  $tid = $form_state['values']['thumb_image'];

  // Save this filefield
  mediafront_filefield_save($form_state['values']['type_name'], $form_state['values']['field_name'], $form_state['values']['media_type'], $nid && is_numeric($nid) ? db_result(db_query($sql, $nid)) : $nid, $tid && is_numeric($tid) ? db_result(db_query($sql, $tid)) : $tid);
}