You are here

function manualcrop_image_style_delete in Manual Crop 7

Implements hook_image_style_delete().

1 call to manualcrop_image_style_delete()
manualcrop_image_effect_delete_form_submit in ./manualcrop.admin.inc
Effect deletion form submit handler; Cleanup old selections.

File

./manualcrop.module, line 162

Code

function manualcrop_image_style_delete($style) {
  $style_name = isset($style['old_name']) ? $style['old_name'] : $style['name'];
  if (!empty($style['effects'])) {
    $effect = reset($style['effects']);
    if (_manualcrop_is_own_effect($effect, TRUE)) {

      // Delete the crop selections.
      db_delete('manualcrop')
        ->condition('style_name', $style_name)
        ->execute();

      // Update the style name in the field widgets.
      _manualcrop_update_style_name_in_field_widget($style_name);
    }
  }

  // Update the style name in the image effects.
  _manualcrop_update_style_name_in_image_effect($style_name);
}