You are here

function theme_slickgrid_views_plugin_table in Slickgrid 7.2

Same name and namespace in other branches
  1. 6 slickgrid.module \theme_slickgrid_views_plugin_table()
  2. 7 theme/theme.inc \theme_slickgrid_views_plugin_table()

Theme the form for the matrix style plugin

File

theme/theme.inc, line 451

Code

function theme_slickgrid_views_plugin_table($variables) {
  $form = $variables['form'];
  $output = drupal_render($form['description_markup']);
  $variables['header'] = array(
    t('Field'),
    t('Tab'),
    t('Width'),
    t('Sortable'),
  );
  $variables['rows'] = array();
  $plugin_types = slickgrid_get_plugin_types();
  $variables['header'] += $plugin_types;
  foreach (element_children($form['columns']) as $id) {
    $row = array();
    $row[] = drupal_render($form['columns'][$id]['name']);
    $row[] = drupal_render($form['columns'][$id]['tab']);
    $row[] = drupal_render($form['columns'][$id]['width']);
    $row[] = drupal_render($form['columns'][$id]['sortable']);
    foreach (array_keys($plugin_types) as $plugin_type) {
      $row[] = drupal_render($form['columns'][$id][$plugin_type]);
    }
    $variables['rows'][] = $row;
  }
  $output .= theme('table', $variables);
  $output .= drupal_render_children($form);
  return $output;
}