You are here

function _auditfiles_merge_file_references_get_file_usage_data in Audit Files 7.3

Converts file usage data into a themed table for display.

Parameters

array $fu_results: An array of objects representing the file usages of a file.

Return value

array The table of file usages, themed for display.

File

./auditfiles.mergefilereferences.inc, line 996
Generates a report showing & allowing for merging potential duplicate files.

Code

function _auditfiles_merge_file_references_get_file_usage_data(array $fu_results) {

  // Add the file usages to the display record.
  $fu_header = array(
    t('Module'),
    t('Type'),
    t('Content ID'),
    t('Count'),
  );
  $fu_rows = array();
  foreach ($fu_results as $fu_result) {

    // Add the data to the collective.
    $fu_rows[] = array(
      $fu_result->module,
      $fu_result->type,
      $fu_result->type == 'node' ? l($fu_result->id, 'node/' . $fu_result->id) : $fu_result->id,
      $fu_result->count,
    );
  }

  // Theme the table.
  return theme('table', array(
    'header' => $fu_header,
    'rows' => $fu_rows,
  ));
}