You are here

function imagepicker_edit_form_cancel in Image Picker 7

Same name and namespace in other branches
  1. 6.2 imagepicker.edit.inc \imagepicker_edit_form_cancel()

Submit form functions

1 string reference to 'imagepicker_edit_form_cancel'
imagepicker_edit_form in ./imagepicker.edit.inc

File

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

Code

function imagepicker_edit_form_cancel($form, &$form_state) {
  $img_id = $form_state['values']['img_id'];
  if (isset($form_state['values']['account']) && $form_state['values']['src'] == 'admin') {
    $user = user_load($form_state['values']['account']);
  }
  else {
    global $user;
  }
  if ($form_state['values']['src'] == 'admin') {
    $outpath = IMAGEPICKER_ADMIN_PATH . '/images/user/' . $user->uid . '/browse/' . $img_id;
  }
  elseif ($form_state['values']['src'] == 'account') {
    $outpath = 'user/' . $user->uid . '/imagepicker/images/browse/' . $img_id;
  }
  else {
    $outpath = 'imagepicker/browse/' . $img_id;
  }
  drupal_set_message(t('Cancelled.'));
  drupal_goto($outpath);
}