diff --git a/media.inc b/media.inc index 53c10ec..b256b68 100644 --- a/media.inc +++ b/media.inc @@ -56,19 +56,22 @@ class MigrateDestinationMedia extends MigrateDestinationFile { if ($fid) { $image_info = array( 'type' => 'media', - 'view_mode' => 'media_large', + 'view_mode' => 'default', 'fid' => $fid, + 'fields' => array( + 'format' => 'default', + ), 'attributes' => array( 'alt' => '', 'title' => '', - 'class' => 'media-image', - 'typeof' => 'foaf:Image', + 'class' => 'media-element file-default', 'wysiwyg' => 1, ), ); // Get the height and width parameters if present preg_match('|width=[\'"]([^\'"]+)[\'"]|i', $matches[0], $width); preg_match('|height=[\'"]([^\'"]+)[\'"]|i', $matches[0], $height); + preg_match('|style=[\'"]([^\'"]+)[\'"]|i', $matches[0], $style); // image width if ($width) { $image_info['attributes']['width'] = $width[1]; @@ -77,6 +80,9 @@ class MigrateDestinationMedia extends MigrateDestinationFile { if ($height) { $image_info['attributes']['height'] = $height[1]; } + if ($style) { + $image_info['attributes']['style'] = $style[1]; + } $result = '[[' . drupal_json_encode($image_info) . ']]'; }