You are here

function media_wysiwyg_get_file_view_mode_options in D7 Media 7.4

Same name and namespace in other branches
  1. 7.2 modules/media_wysiwyg/media_wysiwyg.module \media_wysiwyg_get_file_view_mode_options()
  2. 7.3 modules/media_wysiwyg/media_wysiwyg.module \media_wysiwyg_get_file_view_mode_options()

Return a list of view modes allowed for a file embedded in the WYSIWYG.

Parameters

object $file: A file entity.

Return value

array An array of view modes that can be used on the file when embedded in the WYSIWYG.

1 call to media_wysiwyg_get_file_view_mode_options()
media_wysiwyg_format_form in modules/media_wysiwyg/includes/media_wysiwyg.pages.inc
Form callback for embedding media.

File

modules/media_wysiwyg/media_wysiwyg.module, line 625
Primarily Drupal hooks.

Code

function media_wysiwyg_get_file_view_mode_options($file) {
  $view_modes = media_wysiwyg_get_file_type_view_mode_options($file->type);
  drupal_alter('media_wysiwyg_allowed_view_modes', $view_modes, $file);

  // Invoke the deprecated/misspelled alter hook as well.
  drupal_alter('media_wysiwyg_wysiwyg_allowed_view_modes', $view_modes, $file);
  return $view_modes;
}