You are here

function theme_views_pdf_plugin_style_table in Views PDF 8

Same name and namespace in other branches
  1. 6 views_pdf.admin.inc \theme_views_pdf_plugin_style_table()
  2. 7.3 views_pdf.admin.inc \theme_views_pdf_plugin_style_table()
  3. 7 views_pdf.admin.inc \theme_views_pdf_plugin_style_table()
  4. 7.2 views_pdf.admin.inc \theme_views_pdf_plugin_style_table()

Theme function to style the table UI.

Theme function to style the table UI in the Table Style Settings pages in the view editing form.

File

./views_pdf.admin.inc, line 15
Theme function for enhance the views admin interface for PDF options.

Code

function theme_views_pdf_plugin_style_table($variables) {
  $form = $variables['form'];
  $output = drupal_render($form['description_markup']);
  $header = array(
    t('Field'),
    t('Header Style'),
    t('Body Style'),
    t('Position'),
  );
  $rows = array();
  foreach (element_children($form['info']) as $id) {
    $row = array();
    $row[] = array(
      'data' => drupal_render($form['info'][$id]['name']),
      'width' => '20%',
    );
    $row[] = array(
      'data' => drupal_render($form['info'][$id]['header_style']),
      'width' => '30%',
    );
    $row[] = array(
      'data' => drupal_render($form['info'][$id]['body_style']),
      'width' => '30%',
    );
    $row[] = array(
      'data' => drupal_render($form['info'][$id]['position']),
      'width' => '20%',
    );
    $rows[] = $row;
  }
  $output .= theme('table', array(
    'header' => $header,
    'rows' => $rows,
  ));
  $output .= drupal_render_children($form);
  return $output;
}