You are here

function template_preprocess_views_ui_style_plugin_flot_views_table in Flot 8

File

flot_views_time/flot_views_time.theme.inc, line 84
Template, theme, and preprocess functions for the flot_views_time mosule.

Code

function template_preprocess_views_ui_style_plugin_flot_views_table(&$variables) {
  $form = $variables['form'];
  $header = array(
    t('Series'),
    t('X Field'),
    t('Y Field'),
    t('Points'),
    t('Lines'),
    t('2nd Axis'),
  );
  $rows = array();
  foreach (Element::children($form['columns']['x']) as $id) {
    $row = array();
    $row[]['data'] = $id;
    $row[]['data'] = $form['columns']['x'][$id];
    $row[]['data'] = $form['columns']['y'][$id];
    $row[]['data'] = $form['info'][$id]['points'];
    $row[]['data'] = $form['info'][$id]['lines'];
    $row[]['data'] = $form['info'][$id]['second_axis'];
    $rows[] = $row;
  }

  // Add the special 'None' row.
  //  $rows[] = array(array('data' => t('None'), 'colspan' => 6), array('align' => 'center', 'data' => $form['default'][-1]), array('colspan' => 2));
  // Unset elements from the form array that are used to build the table so that
  // they are not rendered twice.
  //  unset($form['default']);
  unset($form['info']);
  unset($form['columns']);
  $variables['table'] = array(
    '#type' => 'table',
    '#theme' => 'table__views_ui_style_plugin_flot_views_table',
    '#header' => $header,
    '#rows' => $rows,
  );
  $variables['form'] = $form;
}