Projet

Général

Profil

Révision d1c64ea8

Ajouté par Assos Assos il y a plus de 6 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/file_entity/file_entity.module
894 894
      'variables' => array(
895 895
        'files' => array(),
896 896
        'controls' => TRUE,
897
        'controls_list' => array(
898
          'download' => 'download',
899
          'remote_playback' => 'remote_playback',
900
        ),
897 901
        'autoplay' => FALSE,
898 902
        'loop' => FALSE,
899 903
        'preload' => NULL,
......
904 908
      'variables' => array(
905 909
        'files' => array(),
906 910
        'controls' => TRUE,
911
        'controls_list' => array(
912
          'fullscreen' => 'fullscreen',
913
          'download' => 'download',
914
          'remote_playback' => 'remote_playback',
915
        ),
907 916
        'autoplay' => FALSE,
908 917
        'loop' => FALSE,
909 918
        'muted' => FALSE,
......
1678 1687
  // $file may be either an object or a file type. Since file types cannot be
1679 1688
  // an integer, use either fid or type as the static cache id.
1680 1689
  $cache_id = NULL;
1681
  if (!empty($file->id)) {
1682
    $cache_id = $file->id;
1690
  if (is_object($file) && !empty($file->fid)) {
1691
    $cache_id = $file->fid;
1683 1692
  }
1684
  elseif (is_string($file) && $op == 'create') {
1693
  elseif ($op == 'create' && is_string($file)) {
1685 1694
    $cache_id = $file;
1686 1695
  }
1696
  elseif ($op == 'create' && is_object($file) && !empty($file->type)) {
1697
    $cache_id = $file->type;
1698
  }
1687 1699
  else {
1688 1700
    $cache_id = drupal_hash_base64(serialize($file));
1689 1701
  }
......
1746 1758
 * Implements hook_file_entity_access().
1747 1759
 */
1748 1760
function file_entity_file_entity_access($op, $file, $account) {
1761
  // If the op is "create," all that's needed is to check the create permission.
1762
  if ($op == 'create') {
1763
    if (user_access('create files')) {
1764
      return FILE_ENTITY_ACCESS_ALLOW;
1765
    }
1766
  }
1749 1767
  // If the file URI is invalid, deny access.
1750 1768
  if (is_object($file) && isset($file->uri) && !file_valid_uri($file->uri)) {
1751 1769
    if(isset($file->is_new) && $file->is_new == true && user_access('create files')) {
......
1754 1772
    return FILE_ENTITY_ACCESS_DENY;
1755 1773
  }
1756 1774

  
1757
  if ($op == 'create') {
1758
    if (user_access('create files')) {
1759
      return FILE_ENTITY_ACCESS_ALLOW;
1760
    }
1761
  }
1762

  
1763 1775
  if (!empty($file)) {
1764 1776
    $type = is_string($file) ? $file : $file->type;
1765 1777

  
......
2137 2149
    'label' => t('Document'),
2138 2150
    'description' => t('A <em>Document</em> file is written information.'),
2139 2151
    'mimetypes' => array(
2152
      'text/html',
2140 2153
      'text/plain',
2154
      'application/acad',
2141 2155
      'application/msword',
2142 2156
      'application/vnd.ms-excel',
2143 2157
      'application/pdf',

Formats disponibles : Unified diff