You are here

function _views_summarize_get_header in Views Summarize 7.2

Gets the record's value after stripping invalid characters.

Parameters

string $label: The value from which to strip invalid characters.

array $options: The options element of the variables array that is passed into the summary theme function.

bool $check_empties: Specify TRUE if the summary might include or exclude empty values.

bool $colspan: Specify TRUE to add colspan with a value of 2.

Return value

array The value with invalid characters removed.

6 calls to _views_summarize_get_header()
theme_views_summarize_type_average in ./views_summarize.module
Themes the average of the values in the column.
theme_views_summarize_type_count in ./views_summarize.module
Themes the count of values in the column.
theme_views_summarize_type_range in ./views_summarize.module
Themes the minimum and maximum values in the column.
theme_views_summarize_type_spread in ./views_summarize.module
Themes a spread table for the values in the column.
theme_views_summarize_type_total in ./views_summarize.module
Themes the total of the values in the column.

... See full list

File

./views_summarize.module, line 512
Provides a views display that outputs summaries of the values in a table.

Code

function _views_summarize_get_header($label, array $options, $check_empties = TRUE, $colspan = FALSE) {
  if ($check_empties) {
    if (empty($options['views_style_options']['include_empties'])) {
      $label = $label . ' ' . t('(excluding empty values)');
    }
    else {
      $label = $label . ' ' . t('(including empty values)');
    }
  }
  $header = array(
    array(
      'data' => $label,
    ),
  );
  if ($colspan) {
    $header[0]['colspan'] = 2;
  }
  return $header;
}