You are here

function media_entity_info_alter in D7 Media 7.3

Same name and namespace in other branches
  1. 7.4 media.module \media_entity_info_alter()
  2. 7 media.module \media_entity_info_alter()
  3. 7.2 media.module \media_entity_info_alter()

Implements hook_entity_info_alter().

File

./media.module, line 56
Media API

Code

function media_entity_info_alter(&$entity_info) {

  // For sites that updated from Media 1.x, continue to provide these deprecated
  // view modes.
  // @see http://drupal.org/node/1051090
  if (variable_get('media_show_deprecated_view_modes', FALSE)) {
    $entity_info['file']['view modes']['media_link'] = array(
      'label' => t('Link'),
      'custom settings' => TRUE,
    );
    $entity_info['file']['view modes']['media_original'] = array(
      'label' => t('Original'),
      'custom settings' => TRUE,
    );
  }
  if (module_exists('entity_translation')) {
    $entity_info['file']['translation']['entity_translation']['class'] = 'MediaEntityTranslationHandler';
    $entity_info['file']['translation']['entity_translation']['path schemes']['media'] = array(
      'edit path' => 'media/%file/edit/%ctools_js',
    );
  }
}