You are here

function imagepicker_image_delete in Image Picker 7

Same name and namespace in other branches
  1. 5.2 imagepicker.module \imagepicker_image_delete()
  2. 5 imagepicker.module \imagepicker_image_delete()
  3. 6.2 imagepicker.functions.inc \imagepicker_image_delete()
5 calls to imagepicker_image_delete()
imagepicker_admin_images in ./imagepicker.admin.inc
imagepicker_admin_image_form_submit in ./imagepicker.admin.inc
imagepicker_image_form_delete in ./imagepicker.functions.inc
Submit form functions
imagepicker_user_image_form_delete in ./imagepicker.user.inc
imagepicker_user_page in ./imagepicker.user.inc
@file @author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL

File

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

Code

function imagepicker_image_delete($img_id, $account = FALSE, $src = 'iframe') {
  if ($account) {
    $user = $account;
    $userdir = array(
      'uid' => $user->uid,
    );
  }
  else {
    global $user;
    $userdir = TRUE;
  }
  if ($src == 'account') {
    $outpath = 'user/' . $user->uid . '/imagepicker/images/browse';
  }
  elseif ($src == 'admin') {
    $outpath = IMAGEPICKER_ADMIN_PATH . '/images/user/' . $user->uid . '/browse';
  }
  else {
    $outpath = 'imagepicker/browse';
  }
  _imagepicker_image_delete($img_id, $account, $src);
  drupal_goto($outpath);
}