function file_entity_view_page in File Entity (fieldable files) 7
Same name and namespace in other branches
- 7.3 file_entity.pages.inc \file_entity_view_page()
- 7.2 file_entity.pages.inc \file_entity_view_page()
Menu callback; view a single file entity.
1 string reference to 'file_entity_view_page'
- file_entity_menu in ./
file_entity.module - Implements hook_menu().
File
- ./
file_entity.pages.inc, line 10 - Supports file operations including View, Edit, and Delete.
Code
function file_entity_view_page($file) {
// @todo Implement granular editorial access: http://drupal.org/node/696970.
// In the meantime, protect information about private files from being
// discovered by unprivileged users. File IDs are autoincrement, so one can
// attempt discovery by trying to access different media/ID paths. See also
// media_browser_list(). This logic potentially belongs within
// media_access(), but that would require extending that function's
// signature to accept a $file paramter, and this is temporary code anyway.
if (!user_access('administer files') && file_uri_scheme($file->uri) === 'private') {
return MENU_ACCESS_DENIED;
}
drupal_set_title($file->filename);
return file_view($file, 'full');
}