function media_entity_info_alter in D7 Media 7
Same name and namespace in other branches
- 7.4 media.module \media_entity_info_alter()
- 7.2 media.module \media_entity_info_alter()
- 7.3 media.module \media_entity_info_alter()
Implements hook_entity_info_alter().
Add view modes to the file entity type, appropriate for displaying media.
File
- ./
media.module, line 86 - Media API
Code
function media_entity_info_alter(&$entity_info) {
$entity_info['file']['uri callback'] = 'media_entity_uri';
$entity_info['file']['view modes']['media_link'] = array(
'label' => t('Link'),
'custom settings' => TRUE,
);
$entity_info['file']['view modes']['media_preview'] = array(
'label' => t('Preview'),
'custom settings' => TRUE,
);
$entity_info['file']['view modes']['media_small'] = array(
'label' => t('Small'),
'custom settings' => TRUE,
);
$entity_info['file']['view modes']['media_large'] = array(
'label' => t('Large'),
'custom settings' => TRUE,
);
$entity_info['file']['view modes']['media_original'] = array(
'label' => t('Original'),
'custom settings' => TRUE,
);
}