diff --git a/rotating_banner.module b/rotating_banner.module index ef21b4d..d22ad65 100644 --- a/rotating_banner.module +++ b/rotating_banner.module @@ -238,10 +238,36 @@ function rotating_banner_block_configure($delta) { $rb_form['slides']['slide_table']['weight'] = array('#tree' => TRUE); foreach ($slides as $slide) { - $media = media_load($slide->fid); - $preview = field_view_field('media', $media, 'file', 'media_preview'); + $preview = array(); + //The media load does not exist it has been replaced by an odd function + //media_multi_load that takes multiple ids in a string, separated by spaces + //$media = media_load($slide->fid); + $multiple_media = media_multi_load("{$slide->fid}"); + $media = $multiple_media[$slide->fid]; + + //This next line of code seem to suggest that there is a media + //entity that contains a file field, but the media_multi_load is + //returning the file itself, so I guess that we will have to re + //arrange things to use the file entity instead of the media entity + //$preview = field_view_field('media', $media, 'file', 'media_preview'); + $preview['#theme_wrappers'][] = 'media_thumbnail'; + //the media_thumbnail theme needs a couple of things to display something + //first it looks for a #file key with the file, and then it looks for a + //thumbnail under the key #children (???). Anyways the content of #children + //does not get render so I am guessing that media_thumbnial is expecting + //straight html. + $preview['#file'] = $media; + + $vars = array( + 'style_name' => 'thumbnail', + 'path' => $media->uri, + 'alt' => 'image', + 'title' => '', + ); + $preview['#children'] = theme('image_style', $vars); + $i++; $rb_form['slides']['slide_table']['weight'][$slide->sid] = array( '#type' => 'weight',