You are here

function theme_forena_data_table in Forena Reports 7.4

Same name and namespace in other branches
  1. 7.5 forena.common.inc \theme_forena_data_table()
3 theme calls to theme_forena_data_table()
forena_admin_reports in ./forena.admin.inc
Display reports to edit for admins in the structure menu Enter description here ...
forena_display_blocks in ./forena.data.inc
@file forena.data.inc Common files for displaying and previewing data blocks.
forena_select_block_list in ./forena.report.inc

File

./forena.common.inc, line 505
Common functions used throughout the project but loaded in this file to keep the module file lean.

Code

function theme_forena_data_table($variables) {
  $defaults = array(
    'caption' => '',
    'sticky' => FALSE,
    'colgroups' => array(),
    'empty' => '',
  );
  drupal_add_css(drupal_get_path('module', 'forena') . '/forena.css');
  if (forena_library_file('dataTables')) {
    drupal_add_js(drupal_get_path('module', 'forena') . '/forena.admin.js');
    drupal_add_js(forena_library_file('dataTables'));
  }

  // Default in values that theme_table expects.
  $variables['attributes'] = isset($variables['attributes']) ? array_merge($defaults, $variables['attributes']) : $defaults;
  $variables['attributes']['class'][] = 'dataTable-paged';
  $output = theme('table', $variables);
  return $output;
}