You are here

function _views_summarize_get_prefix_suffix in Views Summarize 1.1.x

Same name and namespace in other branches
  1. 7 views_summarize.module \_views_summarize_get_prefix_suffix()

Gets the prefix and suffix for a summary's output, if they exist.

Parameters

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

Return value

array The prefix and suffix in an associative array.

1 call to _views_summarize_get_prefix_suffix()
views_summarize_type_currency in ./views_summarize.module
Creates the markup for the total value for a currency amount.

File

./views_summarize.module, line 479
Defines the functionality and Drupal hooks for this module.

Code

function _views_summarize_get_prefix_suffix($options) {
  $prefix_suffix = [
    'prefix' => '',
    'suffix' => '',
  ];
  if (!empty($options['views_field_settings']['prefix_suffix'])) {
    if (!empty($options['field_instance_settings']['prefix'])) {
      $prefix_suffix['prefix'] = $options['field_instance_settings']['prefix'];
    }
    if (!empty($options['field_instance_settings']['suffix'])) {
      $prefix_suffix['suffix'] = $options['field_instance_settings']['suffix'];
    }
  }
  return $prefix_suffix;
}