You are here

function media_gallery_node_load in Media Gallery 7

Same name and namespace in other branches
  1. 7.2 media_gallery.module \media_gallery_node_load()

Implements hook_node_load().

File

./media_gallery.module, line 247

Code

function media_gallery_node_load($nodes, $types) {

  // Store a copy of the media_gallery_media field before mucking with it in
  // media_gallery_view(). We use hook_node_load() instead of hook_load(),
  // because the latter runs before fields are loaded.
  if (in_array('media_gallery', $types)) {
    foreach ($nodes as $node) {
      if ($node->type == 'media_gallery') {
        $node->media_gallery_media_original = $node->media_gallery_media;
      }
    }
  }
}