function media_gallery_remove_item_form_submit in Media Gallery 7
Same name and namespace in other branches
- 7.2 media_gallery.pages.inc \media_gallery_remove_item_form_submit()
Submit handler for removing a media item from a gallery.
File
- ./
media_gallery.pages.inc, line 350 - Common pages for the Media Gallery module.
Code
function media_gallery_remove_item_form_submit($form, &$form_state) {
$node = node_load($form_state['values']['nid']);
$file = file_load($form_state['values']['fid']);
media_gallery_remove_item_from_gallery($node, $file);
drupal_set_message(t('The file %file was removed from the gallery.', array(
'%file' => $file->filename,
)));
$form_state['redirect'] = "node/{$node->nid}";
}