--- views_bulk_operations/views_bulk_operations.views.inc.orig  2008-07-30 15:22:21.000000000 +0200
+++ views_bulk_operations/views_bulk_operations.views.inc       2008-07-30 14:53:57.000000000 +0200
@@ -8,7 +8,7 @@
         'title' => t('Bulk Operations'),
         'help' => t('Displays nodes with checkmarks for bulk actions.'),
         'handler' => 'views_bulk_operations_plugin_style',
-        'uses row plugin' => TRUE,
+        'uses row plugin' => FALSE,
         'uses fields' => TRUE,
         'uses options' => TRUE,
         'type' => 'normal',
@@ -17,13 +17,53 @@
   );
 }
 
-class views_bulk_operations_plugin_style extends views_plugin_style {
+/**
+ * We inherit from the table plugin and make use of its sorting capabilities.
+ * But we don't implement the full table functionality at the moment, i.e.,
+ * no columns can be used. We just display all fields in a table.
+ */
+class views_bulk_operations_plugin_style extends views_plugin_style_table {
   function options(&$options) {
     $options['selected_operations'] = array();
     $this->populate_operations($options);
+
+    $options['default'] = array('default' => '');
+    $options['info'] = array('default' => array());
+    $options['override'] = array('default' => TRUE);
+    $options['order'] = array('default' => 'asc');
   }
 
   function options_form(&$form, &$form_values) {
+    parent::options_form($form, $form_values);
+    $handlers = $this->display->handler->get_handlers('field');
+    if (empty($handlers)) {
+      $form['error_markup'] = array(
+        '#value' => t('You need at least one field before you can configure your table settings'),
+        '#prefix' => '<div class="error form-item description">',
+        '#suffix' => '</div>',
+      );
+      return;
+    }
+
+    // We don't use table columns functionality and therefore don't need separators.
+    unset($form['columns']);
+    foreach ($handlers as $field => $handler) {
+      unset($form['info'][$field]['separator']);
+    }
+
+    // No sticky headers yet.
+    unset($form['sticky']);
+
+    // Theme our configure options for sortable columns.
+    $form['#theme'] = 'views_ui_style_plugin_bulk';
+
+    $form['description_markup'] = array(
+      '#prefix' => '<div class="description form-item">',
+      '#suffix' => '</div>',
+      '#value' => t('Check the sortable box to make that column click sortable, and check the default sort radio to determine which column will be sorted by default, if any. You may control fields order and labels in the fields section.'),
+    );
+
+
     $form['selected_operations'] = array(
       '#type' => 'checkboxes',
       '#title' => t('Selected operations'),
@@ -109,3 +149,51 @@
   }
 }
 
+
+
+/**
+ * Theme the form for the table style plugin
+ */
+function theme_views_ui_style_plugin_bulk($form) {
+  $output = drupal_render($form['description_markup']);
+ 
+  $header = array(
+    t('Field'),
+    array(
+      'data' => t('Sortable'),
+      'align' => 'center',
+    ),
+    array(
+      'data' => t('Default sort'),
+      'align' => 'center',
+    ),
+  );
+  $rows = array();
+  foreach (element_children($form['info']) as $id) {
+    $row = array();
+    $row[] = drupal_render($form['info'][$id]['name']);
+    if (!empty($form['info'][$id]['sortable'])) {
+      $row[] = array(
+        'data' => drupal_render($form['info'][$id]['sortable']),
+        'align' => 'center',
+      );
+      $row[] = array(
+        'data' => drupal_render($form['default'][$id]),
+        'align' => 'center',
+      );
+    }
+    else {
+      $row[] = '';
+      $row[] = '';
+    }
+    $rows[] = $row;
+  }
+
+  // Add the special 'None' row.
+  $rows[] = array(t('None'), '', array('align' => 'center', 'data' => drupal_render($form['default'][-1])));
+
+  $output .= theme('table', $header, $rows);
+  $output .= drupal_render($form);
+  return $output;
+}
+
--- views_bulk_operations/views_bulk_operations.module.orig     2008-07-30 15:22:14.000000000 +0200
+++ views_bulk_operations/views_bulk_operations.module  2008-07-30 14:43:16.000000000 +0200
@@ -27,17 +27,49 @@
     'views_bulk_operations_confirmation' => array(
       'arguments' => array('nodes' => NULL),
     ),
+    'views_ui_style_plugin_bulk' => array(
+      'arguments' => array('form' => NULL),
+    ),
   );
 }
 
 function theme_views_node_selector($element) {
   $view = $element['#view'];
 
+  $options  = $view->style_plugin->options;
+  $handler  = $view->style_plugin;
+
+  $active   = !empty($handler->active) ? $handler->active : '';
+  $order    = !empty($handler->order) ? $handler->order : 'asc';
+
+  $query    = tablesort_get_querystring();
+  if ($query) {
+    $query = '&'. $query;
+  }
+
   // Construct header.
   $header = array();
   $header[] = theme('table_select_header_cell');
   foreach ($view->field as $id => $field) {
-    $header[] = $field->label();
+    $label = $field->label();
+    if (empty($options['info'][$id]['sortable'])) {
+      $header[] = $label;
+    }
+    // Sortable style
+    else {
+      $initial = 'asc';
+      if ($active == $id && $order == 'asc') {
+       $initial = 'desc';
+      }
+      $image = theme('tablesort_indicator', $initial);
+      $title = t('sort by @s', array('@s' => $label));
+      $link_options = array(
+        'html' => TRUE,
+        'attributes' => array('title' => $title),
+        'query' => 'order='. urlencode($id) .'&sort='. $initial . $query,
+       );
+      $header[] = l($label . $image, $_GET['q'], $link_options);
+    }
   }
   
   // Construct rows.
