You are here

function template_preprocess_webform_analysis_component in Webform 7.4

Prerender function for webform-analysis-component.tpl.php.

File

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

Code

function template_preprocess_webform_analysis_component(&$variables) {
  $component_analysis = $variables['component_analysis'];
  $variables['node'] = $component_analysis['#node'];
  $variables['component'] = $component_analysis['#component'];

  // Ensure defaults.
  $variables['component_analysis']['#data'] += array(
    'table_header' => NULL,
    'table_rows' => array(),
    'other_data' => array(),
  );
  $variables['classes_array'][] = 'webform-analysis-component-' . $variables['component']['type'];
  $variables['classes_array'][] = 'webform-analysis-component--' . str_replace('_', '-', implode('--', webform_component_parent_keys($variables['node'], $variables['component'])));
}