function _media_gallery_get_media_fid in Media Gallery 7.2
Same name and namespace in other branches
- 7 media_gallery.module \_media_gallery_get_media_fid()
Determines the file ID from a media file array or object.
This is ugly, but necessary since a media field attached to a node may be represented either as an array or a full object, depending on whether the node has been processed for viewing yet or not.
Parameters
$file: Either a media file object or media file array.
Return value
The value of the 'fid' object property or array key.
5 calls to _media_gallery_get_media_fid()
- media_gallery_block_view in ./
media_gallery.module - Implements hook_block_view().
- media_gallery_get_file_ids in ./
media_gallery.module - Returns all file IDs attached to a media gallery node.
- media_gallery_remove_item_from_gallery in ./
media_gallery.module - Removes a media item from a gallery.
- media_gallery_view in ./
media_gallery.module - Implements hook_view().
- theme_media_gallery_media_item_detail in ./
media_gallery.theme.inc - Displays a media item (entity) as its own page, within gallery context.
File
- ./
media_gallery.module, line 876
Code
function _media_gallery_get_media_fid($file) {
return is_object($file) ? $file->fid : $file['fid'];
}