You are here

function avatar_selection_image_delete in Avatar Selection 5

Same name and namespace in other branches
  1. 5.2 avatar_selection.module \avatar_selection_image_delete()
  2. 6 avatar_selection.admin.inc \avatar_selection_image_delete()
  3. 7 avatar_selection.admin.inc \avatar_selection_image_delete()
1 call to avatar_selection_image_delete()
avatar_selection_edit_form_submit in ./avatar_selection.module

File

./avatar_selection.module, line 646

Code

function avatar_selection_image_delete($image) {
  if (file_check_location($image, file_create_path('avatar_selection'))) {
    $result = db_query("DELETE FROM {avatar_selection} WHERE avatar = '%s'", $image);
    file_delete($image);
    if (!image_get_info($image)) {
      drupal_set_message(t('Image deleted.'));
    }
  }
}