function _file_entity_view_mode_menu_access

cis7 file_entity.module _file_entity_view_mode_menu_access($file_type, $view_mode, $access_callback)
cle7 file_entity.module _file_entity_view_mode_menu_access($file_type, $view_mode, $access_callback)
elmsmedia7 file_entity.module _file_entity_view_mode_menu_access($file_type, $view_mode, $access_callback)
icor7 file_entity.module _file_entity_view_mode_menu_access($file_type, $view_mode, $access_callback)
meedjum_blog7 file_entity.module _file_entity_view_mode_menu_access($file_type, $view_mode, $access_callback)
mooc7 file_entity.module _file_entity_view_mode_menu_access($file_type, $view_mode, $access_callback)

Menu access callback for the 'view mode file display settings' pages.

Based on _field_ui_view_mode_menu_access(), but the Field UI module might not be enabled.

1 string reference to '_file_entity_view_mode_menu_access'
file_entity_menu in sites/all/modules/ulmus/file_entity/file_entity.module
Implements hook_menu().

File

sites/all/modules/ulmus/file_entity/file_entity.module, line 1317
Extends Drupal file entities to be fieldable and viewable.

Code

function _file_entity_view_mode_menu_access($file_type, $view_mode, $access_callback) {
  // Deny access if the view mode isn't configured to use custom display
  // settings.
  $view_mode_settings = field_view_mode_settings('file', $file_type->type);
  $visibility = ($view_mode == 'default') || !empty($view_mode_settings[$view_mode]['custom_settings']);
  if (!$visibility) {
    return FALSE;
  }

  // Otherwise, continue to an $access_callback check.
  $args = array_slice(func_get_args(), 3);
  $callback = empty($access_callback) ? 0 : trim($access_callback);
  if (is_numeric($callback)) {
    return (bool) $callback;
  }
  elseif (function_exists($access_callback)) {
    return call_user_func_array($access_callback, $args);
  }
}