Created
August 6, 2014 02:28
-
-
Save bangpound/812347ee8f18bc1871d6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/file_entity.file_api.inc b/file_entity.file_api.inc | |
index 85309eb..15fa5fe 100644 | |
--- a/file_entity.file_api.inc | |
+++ b/file_entity.file_api.inc | |
@@ -160,6 +160,14 @@ function file_build_content($file, $view_mode = 'full', $langcode = NULL) { | |
// Remove previously built content, if exists. | |
$file->content = array(); | |
+ // Allow modules to change the view mode. | |
+ $context = array( | |
+ 'entity_type' => 'file', | |
+ 'entity' => $file, | |
+ 'langcode' => $langcode, | |
+ ); | |
+ drupal_alter('entity_view_mode', $view_mode, $context); | |
+ | |
// Build the actual file display. | |
// @todo Figure out how to clean this crap up. | |
$file->content['file'] = file_view_file($file, $view_mode, $langcode); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment