file_entity.tpl.php

×

Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  1. cis7 sites/all/modules/ulmus/file_entity/file_entity.tpl.php
  2. cle7 sites/all/modules/ulmus/file_entity/file_entity.tpl.php
  3. ecd7 sites/all/modules/ulmus/file_entity/file_entity.tpl.php
  4. elmsmedia7 sites/all/modules/ulmus/file_entity/file_entity.tpl.php
  5. harmony7 sites/all/modules/ulmus/file_entity/file_entity.tpl.php
  6. icor7 sites/all/modules/ulmus/file_entity/file_entity.tpl.php
  7. meedjum_blog7 sites/all/modules/ulmus/file_entity/file_entity.tpl.php
  8. mooc7 sites/all/modules/ulmus/file_entity/file_entity.tpl.php

Default theme implementation to display a file.

Available variables:

  • $label: the (sanitized) file name of the file.
  • $content: An array of file items. Use render($content) to print them all, or print a subset such as render($content['field_example']). Use hide($content['field_example']) to temporarily suppress the printing of a given element.
  • $user_picture: The file owner's picture from user-picture.tpl.php.
  • $date: Formatted added date. Preprocess functions can reformat it by calling format_date() with the desired parameters on the $timestamp variable.
  • $name: Themed username of file owner output from theme_username().
  • $file_url: Direct URL of the current file.
  • $display_submitted: Whether submission information should be displayed.
  • $submitted: Submission information created from $name and $date during template_preprocess_file().
  • $classes: String of classes that can be used to style contextually through CSS. It can be manipulated through the variable $classes_array from preprocess functions. The default values can be one or more of the following:

    • file-entity: The current template type, i.e., "theming hook".
    • file-[type]: The current file type. For example, if the file is a "Image" file it would result in "file-image". Note that the machine name will often be in a short form of the human readable label.
    • file-[mimetype]: The current file's MIME type. For exampe, if the file is a PNG image, it would result in "file-image-png"
  • $title_prefix (array): An array containing additional output populated by modules, intended to be displayed in front of the main title tag that appears in the template.
  • $title_suffix (array): An array containing additional output populated by modules, intended to be displayed after the main title tag that appears in the template.

Other variables:

  • $file: Full file object. Contains data that may not be safe.
  • $type: File type, i.e. image, audio, video, etc.
  • $uid: User ID of the file owner.
  • $timestamp: Time the file was added formatted in Unix timestamp.
  • $classes_array: Array of html class attribute values. It is flattened into a string within the variable $classes.
  • $zebra: Outputs either "even" or "odd". Useful for zebra striping in listings.
  • $id: Position of the file. Increments each time it's output.

File status variables:

  • $view_mode: View mode, e.g. 'default', 'full', etc.
  • $page: Flag for the full page state.
  • $is_front: Flags true when presented in the front page.
  • $logged_in: Flags true when the current user is a logged-in member.
  • $is_admin: Flags true when the current user is an administrator.

Field variables: for each field instance attached to the file a corresponding variable is defined, e.g. $file->caption becomes $caption. When needing to access a field's raw values, developers/themers are strongly encouraged to use these variables. Otherwise they will have to explicitly specify the desired field language, e.g. $file->caption['en'], thus overriding any language negotiation rule that was previously applied.

See also

template_preprocess()

template_preprocess_file_entity()

template_process()

45 string references to the theme hook from file_entity.tpl.php

Note: this list is generated by looking for the string for this theme hook, so it may include some references that are not actually using this theme hook.

field_group_theme_registry_alter in sites/all/modules/ulmus/field_group/field_group.module
Implements hook_theme_registry_alter().
file_entity_add_upload_step_upload in sites/all/modules/ulmus/file_entity/file_entity.pages.inc
Generate form fields for the first step in the add file wizard.
file_entity_ctools_plugin_api in sites/all/modules/ulmus/file_entity/file_entity.module
Implements hook_ctools_plugin_api().
file_entity_edit in sites/all/modules/ulmus/file_entity/file_entity.pages.inc
Page callback: Form constructor for the file edit form.
file_entity_file_content_content_type_render in sites/all/modules/ulmus/file_entity/plugins/content_types/file_content.inc
Render the node content.

... See full list

File

