You are here

function imagepicker_browse_admin_form_submit in Image Picker 7

Same name and namespace in other branches
  1. 6.2 imagepicker.functions.inc \imagepicker_browse_admin_form_submit()

Submit form

File

./imagepicker.functions.inc, line 617
@author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL

Code

function imagepicker_browse_admin_form_submit($form, &$form_state) {
  $operation = $form_state['values']['operation'];
  $path = '';
  if (isset($form_state['values']['path'])) {
    $path = $form_state['values']['path'];
  }
  $returnpath = $form_state['values']['returnpath'];
  $images = array_filter($form_state['values']['images']);
  $img_ids = '';
  if ($images) {
    foreach ($images as $img_id) {
      $img_ids[] = $img_id;
    }
  }
  if (is_array($img_ids)) {
    $simg_ids = implode('-', $img_ids);
    drupal_goto($path . "/multitask/{$operation}/{$simg_ids}/{$returnpath}");
  }
  else {
    $rpath = imagepicker_multitask_returnpath($returnpath);
    drupal_set_message(t('No images selected'));
    drupal_goto($rpath);
  }
}