function media_gallery_remove_item_form in Media Gallery 7
Same name and namespace in other branches
- 7.2 media_gallery.pages.inc \media_gallery_remove_item_form()
Form callback: Display a form for removing a media item from a gallery.
Parameters
$node: The gallery node object.
$file: The file to remove from the gallery.
1 string reference to 'media_gallery_remove_item_form'
- media_gallery_menu in ./
media_gallery.module - Implements hook_menu().
File
- ./
media_gallery.pages.inc, line 323 - Common pages for the Media Gallery module.
Code
function media_gallery_remove_item_form($form, &$form_state, $node, $file) {
// Set the breadcrumb.
$node_url_arguments = entity_uri('node', $node);
drupal_set_breadcrumb(array(
l(t('Home'), NULL),
l($node->title, $node_url_arguments['path'], $node_url_arguments['options']),
));
$form['nid'] = array(
'#type' => 'value',
'#value' => $node->nid,
);
$form['fid'] = array(
'#type' => 'value',
'#value' => $file->fid,
);
return confirm_form($form, t('Are you sure you want to remove %file from the gallery %gallery?', array(
'%file' => $file->filename,
'%gallery' => $node->title,
)), "media-gallery/detail/{$node->nid}/{$file->fid}", t('The file will still be available in the media library to use elsewhere on this site.'), t('Remove file'));
}