sites/all/modules/ulmus/file_entity/file_entity.tpl.php
View source
  1. <?php
  2. /**
  3. * @file
  4. * Default theme implementation to display a file.
  5. *
  6. * Available variables:
  7. * - $label: the (sanitized) file name of the file.
  8. * - $content: An array of file items. Use render($content) to print them all,
  9. * or print a subset such as render($content['field_example']). Use
  10. * hide($content['field_example']) to temporarily suppress the printing of a
  11. * given element.
  12. * - $user_picture: The file owner's picture from user-picture.tpl.php.
  13. * - $date: Formatted added date. Preprocess functions can reformat it by
  14. * calling format_date() with the desired parameters on the $timestamp
  15. * variable.
  16. * - $name: Themed username of file owner output from theme_username().
  17. * - $file_url: Direct URL of the current file.
  18. * - $display_submitted: Whether submission information should be displayed.
  19. * - $submitted: Submission information created from $name and $date during
  20. * template_preprocess_file().
  21. * - $classes: String of classes that can be used to style contextually through
  22. * CSS. It can be manipulated through the variable $classes_array from
  23. * preprocess functions. The default values can be one or more of the
  24. * following:
  25. * - file-entity: The current template type, i.e., "theming hook".
  26. * - file-[type]: The current file type. For example, if the file is a
  27. * "Image" file it would result in "file-image". Note that the machine
  28. * name will often be in a short form of the human readable label.
  29. * - file-[mimetype]: The current file's MIME type. For exampe, if the file
  30. * is a PNG image, it would result in "file-image-png"
  31. * - $title_prefix (array): An array containing additional output populated by
  32. * modules, intended to be displayed in front of the main title tag that
  33. * appears in the template.
  34. * - $title_suffix (array): An array containing additional output populated by
  35. * modules, intended to be displayed after the main title tag that appears in
  36. * the template.
  37. *
  38. * Other variables:
  39. * - $file: Full file object. Contains data that may not be safe.
  40. * - $type: File type, i.e. image, audio, video, etc.
  41. * - $uid: User ID of the file owner.
  42. * - $timestamp: Time the file was added formatted in Unix timestamp.
  43. * - $classes_array: Array of html class attribute values. It is flattened
  44. * into a string within the variable $classes.
  45. * - $zebra: Outputs either "even" or "odd". Useful for zebra striping in
  46. * listings.
  47. * - $id: Position of the file. Increments each time it's output.
  48. *
  49. * File status variables:
  50. * - $view_mode: View mode, e.g. 'default', 'full', etc.
  51. * - $page: Flag for the full page state.
  52. * - $is_front: Flags true when presented in the front page.
  53. * - $logged_in: Flags true when the current user is a logged-in member.
  54. * - $is_admin: Flags true when the current user is an administrator.
  55. *
  56. * Field variables: for each field instance attached to the file a corresponding
  57. * variable is defined, e.g. $file->caption becomes $caption. When needing to
  58. * access a field's raw values, developers/themers are strongly encouraged to
  59. * use these variables. Otherwise they will have to explicitly specify the
  60. * desired field language, e.g. $file->caption['en'], thus overriding any
  61. * language negotiation rule that was previously applied.
  62. *
  63. * @see template_preprocess()
  64. * @see template_preprocess_file_entity()
  65. * @see template_process()
  66. *
  67. * @ingroup themeable
  68. */
  69. ?>
  70. <div id="<?php print $id; ?>" class="<?php print $classes ?>"<?php print $attributes; ?>>
  71. <?php print render($title_prefix); ?>
  72. <?php if (!$page): ?>
  73. <h2<?php print $title_attributes; ?>><a href="<?php print $file_url; ?>"><?php print $label; ?></a></h2>
  74. <?php endif; ?>
  75. <?php print render($title_suffix); ?>
  76. <?php if ($display_submitted): ?>
  77. <div class="submitted">
  78. <?php print $submitted; ?>
  79. </div>
  80. <?php endif; ?>
  81. <div class="content"<?php print $content_attributes; ?>>
  82. <?php
  83. // We hide the links now so that we can render them later.
  84. hide($content['links']);
  85. print render($content);
  86. ?>
  87. </div>
  88. <?php print render($content['links']); ?>
  89. </div>

Related topics