You are here

function andromeda_slideshow_image_delete_form_submit in Andromeda Slideshow 7.2

Same name and namespace in other branches
  1. 7 includes/andromeda_slideshow.forms.inc \andromeda_slideshow_image_delete_form_submit()

Submit handler for andromeda_slideshow_image_delete_form

File

includes/andromeda_slideshow.forms.inc, line 350
Form definitions for andromeda slideshow module

Code

function andromeda_slideshow_image_delete_form_submit($form, &$form_state) {
  $image = $form['#image'];
  $slideshow = $form['#slideshow'];

  //remove the image from the slideshow
  if (andromeda_slideshow_remove_image($slideshow, $image)) {

    //delete the image
    if (andromeda_slideshow_delete_image($image)) {
      drupal_set_message(t('Image @name was deleted successfully.', array(
        '@name' => $image->title,
      )));
      $form_state['redirect'] = 'admin/structure/slideshows/manage/' . $slideshow->sid;
    }
  }
}