You are here

function track_da_files_table in Track da files 8

Same name and namespace in other branches
  1. 7 includes/track_da_files.admin.inc \track_da_files_table()

Builds a table which shows number of displays by file.

File

includes/track_da_files.admin.inc, line 720
Administrative page callbacks for Track da files module.

Code

function track_da_files_table($fid = NULL, $pid = NULL) {
  $output = '';
  $variables = '';

  // Load specific CSS.
  drupal_add_css(drupal_get_path('module', 'track_da_files') . '/includes/track_da_files.css');
  if (!empty($fid) && !empty($pid)) {
    $variables = track_da_files_table_build_file_report($fid, $pid);
    $file = file_load($fid);
    $filename = $file->filename;
    $output .= '<p>' . t('Datas for @filename', array(
      '@filename' => $filename,
    )) . '</p>';
    $form = drupal_get_form('track_da_files_table_action_form', $fid, $pid);
  }
  else {
    $variables = track_da_files_table_build();
    $form = drupal_get_form('track_da_files_table_action_form');
  }

  // Table.
  $output .= theme('table', $variables);

  // Pager.
  $output .= theme('pager', array(), 20, 0);

  // Clear datas and export to CSV buttons.
  $output .= drupal_render($form);
  return $output;
}