Projet

Général

Profil

Révision ca0757b9

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

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/file_entity/views/views_handler_field_file_link_usage.inc
25 25
    $this->options['alter']['path'] = "file/$file->fid/usage";
26 26
    $this->options['alter']['query'] = drupal_get_destination();
27 27

  
28
    $text = !empty($this->options['text']) ? $this->options['text'] : t('Usage');
28
    // Get total count for each file.
29
    $total_count = 0;
30
    foreach (file_usage_list($file) as $module => $usage) {
31
      foreach ($usage as $entity_type => $entity_ids) {
32
        foreach ($entity_ids as $id => $count) {
33
          $total_count += $count;
34
        }
35
      }
36
    }
37

  
38
    $text = !empty($this->options['text']) ? $this->options['text'] : format_plural((int) $total_count, '1 place', '@count places');
29 39
    return $text;
30 40
  }
31 41
}

Formats disponibles : Unified diff