function media_gallery_remove_item_from_gallery in Media Gallery 7.2
Same name and namespace in other branches
- 7 media_gallery.module \media_gallery_remove_item_from_gallery()
Removes a media item from a gallery.
Parameters
$node: The gallery node object.
$file: The file to remove from the gallery.
Return value
The updated gallery node object.
3 calls to media_gallery_remove_item_from_gallery()
- media_gallery_file_delete in ./
media_gallery.module - Implements hook_file_delete().
- media_gallery_multiedit_remove_item in ./
media_gallery.module - Form submit handler to remove a media item from a gallery.
- media_gallery_remove_item_form_submit in ./
media_gallery.pages.inc - Submit handler for removing a media item from a gallery.
File
- ./
media_gallery.module, line 891
Code
function media_gallery_remove_item_from_gallery($node, $file) {
$items =& $node->media_gallery_file[LANGUAGE_NONE];
foreach ($items as $key => $item) {
if ($file->fid == _media_gallery_get_media_fid($item)) {
unset($items[$key]);
}
}
node_save($node);
return $node;
}