You are here

function theme_webform_results_submissions_header in Webform 7.4

Same name and namespace in other branches
  1. 5.2 webform_report.inc \theme_webform_results_submissions_header()
  2. 5 webform_report.inc \theme_webform_results_submissions_header()
  3. 6.3 includes/webform.report.inc \theme_webform_results_submissions_header()
  4. 6.2 webform_report.inc \theme_webform_results_submissions_header()
  5. 7.3 includes/webform.report.inc \theme_webform_results_submissions_header()

Theme the header of the submissions table.

This is done in it's own function so that webform can retrieve the header and use it for sorting the results.

1 theme call to theme_webform_results_submissions_header()
webform_results_submissions in includes/webform.report.inc
Retrieve lists of submissions for a given webform.

File

includes/webform.report.inc, line 186
This file includes helper functions for creating reports for webform.module.

Code

function theme_webform_results_submissions_header($variables) {
  $node = $variables['node'];
  $columns = array(
    array(
      'data' => t('#'),
      'field' => 'sid',
      'sort' => 'desc',
    ),
    array(
      'data' => t('Submitted'),
      'field' => 'submitted',
    ),
  );
  if (webform_results_access($node)) {
    $columns[] = array(
      'data' => t('User'),
      'field' => 'name',
    );
    $columns[] = array(
      'data' => t('IP Address'),
      'field' => 'remote_addr',
    );
  }
  $columns[] = array(
    'data' => t('Operations'),
    'colspan' => module_exists('print') ? 5 : 3,
  );
  return $columns;
}