? .project
? 428196.patch
Index: includes/admin.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/views/includes/admin.inc,v
retrieving revision 1.161.2.18
diff -u -p -r1.161.2.18 admin.inc
--- includes/admin.inc	15 Oct 2010 01:11:58 -0000	1.161.2.18
+++ includes/admin.inc	16 Oct 2010 20:58:12 -0000
@@ -3186,6 +3186,10 @@ function theme_views_ui_style_plugin_tab
       'align' => 'center',
     ),
     array(
+      'data' => t('Default order'),
+      'align' => 'center',
+    ),
+    array(
       'data' => t('Default sort'),
       'align' => 'center',
     ),
@@ -3202,6 +3206,10 @@ function theme_views_ui_style_plugin_tab
         'align' => 'center',
       );
       $row[] = array(
+        'data' => drupal_render($form['info'][$id]['default_sort_order']),
+        'align' => 'center',
+      );
+      $row[] = array(
         'data' => drupal_render($form['default'][$id]),
         'align' => 'center',
       );
@@ -3209,12 +3217,13 @@ function theme_views_ui_style_plugin_tab
     else {
       $row[] = '';
       $row[] = '';
+      $row[] = '';
     }
     $rows[] = $row;
   }
 
   // Add the special 'None' row.
-  $rows[] = array(t('None'), '', '', '', array('align' => 'center', 'data' => drupal_render($form['default'][-1])));
+  $rows[] = array(t('None'), '', '', '', '', array('align' => 'center', 'data' => drupal_render($form['default'][-1])));
 
   $output .= theme('table', $header, $rows);
   $output .= drupal_render($form);
Index: plugins/views_plugin_style_table.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/views/plugins/views_plugin_style_table.inc,v
retrieving revision 1.7.2.3
diff -u -p -r1.7.2.3 views_plugin_style_table.inc
--- plugins/views_plugin_style_table.inc	11 Mar 2010 00:06:18 -0000	1.7.2.3
+++ plugins/views_plugin_style_table.inc	16 Oct 2010 20:58:12 -0000
@@ -201,6 +201,14 @@ class views_plugin_style_table extends v
           '#process' => array('views_process_dependency'),
           '#dependency' => array($id => array($field)),
         );
+        $form['info'][$field]['default_sort_order'] = array(
+          '#type' => 'select',
+          '#options' => array('asc' => t('Ascending'), 'desc' => t('Descending')),
+          '#default_value' => !empty($this->options['info'][$field]['default_sort_order']) ? $this->options['info'][$field]['default_sort_order'] : 'asc',
+          '#process' => array('views_process_dependency'),
+          '#dependency_count' => 2,
+          '#dependency' => array($id => array($field), 'edit-style-options-info-' . $safe . '-sortable' => array(1)),
+        );
         // Provide an ID so we can have such things.
         $radio_id = form_clean_id('edit-default-' . $field);
         $form['default'][$field] = array(
Index: theme/theme.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/views/theme/theme.inc,v
retrieving revision 1.84.2.17
diff -u -p -r1.84.2.17 theme.inc
--- theme/theme.inc	12 Oct 2010 21:33:47 -0000	1.84.2.17
+++ theme/theme.inc	16 Oct 2010 20:58:12 -0000
@@ -343,11 +343,10 @@ function template_preprocess_views_view_
         $vars['header'][$field] = $label;
       }
       else {
-        // @todo -- make this a setting
-        $initial = 'asc';
+        $initial = !empty($options['info'][$field]['default_sort_order']) ? $options['info'][$field]['default_sort_order'] : 'asc';
 
-        if ($active == $field && $order == 'asc') {
-          $initial = 'desc';
+        if ($active == $field) {
+          $initial = ($order == 'asc') ? 'desc' : 'asc';
         }
 
         $title = t('sort by @s', array('@s' => $label));
