function andromeda_slideshow_image_delete_form_submit in Andromeda Slideshow 7
Same name and namespace in other branches
- 7.2 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 359 - 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;
}
}
}